From 1170404c7650cb531534b308f103c9b6abd50d14 Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Mon, 18 Jun 2018 23:41:23 +0530 Subject: handle multiple rows --- js/MatrixOp/MATMUL.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'js/MatrixOp/MATMUL.js') 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; -- cgit