From 7c70459c10aed0d74ee03896abaf47fefdbf7c8f Mon Sep 17 00:00:00 2001 From: Sunil Shetye Date: Mon, 25 Jun 2018 12:08:56 +0530 Subject: separate out code for getvalue --- js/MatrixOp/CUMSUM.js | 140 ++++++++++++------------- js/MatrixOp/EXTRACT.js | 126 +++++++++++----------- js/MatrixOp/EXTTRI.js | 134 ++++++++++++------------ js/MatrixOp/MATBKSL.js | 104 +++++++++---------- js/MatrixOp/MATCATH.js | 88 ++++++++-------- js/MatrixOp/MATCATV.js | 90 ++++++++-------- js/MatrixOp/MATDET.js | 104 +++++++++---------- js/MatrixOp/MATDIAG.js | 104 +++++++++---------- js/MatrixOp/MATDIV.js | 104 +++++++++---------- js/MatrixOp/MATEIG.js | 136 ++++++++++++------------ js/MatrixOp/MATEXPM.js | 104 +++++++++---------- js/MatrixOp/MATINV.js | 104 +++++++++---------- js/MatrixOp/MATLU.js | 98 +++++++++--------- js/MatrixOp/MATMAGPHI.js | 110 ++++++++++---------- js/MatrixOp/MATMUL.js | 264 +++++++++++++++++++++++------------------------ js/MatrixOp/MATPINV.js | 104 +++++++++---------- js/MatrixOp/MATRESH.js | 128 +++++++++++------------ js/MatrixOp/MATSING.js | 142 ++++++++++++------------- js/MatrixOp/MATSUM.js | 144 +++++++++++++------------- js/MatrixOp/MATTRAN.js | 86 +++++++-------- js/MatrixOp/MATZCONJ.js | 46 ++++----- js/MatrixOp/MATZREIM.js | 110 ++++++++++---------- js/MatrixOp/RICC.js | 86 +++++++-------- js/MatrixOp/ROOTCOEF.js | 104 +++++++++---------- js/MatrixOp/SQRT.js | 76 +++++++------- js/MatrixOp/SUBMAT.js | 126 +++++++++++----------- 26 files changed, 1481 insertions(+), 1481 deletions(-) (limited to 'js/MatrixOp') diff --git a/js/MatrixOp/CUMSUM.js b/js/MatrixOp/CUMSUM.js index aeedaf26..08cc8d5a 100644 --- a/js/MatrixOp/CUMSUM.js +++ b/js/MatrixOp/CUMSUM.js @@ -1,92 +1,92 @@ /* autogenerated from "macros/MatrixOp/CUMSUM.sci" */ function CUMSUM() { CUMSUM.prototype.define = function CUMSUM() { -model=scicos_model(); -function_name="cumsum_m"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=-1; -model.out2=-2; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(0)]]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "cumsum_m"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = -1; + model.out2 = -2; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(0)]]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } CUMSUM.prototype.details = function CUMSUM() { } CUMSUM.prototype.get = function CUMSUM() { } CUMSUM.prototype.set = function CUMSUM() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,decomptyp,lab]=scicos_getvalue("Set CUMSUM block parameters",[["Datatype(1=real double 2=Complex)"],["Sum along (0=the first non singleton dimension 1=Rows 2=Columns)"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,typ,decomptyp,lab] = scicos_getvalue("Set CUMSUM block parameters",[["Datatype(1=real double 2=Complex)"],["Sum along (0=the first non singleton dimension 1=Rows 2=Columns)"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -label=lab; -if ((typ==1)) { -if ((decomptyp==0)) { -function_name="cumsum_m"; -out=[-1,-2]; -} else if ((decomptyp==1)) { -function_name="cumsum_r"; -out=[-1,1]; -} else if ((decomptyp==2)) { -function_name="cumsum_c"; -out=[1,-2]; -} else { + label = lab; + if ((typ==1)) { + if ((decomptyp==0)) { + function_name = "cumsum_m"; + out = [-1,-2]; + } else if ((decomptyp==1)) { + function_name = "cumsum_r"; + out = [-1,1]; + } else if ((decomptyp==2)) { + function_name = "cumsum_c"; + out = [1,-2]; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=1; -ot=1; -} else if ((typ==2)) { -if ((decomptyp==0)) { -function_name="cumsumz_m"; -} else if ((decomptyp==1)) { -function_name="cumsumz_r"; -} else if ((decomptyp==2)) { -function_name="cumsumz_c"; -} else { + it = 1; + ot = 1; + } else if ((typ==2)) { + if ((decomptyp==0)) { + function_name = "cumsumz_m"; + } else if ((decomptyp==1)) { + function_name = "cumsumz_r"; + } else if ((decomptyp==2)) { + function_name = "cumsumz_c"; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=2; -ot=2; -} else { + it = 2; + ot = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); } -if (ok) { -model.sim=list(function_name,funtyp); -arg1.model=model; -graphics.exprs=label; -arg1.graphics=graphics; -x=arg1; + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + x = arg1; break; } } diff --git a/js/MatrixOp/EXTRACT.js b/js/MatrixOp/EXTRACT.js index 0f555aee..0d5e5c18 100644 --- a/js/MatrixOp/EXTRACT.js +++ b/js/MatrixOp/EXTRACT.js @@ -1,90 +1,90 @@ /* autogenerated from "macros/MatrixOp/EXTRACT.sci" */ function EXTRACT() { EXTRACT.prototype.define = function EXTRACT() { -model=scicos_model(); -function_name="extract"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=1; -model.out2=1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[1,1,1,1]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp([1])],[sci2exp([1])]]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "extract"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = 1; + model.out2 = 1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = [1,1,1,1]; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp([1])],[sci2exp([1])]]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } EXTRACT.prototype.details = function EXTRACT() { } EXTRACT.prototype.get = function EXTRACT() { } EXTRACT.prototype.set = function EXTRACT() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,a,b,exprs]=scicos_getvalue("Set EXTRACT Block",[["Datatype (1=real double 2=Complex)"],["Lines to extract"],["Columns to extract"]],list("vec",1,"mat",[1,-1],"mat",[1,-1]),label); -a=a.slice(); -b=b.slice(); -if (!ok) { + while (true) { + [ok,typ,a,b,exprs] = scicos_getvalue("Set EXTRACT Block",[["Datatype (1=real double 2=Complex)"],["Lines to extract"],["Columns to extract"]],list("vec",1,"mat",[1,-1],"mat",[1,-1]),label); + a = a.slice(); + b = b.slice(); + if (!ok) { break; } -if ((typ==1)) { -function_name="extract"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="extractz"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "extract"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "extractz"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -ma=size(a,1); -mb=size(b,1); -if ((ma==0||mb==0)) { + ma = size(a,1); + mb = size(b,1); + if ((ma==0||mb==0)) { message("empty field"); -ok=false; + ok = false; } for (i=1;i<=ma;i+=1) { -if ((a[i-1]<=0)) { + if ((a[i-1]<=0)) { message("invalid index"); -ok=false; + ok = false; } } for (j=1;j<=mb;j+=1) { -if ((b[j-1]<=0)) { + if ((b[j-1]<=0)) { message("invalid index"); -ok=false; + ok = false; } } -model.ipar=[[a],[b],[ma],[mb]]; -in1=[model.in1,model.in2]; -out=[ma,mb]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + model.ipar = [[a],[b],[ma],[mb]]; + in1 = [model.in1,model.in2]; + out = [ma,mb]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/EXTTRI.js b/js/MatrixOp/EXTTRI.js index 8f158f33..319de0cc 100644 --- a/js/MatrixOp/EXTTRI.js +++ b/js/MatrixOp/EXTTRI.js @@ -1,89 +1,89 @@ /* autogenerated from "macros/MatrixOp/EXTTRI.sci" */ function EXTTRI() { EXTTRI.prototype.define = function EXTTRI() { -model=scicos_model(); -function_name="extrilz"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=-1; -model.out2=-2; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(1)]]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "extrilz"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = -1; + model.out2 = -2; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(1)]]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } EXTTRI.prototype.details = function EXTTRI() { } EXTTRI.prototype.get = function EXTTRI() { } EXTTRI.prototype.set = function EXTTRI() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,decomptyp,lab]=scicos_getvalue("Set EXTTRI block parameters",[["Datatype(1=real double 2=Complex)"],["extraction type (1=lower 2=upper 3=diagonal)"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,typ,decomptyp,lab] = scicos_getvalue("Set EXTTRI block parameters",[["Datatype(1=real double 2=Complex)"],["extraction type (1=lower 2=upper 3=diagonal)"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -label=lab; -if ((typ==1)) { -if ((decomptyp==1)) { -function_name="exttril"; -} else if ((decomptyp==2)) { -function_name="exttriu"; -} else if ((decomptyp==3)) { -function_name="extdiag"; -} else { + label = lab; + if ((typ==1)) { + if ((decomptyp==1)) { + function_name = "exttril"; + } else if ((decomptyp==2)) { + function_name = "exttriu"; + } else if ((decomptyp==3)) { + function_name = "extdiag"; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=1; -ot=1; -} else if ((typ==2)) { -if ((decomptyp==1)) { -function_name="exttrilz"; -} else if ((decomptyp==2)) { -function_name="exttriuz"; -} else if ((decomptyp==3)) { -function_name="extdiagz"; -} else { + it = 1; + ot = 1; + } else if ((typ==2)) { + if ((decomptyp==1)) { + function_name = "exttrilz"; + } else if ((decomptyp==2)) { + function_name = "exttriuz"; + } else if ((decomptyp==3)) { + function_name = "extdiagz"; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=2; -ot=2; -} else { + it = 2; + ot = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); } -if (ok) { -model.sim=list(function_name,funtyp); -arg1.model=model; -graphics.exprs=label; -arg1.graphics=graphics; -x=arg1; + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + x = arg1; break; } } diff --git a/js/MatrixOp/MATBKSL.js b/js/MatrixOp/MATBKSL.js index 09f4ca91..a87bef95 100644 --- a/js/MatrixOp/MATBKSL.js +++ b/js/MatrixOp/MATBKSL.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/MATBKSL.sci" */ function MATBKSL() { MATBKSL.prototype.define = function MATBKSL() { -model=scicos_model(); -function_name="mat_bksl"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=[[-1],[-1]]; -model.in2=[[-2],[-3]]; -model.intyp=[1,1]; -model.out=-2; -model.out2=-3; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_bksl"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = [[-1],[-1]]; + model.in2 = [[-2],[-3]]; + model.intyp = [1,1]; + model.out = -2; + model.out2 = -3; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATBKSL.prototype.details = function MATBKSL() { } MATBKSL.prototype.get = function MATBKSL() { } MATBKSL.prototype.set = function MATBKSL() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set MATBKSL Block",["Datatype (1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set MATBKSL Block",["Datatype (1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_bksl"; -ot=1; -it=[1,1]; -} else if ((typ==2)) { -function_name="matz_bksl"; -ot=2; -it=[2,2]; -} else { + if ((typ==1)) { + function_name = "mat_bksl"; + ot = 1; + it = [1,1]; + } else if ((typ==2)) { + function_name = "matz_bksl"; + ot = 2; + it = [2,2]; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATCATH.js b/js/MatrixOp/MATCATH.js index 830403aa..29da12eb 100644 --- a/js/MatrixOp/MATCATH.js +++ b/js/MatrixOp/MATCATH.js @@ -1,59 +1,59 @@ /* autogenerated from "macros/MatrixOp/MATCATH.sci" */ function MATCATH() { MATCATH.prototype.define = function MATCATH() { -model=scicos_model(); -function_name="mat_cath"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=[[-1],[-1]]; -model.in2=[[-2],[-3]]; -model.intyp=[1,1]; -model.out=-1; -model.out2=0; -model.outtyp=-1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(2)]; -gr_i=[]; -x=standard_define([2,3],model,label,gr_i); + model = scicos_model(); + function_name = "mat_cath"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = [[-1],[-1]]; + model.in2 = [[-2],[-3]]; + model.intyp = [1,1]; + model.out = -1; + model.out2 = 0; + model.outtyp = -1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(2)]; + gr_i = []; + x = standard_define([2,3],model,label,gr_i); } MATCATH.prototype.details = function MATCATH() { } MATCATH.prototype.get = function MATCATH() { } MATCATH.prototype.set = function MATCATH() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")>1) { -label="size(evstr("+label[2-1]+"),\'*\')"; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")>1) { + label = "size(evstr("+label[2-1]+"),\'*\')"; } -while (true) { -[ok,nin,lab]=scicos_getvalue("Set MATCATH block parameters",["Number of input"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,nin,lab] = scicos_getvalue("Set MATCATH block parameters",["Number of input"],list("vec",1),label); + if (!ok) { break; } -label=lab; -in1=[-1*(ones(nin,1)),-(transpose([2:nin+1]))]; -out=[-1,0]; -it=-1*(ones(nin,1)); -ot=-1; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -if (ok) { -funtyp=4; -model.sim=list("mat_cath",funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + label = lab; + in1 = [-1*(ones(nin,1)),-(transpose([2:nin+1]))]; + out = [-1,0]; + it = -1*(ones(nin,1)); + ot = -1; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + if (ok) { + funtyp = 4; + model.sim = list("mat_cath",funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATCATV.js b/js/MatrixOp/MATCATV.js index 3d8cfe3f..02682ea6 100644 --- a/js/MatrixOp/MATCATV.js +++ b/js/MatrixOp/MATCATV.js @@ -1,60 +1,60 @@ /* autogenerated from "macros/MatrixOp/MATCATV.sci" */ function MATCATV() { MATCATV.prototype.define = function MATCATV() { -l1=[[2],[2]]; -model=scicos_model(); -function_name="mat_catv"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in2=[[-1],[-1]]; -model.in1=[[-2],[-3]]; -model.intyp=[-1,-1]; -model.out=0; -model.out2=-1; -model.outtyp=-1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(2)]; -gr_i=[]; -x=standard_define([2,3],model,label,gr_i); + l1 = [[2],[2]]; + model = scicos_model(); + function_name = "mat_catv"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in2 = [[-1],[-1]]; + model.in1 = [[-2],[-3]]; + model.intyp = [-1,-1]; + model.out = 0; + model.out2 = -1; + model.outtyp = -1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(2)]; + gr_i = []; + x = standard_define([2,3],model,label,gr_i); } MATCATV.prototype.details = function MATCATV() { } MATCATV.prototype.get = function MATCATV() { } MATCATV.prototype.set = function MATCATV() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")>1) { -label="size(evstr("+label[2-1]+"),\'*\')"; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")>1) { + label = "size(evstr("+label[2-1]+"),\'*\')"; } -while (true) { -[ok,nin,lab]=scicos_getvalue("Set MATCATV block parameters",["Number od inputs"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,nin,lab] = scicos_getvalue("Set MATCATV block parameters",["Number od inputs"],list("vec",1),label); + if (!ok) { break; } -label=lab; -in1=[-(transpose([2:nin+1])),-ones(nin,1)]; -it=-ones(nin,1); -ot=-1; -out=[0,-1]; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -if (ok) { -funtyp=4; -model.sim=list("mat_catv",funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + label = lab; + in1 = [-(transpose([2:nin+1])),-ones(nin,1)]; + it = -ones(nin,1); + ot = -1; + out = [0,-1]; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + if (ok) { + funtyp = 4; + model.sim = list("mat_catv",funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATDET.js b/js/MatrixOp/MATDET.js index 40baf95c..41f4a0a4 100644 --- a/js/MatrixOp/MATDET.js +++ b/js/MatrixOp/MATDET.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/MATDET.sci" */ function MATDET() { MATDET.prototype.define = function MATDET() { -model=scicos_model(); -function_name="mat_det"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-1; -model.intyp=1; -model.out=1; -model.out2=1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_det"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -1; + model.intyp = 1; + model.out = 1; + model.out2 = 1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATDET.prototype.details = function MATDET() { } MATDET.prototype.get = function MATDET() { } MATDET.prototype.set = function MATDET() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set MATDET Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set MATDET Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_det"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="matz_det"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "mat_det"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "matz_det"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATDIAG.js b/js/MatrixOp/MATDIAG.js index e90fa6db..5c565daa 100644 --- a/js/MatrixOp/MATDIAG.js +++ b/js/MatrixOp/MATDIAG.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/MATDIAG.sci" */ function MATDIAG() { MATDIAG.prototype.define = function MATDIAG() { -model=scicos_model(); -function_name="mat_diag"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=1; -model.intyp=1; -model.out=-1; -model.out2=-1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_diag"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = 1; + model.intyp = 1; + model.out = -1; + model.out2 = -1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATDIAG.prototype.details = function MATDIAG() { } MATDIAG.prototype.get = function MATDIAG() { } MATDIAG.prototype.set = function MATDIAG() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set MATDIAG Block",["Datatype (1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set MATDIAG Block",["Datatype (1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_diag"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="matz_diag"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "mat_diag"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "matz_diag"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATDIV.js b/js/MatrixOp/MATDIV.js index 9a8b3e48..01922e06 100644 --- a/js/MatrixOp/MATDIV.js +++ b/js/MatrixOp/MATDIV.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/MATDIV.sci" */ function MATDIV() { MATDIV.prototype.define = function MATDIV() { -model=scicos_model(); -function_name="mat_div"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=[[-1],[-2]]; -model.in2=[[-3],[-3]]; -model.intyp=[1,1]; -model.out=-1; -model.out2=-2; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_div"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = [[-1],[-2]]; + model.in2 = [[-3],[-3]]; + model.intyp = [1,1]; + model.out = -1; + model.out2 = -2; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATDIV.prototype.details = function MATDIV() { } MATDIV.prototype.get = function MATDIV() { } MATDIV.prototype.set = function MATDIV() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set MATDIV Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set MATDIV Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_div"; -ot=1; -it=[1,1]; -} else if ((typ==2)) { -function_name="matz_div"; -ot=2; -it=[2,2]; -} else { + if ((typ==1)) { + function_name = "mat_div"; + ot = 1; + it = [1,1]; + } else if ((typ==2)) { + function_name = "matz_div"; + ot = 2; + it = [2,2]; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATEIG.js b/js/MatrixOp/MATEIG.js index bacd2d88..e4925787 100644 --- a/js/MatrixOp/MATEIG.js +++ b/js/MatrixOp/MATEIG.js @@ -1,90 +1,90 @@ /* autogenerated from "macros/MatrixOp/MATEIG.sci" */ function MATEIG() { MATEIG.prototype.define = function MATEIG() { -model=scicos_model(); -function_name="mat_vps"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-1; -model.intyp=1; -model.out=-1; -model.out2=1; -model.outtyp=2; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(1)]]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_vps"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -1; + model.intyp = 1; + model.out = -1; + model.out2 = 1; + model.outtyp = 2; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(1)]]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATEIG.prototype.details = function MATEIG() { } MATEIG.prototype.get = function MATEIG() { } MATEIG.prototype.set = function MATEIG() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,decomptyp,lab]=scicos_getvalue("Set MATEIG block parameters",[["Datatype(1=real double 2=Complex)"],["decomposition type (1=eig values 2=eig values+eig vectors"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,typ,decomptyp,lab] = scicos_getvalue("Set MATEIG block parameters",[["Datatype(1=real double 2=Complex)"],["decomposition type (1=eig values 2=eig values+eig vectors"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -label=lab; -if ((typ==1)) { -if ((decomptyp==1)) { -function_name="mat_vps"; -out=[-1,1]; -ot=2; -} else if ((decomptyp==2)) { -function_name="mat_vpv"; -out=[[-1,-1],[-1,-1]]; -ot=[2,2]; -} else { + label = lab; + if ((typ==1)) { + if ((decomptyp==1)) { + function_name = "mat_vps"; + out = [-1,1]; + ot = 2; + } else if ((decomptyp==2)) { + function_name = "mat_vpv"; + out = [[-1,-1],[-1,-1]]; + ot = [2,2]; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=1; -} else if ((typ==2)) { -if ((decomptyp==1)) { -function_name="matz_vps"; -out=[-1,1]; -ot=2; -} else if ((decomptyp==2)) { -function_name="matz_vpv"; -out=[[-1,-1],[-1,-1]]; -ot=[2,2]; -} else { + it = 1; + } else if ((typ==2)) { + if ((decomptyp==1)) { + function_name = "matz_vps"; + out = [-1,1]; + ot = 2; + } else if ((decomptyp==2)) { + function_name = "matz_vpv"; + out = [[-1,-1],[-1,-1]]; + ot = [2,2]; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=2; -} else { + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[-1,-1]; -funtyp=4; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + in1 = [-1,-1]; + funtyp = 4; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); } -if (ok) { -model.sim=list(function_name,funtyp); -arg1.model=model; -graphics.exprs=label; -arg1.graphics=graphics; -x=arg1; + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + x = arg1; break; } } diff --git a/js/MatrixOp/MATEXPM.js b/js/MatrixOp/MATEXPM.js index 33d61bdb..d92b3b1f 100644 --- a/js/MatrixOp/MATEXPM.js +++ b/js/MatrixOp/MATEXPM.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/MATEXPM.sci" */ function MATEXPM() { MATEXPM.prototype.define = function MATEXPM() { -model=scicos_model(); -function_name="mat_expm"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-1; -model.intyp=1; -model.out=-1; -model.out2=-1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_expm"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -1; + model.intyp = 1; + model.out = -1; + model.out2 = -1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATEXPM.prototype.details = function MATEXPM() { } MATEXPM.prototype.get = function MATEXPM() { } MATEXPM.prototype.set = function MATEXPM() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set EXPM Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set EXPM Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_expm"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="matz_expm"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "mat_expm"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "matz_expm"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATINV.js b/js/MatrixOp/MATINV.js index f7d3d3a0..dbccd957 100644 --- a/js/MatrixOp/MATINV.js +++ b/js/MatrixOp/MATINV.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/MATINV.sci" */ function MATINV() { MATINV.prototype.define = function MATINV() { -model=scicos_model(); -function_name="mat_inv"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-1; -model.intyp=1; -model.out=-1; -model.out2=-1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_inv"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -1; + model.intyp = 1; + model.out = -1; + model.out2 = -1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATINV.prototype.details = function MATINV() { } MATINV.prototype.get = function MATINV() { } MATINV.prototype.set = function MATINV() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set MATINV Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set MATINV Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_inv"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="matz_inv"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "mat_inv"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "matz_inv"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATLU.js b/js/MatrixOp/MATLU.js index 2dd23741..bcf94fae 100644 --- a/js/MatrixOp/MATLU.js +++ b/js/MatrixOp/MATLU.js @@ -1,67 +1,67 @@ /* autogenerated from "macros/MatrixOp/MATLU.sci" */ function MATLU() { MATLU.prototype.define = function MATLU() { -model=scicos_model(); -function_name="mat_lu"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-1; -model.intyp=1; -model.out=[[-1],[-1]]; -model.out2=[[-1],[-1]]; -model.outtyp=[1,1]; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=sci2exp(1); -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_lu"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -1; + model.intyp = 1; + model.out = [[-1],[-1]]; + model.out2 = [[-1],[-1]]; + model.outtyp = [1,1]; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = sci2exp(1); + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATLU.prototype.details = function MATLU() { } MATLU.prototype.get = function MATLU() { } MATLU.prototype.set = function MATLU() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,lab]=scicos_getvalue("Set MATLU block parameters",["Datatype(1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,lab] = scicos_getvalue("Set MATLU block parameters",["Datatype(1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_lu"; -ot=[1,1]; -it=1; -} else if ((typ==2)) { -function_name="matz_lu"; -ot=[2,2]; -it=2; -} else { + if ((typ==1)) { + function_name = "mat_lu"; + ot = [1,1]; + it = 1; + } else if ((typ==2)) { + function_name = "matz_lu"; + ot = [2,2]; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list([model.in1,model.in2],it),list([model.out,model.out2],ot),[],[]); + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list([model.in1,model.in2],it),list([model.out,model.out2],ot),[],[]); } -if (ok) { -funtyp=4; -model.sim=list(function_name,funtyp); -graphics.exprs=lab; -x.graphics=graphics; -x.model=model; + if (ok) { + funtyp = 4; + model.sim = list(function_name,funtyp); + graphics.exprs = lab; + x.graphics = graphics; + x.model = model; break; } } diff --git a/js/MatrixOp/MATMAGPHI.js b/js/MatrixOp/MATMAGPHI.js index 9abf841a..e33aded1 100644 --- a/js/MatrixOp/MATMAGPHI.js +++ b/js/MatrixOp/MATMAGPHI.js @@ -1,73 +1,73 @@ /* autogenerated from "macros/MatrixOp/MATMAGPHI.sci" */ function MATMAGPHI() { MATMAGPHI.prototype.define = function MATMAGPHI() { -model=scicos_model(); -function_name="matz_abs"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=2; -model.out=[[-1],[-1]]; -model.out2=[[-2],[-2]]; -model.outtyp=[1,1]; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "matz_abs"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 2; + model.out = [[-1],[-1]]; + model.out2 = [[-2],[-2]]; + model.outtyp = [1,1]; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } MATMAGPHI.prototype.details = function MATMAGPHI() { } MATMAGPHI.prototype.get = function MATMAGPHI() { } MATMAGPHI.prototype.set = function MATMAGPHI() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,decomptyp,lab]=scicos_getvalue("Set MATMAGPHI block parameters",["decomposition type (1=Complex2MAG&PHI 2=MAG&PHI2Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,decomptyp,lab] = scicos_getvalue("Set MATMAGPHI block parameters",["decomposition type (1=Complex2MAG&PHI 2=MAG&PHI2Complex)"],list("vec",1),label); + if (!ok) { break; } -label=lab; -if ((decomptyp==1)) { -function_name="matz_abs"; -in1=[-1,-2]; -it=2; -out=[[-1,-2],[-1,-2]]; -ot=[1,1]; -} else if ((decomptyp==2)) { -function_name="matz_absc"; -in1=[[-1,-2],[-1,-2]]; -it=[1,1]; -out=[-1,-2]; -ot=2; -} else { + label = lab; + if ((decomptyp==1)) { + function_name = "matz_abs"; + in1 = [-1,-2]; + it = 2; + out = [[-1,-2],[-1,-2]]; + ot = [1,1]; + } else if ((decomptyp==2)) { + function_name = "matz_absc"; + in1 = [[-1,-2],[-1,-2]]; + it = [1,1]; + out = [-1,-2]; + ot = 2; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -funtyp=4; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + funtyp = 4; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); } -if (ok) { -model.sim=list(function_name,funtyp); -arg1.model=model; -graphics.exprs=label; -arg1.graphics=graphics; -x=arg1; + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + x = arg1; break; } } diff --git a/js/MatrixOp/MATMUL.js b/js/MatrixOp/MATMUL.js index 2d525127..26740490 100644 --- a/js/MatrixOp/MATMUL.js +++ b/js/MatrixOp/MATMUL.js @@ -1,149 +1,149 @@ /* autogenerated from "macros/MatrixOp/MATMUL.sci" */ 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.out=-1; -model.out2=-3; -model.dep_ut=[true,false]; -model.ipar=1; -label=[sci2exp(model.ipar)]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + model.sim = list("matmul_m",4); + model.in1 = [[-1],[-2]]; + model.in2 = [[-2],[-3]]; + model.out = -1; + model.out2 = -3; + model.dep_ut = [true,false]; + model.ipar = 1; + label = [sci2exp(model.ipar)]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } MATMUL.prototype.details = function MATMUL() { } MATMUL.prototype.get = function MATMUL() { } MATMUL.prototype.set = function MATMUL() { -x=arg1; -graphics=x.graphics; -label=graphics.exprs; -model=x.model; -if (model.ipar==[]) { -model.ipar=1; -} -if (size(label,"*")==1) { -label[2-1]=sci2exp(1); -} -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); -if (!ok) { + x = arg1; + graphics = x.graphics; + label = graphics.exprs; + model = x.model; + if (model.ipar==[]) { + model.ipar = 1; +} + if (size(label,"*")==1) { + label[2-1] = sci2exp(1); +} + 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); + if (!ok) { break; } -rule=int(rule); -if ((dtype<1||dtype>8)) { + rule = int(rule); + if ((dtype<1||dtype>8)) { message("type is not supported"); -ok=false; + ok = false; } -if ((rule<1||rule>3)) { + if ((rule<1||rule>3)) { message("Multiplication rule must be only 1,2 or 3"); -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]]; -if (rule==2) { -if (np==0) { -model.sim=list("matmul2_m",4); -} else if (np==1) { -model.sim=list("matmul2_s",4); -} else { -model.sim=list("matmul2_e",4); -} -} else if (rule==3) { -if (np==0) { -model.sim=list("matbyscal",4); -} else if (np==1) { -model.sim=list("matbyscal_s",4); -} else { -model.sim=list("matbyscal_e",4); -} -} else { -if ((dtype==1)) { -model.sim=list("matmul_m",4); -} else if ((dtype==2)) { -model.sim=list("matzmul_m",4); -} else if (dtype==3) { -if (np==0) { -model.sim=list("matmul_i32n",4); -} else if (np==1) { -model.sim=list("matmul_i32s",4); -} else { -model.sim=list("matmul_i32e",4); -} -} else if (dtype==4) { -if (np==0) { -model.sim=list("matmul_i16n",4); -} else if (np==1) { -model.sim=list("matmul_i16s",4); -} else { -model.sim=list("matmul_i16e",4); -} -} else if (dtype==5) { -if (np==0) { -model.sim=list("matmul_i8n",4); -} else if (np==1) { -model.sim=list("matmul_i8s",4); -} else { -model.sim=list("matmul_i8e",4); -} -} else if (dtype==6) { -if (np==0) { -model.sim=list("matmul_ui32n",4); -} else if (np==1) { -model.sim=list("matmul_ui32s",4); -} else { -model.sim=list("matmul_ui32e",4); -} -} else if (dtype==7) { -if (np==0) { -model.sim=list("matmul_ui16n",4); -} else if (np==1) { -model.sim=list("matmul_ui16s",4); -} else { -model.sim=list("matmul_ui16e",4); -} -} else if (dtype==8) { -if (np==0) { -model.sim=list("matmul_ui8n",4); -} else if (np==1) { -model.sim=list("matmul_ui8s",4); -} else { -model.sim=list("matmul_ui8e",4); -} -} -} -kmin=TABMIN[dtype-1]; -kmax=TABMAX[dtype-1]; -it=dtype*ones(1,2); -ot=dtype; -if (rule==1) { -in1=[[-1,-2],[-2,-3]]; -out=[-1,-3]; -} else if (rule==2) { -in1=[[-1,-2],[-1,-2]]; -out=[-1,-2]; -} else { -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]]; -graphics.exprs=label; -x.graphics=graphics; -x.model=model; -arg1=x; + 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]]; + if (rule==2) { + if (np==0) { + model.sim = list("matmul2_m",4); + } else if (np==1) { + model.sim = list("matmul2_s",4); + } else { + model.sim = list("matmul2_e",4); +} + } else if (rule==3) { + if (np==0) { + model.sim = list("matbyscal",4); + } else if (np==1) { + model.sim = list("matbyscal_s",4); + } else { + model.sim = list("matbyscal_e",4); +} + } else { + if ((dtype==1)) { + model.sim = list("matmul_m",4); + } else if ((dtype==2)) { + model.sim = list("matzmul_m",4); + } else if (dtype==3) { + if (np==0) { + model.sim = list("matmul_i32n",4); + } else if (np==1) { + model.sim = list("matmul_i32s",4); + } else { + model.sim = list("matmul_i32e",4); +} + } else if (dtype==4) { + if (np==0) { + model.sim = list("matmul_i16n",4); + } else if (np==1) { + model.sim = list("matmul_i16s",4); + } else { + model.sim = list("matmul_i16e",4); +} + } else if (dtype==5) { + if (np==0) { + model.sim = list("matmul_i8n",4); + } else if (np==1) { + model.sim = list("matmul_i8s",4); + } else { + model.sim = list("matmul_i8e",4); +} + } else if (dtype==6) { + if (np==0) { + model.sim = list("matmul_ui32n",4); + } else if (np==1) { + model.sim = list("matmul_ui32s",4); + } else { + model.sim = list("matmul_ui32e",4); +} + } else if (dtype==7) { + if (np==0) { + model.sim = list("matmul_ui16n",4); + } else if (np==1) { + model.sim = list("matmul_ui16s",4); + } else { + model.sim = list("matmul_ui16e",4); +} + } else if (dtype==8) { + if (np==0) { + model.sim = list("matmul_ui8n",4); + } else if (np==1) { + model.sim = list("matmul_ui8s",4); + } else { + model.sim = list("matmul_ui8e",4); +} +} +} + kmin = TABMIN[dtype-1]; + kmax = TABMAX[dtype-1]; + it = dtype*ones(1,2); + ot = dtype; + if (rule==1) { + in1 = [[-1,-2],[-2,-3]]; + out = [-1,-3]; + } else if (rule==2) { + in1 = [[-1,-2],[-1,-2]]; + out = [-1,-2]; + } else { + 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]]; + graphics.exprs = label; + x.graphics = graphics; + x.model = model; + arg1 = x; break; } } diff --git a/js/MatrixOp/MATPINV.js b/js/MatrixOp/MATPINV.js index ca39b50c..9344c72f 100644 --- a/js/MatrixOp/MATPINV.js +++ b/js/MatrixOp/MATPINV.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/MATPINV.sci" */ function MATPINV() { MATPINV.prototype.define = function MATPINV() { -model=scicos_model(); -function_name="mat_pinv"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=-2; -model.out2=-1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_pinv"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = -2; + model.out2 = -1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATPINV.prototype.details = function MATPINV() { } MATPINV.prototype.get = function MATPINV() { } MATPINV.prototype.set = function MATPINV() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set MATPINV Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set MATPINV Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_pinv"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="matz_pinv"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "mat_pinv"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "matz_pinv"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATRESH.js b/js/MatrixOp/MATRESH.js index 7136c644..c8ee4ff7 100644 --- a/js/MatrixOp/MATRESH.js +++ b/js/MatrixOp/MATRESH.js @@ -1,93 +1,93 @@ /* autogenerated from "macros/MatrixOp/MATRESH.sci" */ function MATRESH() { MATRESH.prototype.define = function MATRESH() { -model=scicos_model(); -function_name="mat_reshape"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=-1; -model.out2=-2; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp([1,1])],[sci2exp([1,1])]]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_reshape"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = -1; + model.out2 = -2; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp([1,1])],[sci2exp([1,1])]]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } MATRESH.prototype.details = function MATRESH() { } MATRESH.prototype.get = function MATRESH() { } MATRESH.prototype.set = function MATRESH() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,l1,out,lab]=scicos_getvalue("Set MATRESH block parameters",[["Datatype(1=real double 2=Complex)","input size"],["output size desired"]],list("vec",-1,"vec",-1,"vec",-1),label); -if (!ok) { + while (true) { + [ok,typ,l1,out,lab] = scicos_getvalue("Set MATRESH block parameters",[["Datatype(1=real double 2=Complex)","input size"],["output size desired"]],list("vec",-1,"vec",-1,"vec",-1),label); + if (!ok) { break; } -nout=size(out); -nin=size(l1); -if (nout==0) { + nout = size(out); + nin = size(l1); + if (nout==0) { message("output must have at least one element"); -ok=false; + ok = false; } -if (nin==0) { + if (nin==0) { message("input must have at least one element"); -ok=false; + ok = false; } -if (ok) { -if (((out[1-1]>(l1[1-1]*l1[2-1])))) { + if (ok) { + if (((out[1-1]>(l1[1-1]*l1[2-1])))) { message("the first dimension of the output is too big"); -ok=false; + ok = false; } -if (((out[2-1]>(l1[1-1]*l1[2-1])))) { + if (((out[2-1]>(l1[1-1]*l1[2-1])))) { message("the second dimension of the output is too big"); -ok=false; + ok = false; } -if ((((out[2-1]*out[1-1])>(l1[1-1]*l1[2-1])))) { + if ((((out[2-1]*out[1-1])>(l1[1-1]*l1[2-1])))) { message("the dimensions of the output are too big"); -ok=false; + ok = false; } } -if ((typ==1)) { -function_name="mat_reshape"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="matz_reshape"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "mat_reshape"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "matz_reshape"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -if (ok) { -label=lab; -[model,graphics,ok]=set_io(model,graphics,list(l1,it),list(out,ot),[],[]); + if (ok) { + label = lab; + [model,graphics,ok] = set_io(model,graphics,list(l1,it),list(out,ot),[],[]); } -if (ok) { -funtyp=4; -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + if (ok) { + funtyp = 4; + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATSING.js b/js/MatrixOp/MATSING.js index fa88b00f..67c3170f 100644 --- a/js/MatrixOp/MATSING.js +++ b/js/MatrixOp/MATSING.js @@ -1,93 +1,93 @@ /* autogenerated from "macros/MatrixOp/MATSING.sci" */ function MATSING() { MATSING.prototype.define = function MATSING() { -model=scicos_model(); -function_name="mat_sing"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=-1; -model.out2=1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(1)]]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_sing"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = -1; + model.out2 = 1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(1)]]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATSING.prototype.details = function MATSING() { } MATSING.prototype.get = function MATSING() { } MATSING.prototype.set = function MATSING() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,decomptyp,lab]=scicos_getvalue("Set MATSVD block parameters",[["Datatype(1=real double 2=Complex)"],["decomposition type (1=singular values 2=sing values+matrix U & V)"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,typ,decomptyp,lab] = scicos_getvalue("Set MATSVD block parameters",[["Datatype(1=real double 2=Complex)"],["decomposition type (1=singular values 2=sing values+matrix U & V)"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -label=lab; -if ((typ==1)) { -if ((decomptyp==1)) { -function_name="mat_sing"; -in1=[-1,-2]; -out=[-1,1]; -ot=1; -} else if ((decomptyp==2)) { -function_name="mat_svd"; -in1=[-1,-2]; -out=[[-1,-1],[-1,-2],[-2,-2]]; -ot=[1,1,1]; -} else { + label = lab; + if ((typ==1)) { + if ((decomptyp==1)) { + function_name = "mat_sing"; + in1 = [-1,-2]; + out = [-1,1]; + ot = 1; + } else if ((decomptyp==2)) { + function_name = "mat_svd"; + in1 = [-1,-2]; + out = [[-1,-1],[-1,-2],[-2,-2]]; + ot = [1,1,1]; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=1; -} else if ((typ==2)) { -if ((decomptyp==1)) { -function_name="matz_sing"; -in1=[-1,-2]; -out=[-1,1]; -ot=1; -} else if ((decomptyp==2)) { -function_name="matz_svd"; -in1=[-1,-2]; -out=[[-1,-1],[-1,-2],[-2,-2]]; -ot=[2,1,2]; -} else { + it = 1; + } else if ((typ==2)) { + if ((decomptyp==1)) { + function_name = "matz_sing"; + in1 = [-1,-2]; + out = [-1,1]; + ot = 1; + } else if ((decomptyp==2)) { + function_name = "matz_svd"; + in1 = [-1,-2]; + out = [[-1,-1],[-1,-2],[-2,-2]]; + ot = [2,1,2]; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=2; -} else { + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -funtyp=4; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + funtyp = 4; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); } -if (ok) { -model.sim=list(function_name,funtyp); -arg1.model=model; -graphics.exprs=label; -arg1.graphics=graphics; -x=arg1; + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + x = arg1; break; } } diff --git a/js/MatrixOp/MATSUM.js b/js/MatrixOp/MATSUM.js index d00d796e..35256aa1 100644 --- a/js/MatrixOp/MATSUM.js +++ b/js/MatrixOp/MATSUM.js @@ -1,94 +1,94 @@ /* autogenerated from "macros/MatrixOp/MATSUM.sci" */ function MATSUM() { MATSUM.prototype.define = function MATSUM() { -model=scicos_model(); -function_name="mat_sum"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=1; -model.out2=1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(0)]]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "mat_sum"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = 1; + model.out2 = 1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(0)]]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } MATSUM.prototype.details = function MATSUM() { } MATSUM.prototype.get = function MATSUM() { } MATSUM.prototype.set = function MATSUM() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,decomptyp,lab]=scicos_getvalue("Set MATSUM block parameters",[["Datatype(1=real double 2=Complex)"],["Sum along (0=all 1=lines 2=Columns)"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,typ,decomptyp,lab] = scicos_getvalue("Set MATSUM block parameters",[["Datatype(1=real double 2=Complex)"],["Sum along (0=all 1=lines 2=Columns)"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -label=lab; -if ((typ==1)) { -if ((decomptyp==0)) { -function_name="mat_sum"; -out=[1,1]; -} else if ((decomptyp==2)) { -function_name="mat_suml"; -out=[-1,1]; -} else if ((decomptyp==1)) { -function_name="mat_sumc"; -out=[1,-2]; -} else { + label = lab; + if ((typ==1)) { + if ((decomptyp==0)) { + function_name = "mat_sum"; + out = [1,1]; + } else if ((decomptyp==2)) { + function_name = "mat_suml"; + out = [-1,1]; + } else if ((decomptyp==1)) { + function_name = "mat_sumc"; + out = [1,-2]; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=1; -ot=1; -} else if ((typ==2)) { -if ((decomptyp==0)) { -function_name="matz_sum"; -out=[1,1]; -} else if ((decomptyp==2)) { -function_name="matz_suml"; -out=[-1,1]; -} else if ((decomptyp==1)) { -function_name="matz_sumc"; -out=[1,-2]; -} else { + it = 1; + ot = 1; + } else if ((typ==2)) { + if ((decomptyp==0)) { + function_name = "matz_sum"; + out = [1,1]; + } else if ((decomptyp==2)) { + function_name = "matz_suml"; + out = [-1,1]; + } else if ((decomptyp==1)) { + function_name = "matz_sumc"; + out = [1,-2]; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -it=2; -ot=2; -} else { + it = 2; + ot = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -funtyp=4; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + in1 = [model.in1,model.in2]; + funtyp = 4; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); } -if (ok) { -model.sim=list(function_name,funtyp); -arg1.model=model; -graphics.exprs=label; -arg1.graphics=graphics; -x=arg1; + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + x = arg1; break; } } diff --git a/js/MatrixOp/MATTRAN.js b/js/MatrixOp/MATTRAN.js index e8bb7ca1..b55aa3c3 100644 --- a/js/MatrixOp/MATTRAN.js +++ b/js/MatrixOp/MATTRAN.js @@ -1,61 +1,61 @@ /* autogenerated from "macros/MatrixOp/MATTRAN.sci" */ function MATTRAN() { MATTRAN.prototype.define = function MATTRAN() { -model=scicos_model(); -model.sim=list("mattran_m",4); -model.in1=-1; -model.in2=-2; -model.out=-2; -model.out2=-1; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + model.sim = list("mattran_m",4); + model.in1 = -1; + model.in2 = -2; + model.out = -2; + model.out2 = -1; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } MATTRAN.prototype.details = function MATTRAN() { } MATTRAN.prototype.get = function MATTRAN() { } MATTRAN.prototype.set = function MATTRAN() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==1) { -label[2-1]=sci2exp(1); + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==1) { + label[2-1] = sci2exp(1); } -while (true) { -[ok,typ,rule,exprs]=scicos_getvalue("Set MATTRAN Block",[["Datatype(1=real double 2=Complex)"],["rule (1=.\' 2=\')"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,typ,rule,exprs] = scicos_getvalue("Set MATTRAN Block",[["Datatype(1=real double 2=Complex)"],["rule (1=.\' 2=\')"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mattran_m"; -ot=1; -it=1; -} else if ((typ==2)) { -if (rule==1) { -function_name="matztran_m"; -} else { -function_name="mathermit_m"; + if ((typ==1)) { + function_name = "mattran_m"; + ot = 1; + it = 1; + } else if ((typ==2)) { + if (rule==1) { + function_name = "matztran_m"; + } else { + function_name = "mathermit_m"; } -ot=2; -it=2; -} else { + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/MATZCONJ.js b/js/MatrixOp/MATZCONJ.js index fba7853b..79a24c55 100644 --- a/js/MatrixOp/MATZCONJ.js +++ b/js/MatrixOp/MATZCONJ.js @@ -1,34 +1,34 @@ /* autogenerated from "macros/MatrixOp/MATZCONJ.sci" */ function MATZCONJ() { MATZCONJ.prototype.define = function MATZCONJ() { -model=scicos_model(); -function_name="matz_conj"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=2; -model.out=-1; -model.out2=-2; -model.outtyp=2; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "matz_conj"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 2; + model.out = -1; + model.out2 = -2; + model.outtyp = 2; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = []; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } MATZCONJ.prototype.details = function MATZCONJ() { } MATZCONJ.prototype.get = function MATZCONJ() { } MATZCONJ.prototype.set = function MATZCONJ() { -x=arg1; + x = arg1; } } diff --git a/js/MatrixOp/MATZREIM.js b/js/MatrixOp/MATZREIM.js index e08b333e..b02e8e59 100644 --- a/js/MatrixOp/MATZREIM.js +++ b/js/MatrixOp/MATZREIM.js @@ -1,73 +1,73 @@ /* autogenerated from "macros/MatrixOp/MATZREIM.sci" */ function MATZREIM() { MATZREIM.prototype.define = function MATZREIM() { -model=scicos_model(); -function_name="matz_reim"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=2; -model.out=[[-1],[-1]]; -model.out2=[[-2],[-2]]; -model.outtyp=[1,1]; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=sci2exp(1); -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "matz_reim"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 2; + model.out = [[-1],[-1]]; + model.out2 = [[-2],[-2]]; + model.outtyp = [1,1]; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = sci2exp(1); + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } MATZREIM.prototype.details = function MATZREIM() { } MATZREIM.prototype.get = function MATZREIM() { } MATZREIM.prototype.set = function MATZREIM() { -x=arg1; -model=arg1.model; -graphics=arg1.graphics; -label=graphics.exprs; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + model = arg1.model; + graphics = arg1.graphics; + label = graphics.exprs; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,decomptyp,lab]=scicos_getvalue("Set MATZREIM block parameters",["decomposition type (1=Complex2Real&Imag 2=Real&Imag2Complex)"],list("vec",1),label); -if (!ok) { + while (true) { + [ok,decomptyp,lab] = scicos_getvalue("Set MATZREIM block parameters",["decomposition type (1=Complex2Real&Imag 2=Real&Imag2Complex)"],list("vec",1),label); + if (!ok) { break; } -label=lab; -if ((decomptyp==1)) { -function_name="matz_reim"; -in1=[-1,-2]; -it=2; -out=[[-1,-2],[-1,-2]]; -ot=[1,1]; -} else if ((decomptyp==2)) { -function_name="matz_reimc"; -in1=[[-1,-2],[-1,-2]]; -it=[1,1]; -out=[-1,-2]; -ot=2; -} else { + label = lab; + if ((decomptyp==1)) { + function_name = "matz_reim"; + in1 = [-1,-2]; + it = 2; + out = [[-1,-2],[-1,-2]]; + ot = [1,1]; + } else if ((decomptyp==2)) { + function_name = "matz_reimc"; + in1 = [[-1,-2],[-1,-2]]; + it = [1,1]; + out = [-1,-2]; + ot = 2; + } else { message("decomposition type is not supported"); -ok=false; + ok = false; } -funtyp=4; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + funtyp = 4; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); } -if (ok) { -model.sim=list(function_name,funtyp); -arg1.model=model; -graphics.exprs=label; -arg1.graphics=graphics; -x=arg1; + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + x = arg1; break; } } diff --git a/js/MatrixOp/RICC.js b/js/MatrixOp/RICC.js index 6dc0cd04..048958fa 100644 --- a/js/MatrixOp/RICC.js +++ b/js/MatrixOp/RICC.js @@ -1,58 +1,58 @@ /* autogenerated from "macros/MatrixOp/RICC.sci" */ function RICC() { RICC.prototype.define = function RICC() { -model=scicos_model(); -function_name="ricc_m"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=[[-1],[-1],[-1]]; -model.in2=[[-1],[-1],[-1]]; -model.intyp=[1,1,1]; -model.out=-1; -model.out2=-1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[[1],[1]]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(1)]]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + function_name = "ricc_m"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = [[-1],[-1],[-1]]; + model.in2 = [[-1],[-1],[-1]]; + model.intyp = [1,1,1]; + model.out = -1; + model.out2 = -1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = [[1],[1]]; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(1)]]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } RICC.prototype.details = function RICC() { } RICC.prototype.get = function RICC() { } RICC.prototype.set = function RICC() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,tpe,mod,exprs]=scicos_getvalue("Set RICC Block",[["Type (1=Cont 2=Disc)"],["Model(1=Schr 2=sign(cont) inv(disc))"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,tpe,mod,exprs] = scicos_getvalue("Set RICC Block",[["Type (1=Cont 2=Disc)"],["Model(1=Schr 2=sign(cont) inv(disc))"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -it=[1,1,1]; -ot=1; -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -if (ok) { -model.ipar=[[tpe],[mod]]; -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + it = [1,1,1]; + ot = 1; + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + if (ok) { + model.ipar = [[tpe],[mod]]; + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/ROOTCOEF.js b/js/MatrixOp/ROOTCOEF.js index 35683a4b..95702c64 100644 --- a/js/MatrixOp/ROOTCOEF.js +++ b/js/MatrixOp/ROOTCOEF.js @@ -1,69 +1,69 @@ /* autogenerated from "macros/MatrixOp/ROOTCOEF.sci" */ function ROOTCOEF() { ROOTCOEF.prototype.define = function ROOTCOEF() { -model=scicos_model(); -function_name="root_coef"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=1; -model.intyp=1; -model.out=-2; -model.out2=1; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(1)]]; -gr_i=[]; -x=standard_define([3,2],model,label,gr_i); + model = scicos_model(); + function_name = "root_coef"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = 1; + model.intyp = 1; + model.out = -2; + model.out2 = 1; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = []; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(1)]]; + gr_i = []; + x = standard_define([3,2],model,label,gr_i); } ROOTCOEF.prototype.details = function ROOTCOEF() { } ROOTCOEF.prototype.get = function ROOTCOEF() { } ROOTCOEF.prototype.set = function ROOTCOEF() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==14) { -label[9-1]=[]; + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==14) { + label[9-1] = []; } -while (true) { -[ok,typ,inp,exprs]=scicos_getvalue("Set ROOTCOEF Block",[["Datatype(1=real double 2=Complex)"],["input row size"]],list("vec",1,"vec",1),label); -if (!ok) { + while (true) { + [ok,typ,inp,exprs] = scicos_getvalue("Set ROOTCOEF Block",[["Datatype(1=real double 2=Complex)"],["input row size"]],list("vec",1,"vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="root_coef"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="rootz_coef"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "root_coef"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "rootz_coef"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -in1=[inp,model.in2]; -out=[inp+1,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + in1 = [inp,model.in2]; + out = [inp+1,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/SQRT.js b/js/MatrixOp/SQRT.js index b1ed3a4b..b235782c 100644 --- a/js/MatrixOp/SQRT.js +++ b/js/MatrixOp/SQRT.js @@ -1,54 +1,54 @@ /* autogenerated from "macros/MatrixOp/SQRT.sci" */ function SQRT() { SQRT.prototype.define = function SQRT() { -model=scicos_model(); -model.sim=list("mat_sqrt",4); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.outtyp=1; -model.out=-1; -model.out2=-2; -model.dep_ut=[true,false]; -label=[sci2exp(1)]; -gr_i=[]; -x=standard_define([2,2],model,label,gr_i); + model = scicos_model(); + model.sim = list("mat_sqrt",4); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.outtyp = 1; + model.out = -1; + model.out2 = -2; + model.dep_ut = [true,false]; + label = [sci2exp(1)]; + gr_i = []; + x = standard_define([2,2],model,label,gr_i); } SQRT.prototype.details = function SQRT() { } SQRT.prototype.get = function SQRT() { } SQRT.prototype.set = function SQRT() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -while (true) { -[ok,typ,exprs]=scicos_getvalue("Set SQRT Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); -if (!ok) { + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + while (true) { + [ok,typ,exprs] = scicos_getvalue("Set SQRT Block",["Datatype(1=real double 2=Complex)"],list("vec",1),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="mat_sqrt"; -} else if ((typ==2)) { -function_name="matz_sqrt"; -} else { + if ((typ==1)) { + function_name = "mat_sqrt"; + } else if ((typ==2)) { + function_name = "matz_sqrt"; + } else { message("type is not supported"); -ok=false; + ok = false; } -it=typ; -ot=typ; -in1=[model.in1,model.in2]; -out=[model.out,model.out2]; -funtyp=4; -if (ok) { -label=exprs; -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + it = typ; + ot = typ; + in1 = [model.in1,model.in2]; + out = [model.out,model.out2]; + funtyp = 4; + if (ok) { + label = exprs; + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } diff --git a/js/MatrixOp/SUBMAT.js b/js/MatrixOp/SUBMAT.js index ff35a0fd..3f896eaf 100644 --- a/js/MatrixOp/SUBMAT.js +++ b/js/MatrixOp/SUBMAT.js @@ -1,90 +1,90 @@ /* autogenerated from "macros/MatrixOp/SUBMAT.sci" */ function SUBMAT() { SUBMAT.prototype.define = function SUBMAT() { -model=scicos_model(); -function_name="submat"; -funtyp=4; -model.sim=list(function_name,funtyp); -model.in1=-1; -model.in2=-2; -model.intyp=1; -model.out=-1; -model.out2=-2; -model.outtyp=1; -model.evtin=[]; -model.evtout=[]; -model.state=[]; -model.dstate=[]; -model.rpar=[]; -model.ipar=[[1],[1],[1],[1]]; -model.blocktype="c"; -model.firing=[]; -model.dep_ut=[true,false]; -label=[[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)]]; -gr_i=[]; -x=standard_define([2.5,2],model,label,gr_i); + model = scicos_model(); + function_name = "submat"; + funtyp = 4; + model.sim = list(function_name,funtyp); + model.in1 = -1; + model.in2 = -2; + model.intyp = 1; + model.out = -1; + model.out2 = -2; + model.outtyp = 1; + model.evtin = []; + model.evtout = []; + model.state = []; + model.dstate = []; + model.rpar = []; + model.ipar = [[1],[1],[1],[1]]; + model.blocktype = "c"; + model.firing = []; + model.dep_ut = [true,false]; + label = [[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)],[sci2exp(1)]]; + gr_i = []; + x = standard_define([2.5,2],model,label,gr_i); } SUBMAT.prototype.details = function SUBMAT() { } SUBMAT.prototype.get = function SUBMAT() { } SUBMAT.prototype.set = function SUBMAT() { -x=arg1; -graphics=arg1.graphics; -label=graphics.exprs; -model=arg1.model; -if (size(label,"*")==5) { -label[6-1]=sci2exp([1,1]); + x = arg1; + graphics = arg1.graphics; + label = graphics.exprs; + model = arg1.model; + if (size(label,"*")==5) { + label[6-1] = sci2exp([1,1]); } -while (true) { -[ok,typ,a,b,c,d,inp,exprs]=scicos_getvalue("Set SUBMAT Block",[["Datatype (1=real double 2=Complex)"],["Starting Row Index"],["Ending Row Index"],["Starting Column Index"],["Ending Column Index"],["Input Dimensions"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",2),label); -if (!ok) { + while (true) { + [ok,typ,a,b,c,d,inp,exprs] = scicos_getvalue("Set SUBMAT Block",[["Datatype (1=real double 2=Complex)"],["Starting Row Index"],["Ending Row Index"],["Starting Column Index"],["Ending Column Index"],["Input Dimensions"]],list("vec",1,"vec",1,"vec",1,"vec",1,"vec",1,"vec",2),label); + if (!ok) { break; } -if ((typ==1)) { -function_name="submat"; -ot=1; -it=1; -} else if ((typ==2)) { -function_name="submatz"; -ot=2; -it=2; -} else { + if ((typ==1)) { + function_name = "submat"; + ot = 1; + it = 1; + } else if ((typ==2)) { + function_name = "submatz"; + ot = 2; + it = 2; + } else { message("Datatype is not supported"); -ok=false; + ok = false; } -if ((a<=0)||(b<=0)||(c<=0)||(d<=0)) { + if ((a<=0)||(b<=0)||(c<=0)||(d<=0)) { message("invalid index"); -ok=false; + ok = false; } -if (binp[1-1]) { + if (b>inp[1-1]) { message("index of ending row is out of range"); -ok=false; + ok = false; } -if (d>inp[2-1]) { + if (d>inp[2-1]) { message("index of ending column is out of range"); -ok=false; + ok = false; } -model.ipar=[[a],[b],[c],[d]]; -in1=[inp[1-1],inp[2-1]]; -out=[(b-a)+1,(d-c)+1]; -funtyp=4; -label=exprs; -if (ok) { -[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]); -model.sim=list(function_name,funtyp); -graphics.exprs=label; -arg1.graphics=graphics; -arg1.model=model; -x=arg1; + model.ipar = [[a],[b],[c],[d]]; + in1 = [inp[1-1],inp[2-1]]; + out = [(b-a)+1,(d-c)+1]; + funtyp = 4; + label = exprs; + if (ok) { + [model,graphics,ok] = set_io(model,graphics,list(in1,it),list(out,ot),[],[]); + model.sim = list(function_name,funtyp); + graphics.exprs = label; + arg1.graphics = graphics; + arg1.model = model; + x = arg1; break; } } -- cgit