diff options
author | Sunil Shetye | 2018-06-18 23:41:23 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-19 10:31:46 +0530 |
commit | 1170404c7650cb531534b308f103c9b6abd50d14 (patch) | |
tree | a6a61ae2a9a3592440483906ce6c7254b3243553 /js/MatrixOp/MATMUL.js | |
parent | cd5b0819762aa4a1cb72d29ab7b8c3ac65bbad76 (diff) | |
download | sci2js-1170404c7650cb531534b308f103c9b6abd50d14.tar.gz sci2js-1170404c7650cb531534b308f103c9b6abd50d14.tar.bz2 sci2js-1170404c7650cb531534b308f103c9b6abd50d14.zip |
handle multiple rows
Diffstat (limited to 'js/MatrixOp/MATMUL.js')
-rw-r--r-- | js/MatrixOp/MATMUL.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/js/MatrixOp/MATMUL.js b/js/MatrixOp/MATMUL.js index 73803d6a..72933c06 100644 --- a/js/MatrixOp/MATMUL.js +++ b/js/MatrixOp/MATMUL.js @@ -3,8 +3,8 @@ function MATMUL() { MATMUL.prototype.define = function MATMUL() { model=scicos_model(); model.sim=list("matmul_m",4); -model.in1=[-1,-2]; -model.in2=[-2,-3]; +model.in1=[[-1],[-2]]; +model.in2=[[-2],[-3]]; model.out=-1; model.out2=-3; model.dep_ut=[true,false]; @@ -32,7 +32,7 @@ if (size(label,"*")==2) { label[3-1]=sci2exp(1); } while (true) { -[ok,dtype,rule,np,exprs]=scicos_getvalue(["Set MATMUL parameter","For the Multipication rule:"," 1= Matrix by Matrix"," 2= Matrix by Matrix element wise "," 3= Matrix by Scalar","In the third case the second input will be the scalar"],["Datatype(1=real double 2=Complex 3=int32 ...)","Multiplication rule","Do on Overflow(0=Nothing 1=Saturate 2=Error)"],list("vec",1,"vec",1,"vec",1),label); +[ok,dtype,rule,np,exprs]=scicos_getvalue([["Set MATMUL parameter"],["For the Multipication rule:"],[" 1= Matrix by Matrix"],[" 2= Matrix by Matrix element wise "],[" 3= Matrix by Scalar"],["In the third case the second input will be the scalar"]],[["Datatype(1=real double 2=Complex 3=int32 ...)"],["Multiplication rule"],["Do on Overflow(0=Nothing 1=Saturate 2=Error)"]],list("vec",1,"vec",1,"vec",1),label); if (!ok) { break; } @@ -48,8 +48,8 @@ ok=false; if ((dtype==1||dtype==2)) { np=0; } -TABMIN=[0,0,-(2^31),-(2^15),-(2^7),0,0,0]; -TABMAX=[0,0,(2^31)-1,(2^15)-1,(2^7)-1,(2^32)-1,(2^16)-1,(2^8)-1]; +TABMIN=[[0],[0],[-(2^31)],[-(2^15)],[-(2^7)],[0],[0],[0]]; +TABMAX=[[0],[0],[(2^31)-1],[(2^15)-1],[(2^7)-1],[(2^32)-1],[(2^16)-1],[(2^8)-1]]; if (rule==2) { if (np==0) { model.sim=list("matmul2_m",4); @@ -126,20 +126,20 @@ kmax=TABMAX(dtype); it=dtype*ones(1,2); ot=dtype; if (rule==1) { -in1=[-1,-2,-2,-3]; +in1=[[-1,-2],[-2,-3]]; out=[-1,-3]; } else if (rule==2) { -in1=[-1,-2,-1,-2]; +in1=[[-1,-2],[-1,-2]]; out=[-1,-2]; } else { -in1=[-1,-2,1,1]; +in1=[[-1,-2],[1,1]]; out=[-1,-2]; } [model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); if (ok) { label=exprs; model.ipar=rule; -model.rpar=[kmin,kmax]; +model.rpar=[[kmin],[kmax]]; graphics.exprs=label; x.graphics=graphics; x.model=model; |