Subversion Repositories wimsdev

Rev

Blame | Last modification | View Log | RSS feed

!goto $wims_read_parm

:def
title=Weighted data product
synonyme=weighted product, product weighted
input=data2d
!exit

:proc

pari_header=dmat=Mat([$fml2]);w=sum(x=1,$cnt,dmat[x,2]);
result=!exec pari print(prod(x=1,$cnt,dmat[x,1]^dmat[x,2]));\
        print(w);
!distribute lines $result into result, totweight

!exit

:output

<center>
Weighted product =
!htmlmath $result
</center> <p>
Data: $cnt weighted numbers { $fml3 } (total weight = $totweight).
<p>
!exit