Subversion Repositories wimsdev

Rev

Rev 3265 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!if $wims_read_parm!=slib_header
2
 !goto proc
3
!endif
4
slib_title=Product of data
5
slib_parms=1\
6
 ,[data] or [data],[weight]
7
slib_author=Adeline Grelot
8
slib_out=data product 
9
slib_comment=Data and weight can be recognized under many formats, \
10
 in particular as a matrix (with data before weight).
11
slib_example=[2,-7,6]\
12
[2,7,6;1,1,4]\
13
[2,1;7,1;6,4]\
14
[2,7,6],[1,1,4]
15
 
16
!exit
17
 
18
:proc
19
 
20
!readproc slib/stat/dataproc $wims_read_parm
21
 
22
!if $slib_cnt=0
23
	slib_out=1
24
!else
25
	!if $slib_weight =$empty
26
	slib_out=!product x for x in $slib_data
27
	!else
28
	slib_cnt=!itemcnt $slib_data
29
		slib_out=!exec pari print(prod(x=1,$slib_cnt,[$slib_data][x]^[$slib_weight][x]))
30
	!endif weight
31
!endif
32
slib_out =!trim $slib_out