diff options
author | Sunil Shetye | 2018-06-25 18:20:39 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-06-26 11:06:22 +0530 |
commit | 7465daea85285ba7f291b6bf6ddc45caa9e7ad65 (patch) | |
tree | e8e3e4dd60d469c290d55de15644ddbc1e013bc6 /js/MatrixOp | |
parent | 7c70459c10aed0d74ee03896abaf47fefdbf7c8f (diff) | |
download | sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.gz sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.tar.bz2 sci2js-7465daea85285ba7f291b6bf6ddc45caa9e7ad65.zip |
add spacing to end of block also
Diffstat (limited to 'js/MatrixOp')
52 files changed, 1228 insertions, 1150 deletions
diff --git a/js/MatrixOp/CUMSUM.js b/js/MatrixOp/CUMSUM.js index 08cc8d5a..362ece2f 100644 --- a/js/MatrixOp/CUMSUM.js +++ b/js/MatrixOp/CUMSUM.js @@ -22,73 +22,74 @@ function CUMSUM() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(0)]]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } CUMSUM.prototype.details = function CUMSUM() { + return this.x; } CUMSUM.prototype.get = function CUMSUM() { } CUMSUM.prototype.set = function CUMSUM() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("decomposition type is not supported"); - 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 { -message("decomposition type is not supported"); - ok = false; -} - it = 2; - ot = 2; - } else { -message("Datatype is not supported"); - 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),[],[]); -} - if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; - graphics.exprs = label; - arg1.graphics = graphics; - x = arg1; -break; -} -} + [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 { + message("decomposition type is not supported"); + 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 { + message("decomposition type is not supported"); + ok = false; + } + it = 2; + ot = 2; + } else { + message("Datatype is not supported"); + 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),[],[]); + } + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/CUMSUM.pickle b/js/MatrixOp/CUMSUM.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/CUMSUM.pickle +++ b/js/MatrixOp/CUMSUM.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/EXTRACT.js b/js/MatrixOp/EXTRACT.js index 0d5e5c18..4afd5810 100644 --- a/js/MatrixOp/EXTRACT.js +++ b/js/MatrixOp/EXTRACT.js @@ -22,71 +22,72 @@ function EXTRACT() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp([1])],[sci2exp([1])]]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } EXTRACT.prototype.details = function EXTRACT() { + return this.x; } EXTRACT.prototype.get = function EXTRACT() { } EXTRACT.prototype.set = function EXTRACT() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -break; -} - 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; -} - ma = size(a,1); - mb = size(b,1); - if ((ma==0||mb==0)) { -message("empty field"); - ok = false; -} -for (i=1;i<=ma;i+=1) { - if ((a[i-1]<=0)) { -message("invalid index"); - ok = false; -} -} -for (j=1;j<=mb;j+=1) { - if ((b[j-1]<=0)) { -message("invalid index"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + ok = false; + } + ma = size(a,1); + mb = size(b,1); + if ((ma==0||mb==0)) { + message("empty field"); + ok = false; + } + for (i=1;i<=ma;i+=1) { + if ((a[i-1]<=0)) { + message("invalid index"); + ok = false; + } + } + for (j=1;j<=mb;j+=1) { + if ((b[j-1]<=0)) { + message("invalid index"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/EXTRACT.pickle b/js/MatrixOp/EXTRACT.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/EXTRACT.pickle +++ b/js/MatrixOp/EXTRACT.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/EXTTRI.js b/js/MatrixOp/EXTTRI.js index 319de0cc..5ebaaf18 100644 --- a/js/MatrixOp/EXTTRI.js +++ b/js/MatrixOp/EXTTRI.js @@ -22,70 +22,71 @@ function EXTTRI() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } EXTTRI.prototype.details = function EXTTRI() { + return this.x; } EXTTRI.prototype.get = function EXTTRI() { } EXTTRI.prototype.set = function EXTTRI() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("decomposition type is not supported"); - 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 { -message("decomposition type is not supported"); - ok = false; -} - it = 2; - ot = 2; - } else { -message("Datatype is not supported"); - 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),[],[]); -} - if (ok) { - model.sim = list(function_name,funtyp); - arg1.model = model; - graphics.exprs = label; - arg1.graphics = graphics; - x = arg1; -break; -} -} + [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 { + message("decomposition type is not supported"); + 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 { + message("decomposition type is not supported"); + ok = false; + } + it = 2; + ot = 2; + } else { + message("Datatype is not supported"); + 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),[],[]); + } + if (ok) { + model.sim = list(function_name,funtyp); + arg1.model = model; + graphics.exprs = label; + arg1.graphics = graphics; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/EXTTRI.pickle b/js/MatrixOp/EXTTRI.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/EXTTRI.pickle +++ b/js/MatrixOp/EXTTRI.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATBKSL.js b/js/MatrixOp/MATBKSL.js index a87bef95..06235455 100644 --- a/js/MatrixOp/MATBKSL.js +++ b/js/MatrixOp/MATBKSL.js @@ -22,50 +22,51 @@ function MATBKSL() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATBKSL.prototype.details = function MATBKSL() { + return this.x; } MATBKSL.prototype.get = function MATBKSL() { } MATBKSL.prototype.set = function MATBKSL() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATBKSL.pickle b/js/MatrixOp/MATBKSL.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATBKSL.pickle +++ b/js/MatrixOp/MATBKSL.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATCATH.js b/js/MatrixOp/MATCATH.js index 29da12eb..f365bb52 100644 --- a/js/MatrixOp/MATCATH.js +++ b/js/MatrixOp/MATCATH.js @@ -22,40 +22,41 @@ function MATCATH() { model.dep_ut = [true,false]; label = [sci2exp(2)]; gr_i = []; - x = standard_define([2,3],model,label,gr_i); + this.x = standard_define([2,3],model,label,gr_i); } MATCATH.prototype.details = function MATCATH() { + return this.x; } MATCATH.prototype.get = function MATCATH() { } MATCATH.prototype.set = function MATCATH() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")>1) { - label = "size(evstr("+label[2-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) { -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; -break; -} -} + [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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATCATH.pickle b/js/MatrixOp/MATCATH.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATCATH.pickle +++ b/js/MatrixOp/MATCATH.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATCATV.js b/js/MatrixOp/MATCATV.js index 02682ea6..7e011ea2 100644 --- a/js/MatrixOp/MATCATV.js +++ b/js/MatrixOp/MATCATV.js @@ -23,40 +23,41 @@ function MATCATV() { model.dep_ut = [true,false]; label = [sci2exp(2)]; gr_i = []; - x = standard_define([2,3],model,label,gr_i); + this.x = standard_define([2,3],model,label,gr_i); } MATCATV.prototype.details = function MATCATV() { + return this.x; } MATCATV.prototype.get = function MATCATV() { } MATCATV.prototype.set = function MATCATV() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")>1) { - label = "size(evstr("+label[2-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) { -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; -break; -} -} + [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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATCATV.pickle b/js/MatrixOp/MATCATV.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATCATV.pickle +++ b/js/MatrixOp/MATCATV.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATDET.js b/js/MatrixOp/MATDET.js index 41f4a0a4..176268ce 100644 --- a/js/MatrixOp/MATDET.js +++ b/js/MatrixOp/MATDET.js @@ -22,50 +22,51 @@ function MATDET() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATDET.prototype.details = function MATDET() { + return this.x; } MATDET.prototype.get = function MATDET() { } MATDET.prototype.set = function MATDET() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATDET.pickle b/js/MatrixOp/MATDET.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATDET.pickle +++ b/js/MatrixOp/MATDET.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATDIAG.js b/js/MatrixOp/MATDIAG.js index 5c565daa..8f76bb54 100644 --- a/js/MatrixOp/MATDIAG.js +++ b/js/MatrixOp/MATDIAG.js @@ -22,50 +22,51 @@ function MATDIAG() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATDIAG.prototype.details = function MATDIAG() { + return this.x; } MATDIAG.prototype.get = function MATDIAG() { } MATDIAG.prototype.set = function MATDIAG() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATDIAG.pickle b/js/MatrixOp/MATDIAG.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATDIAG.pickle +++ b/js/MatrixOp/MATDIAG.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATDIV.js b/js/MatrixOp/MATDIV.js index 01922e06..64a39f47 100644 --- a/js/MatrixOp/MATDIV.js +++ b/js/MatrixOp/MATDIV.js @@ -22,50 +22,51 @@ function MATDIV() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATDIV.prototype.details = function MATDIV() { + return this.x; } MATDIV.prototype.get = function MATDIV() { } MATDIV.prototype.set = function MATDIV() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATDIV.pickle b/js/MatrixOp/MATDIV.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATDIV.pickle +++ b/js/MatrixOp/MATDIV.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATEIG.js b/js/MatrixOp/MATEIG.js index e4925787..5cda9f2a 100644 --- a/js/MatrixOp/MATEIG.js +++ b/js/MatrixOp/MATEIG.js @@ -22,71 +22,72 @@ function MATEIG() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATEIG.prototype.details = function MATEIG() { + return this.x; } MATEIG.prototype.get = function MATEIG() { } MATEIG.prototype.set = function MATEIG() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("decomposition type is not supported"); - 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 { -message("decomposition type is not supported"); - ok = false; -} - it = 2; - } else { -message("Datatype is not supported"); - ok = false; -} - 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; -break; -} -} + [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 { + message("decomposition type is not supported"); + 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 { + message("decomposition type is not supported"); + ok = false; + } + it = 2; + } else { + message("Datatype is not supported"); + ok = false; + } + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATEIG.pickle b/js/MatrixOp/MATEIG.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATEIG.pickle +++ b/js/MatrixOp/MATEIG.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATEXPM.js b/js/MatrixOp/MATEXPM.js index d92b3b1f..0c9e22ef 100644 --- a/js/MatrixOp/MATEXPM.js +++ b/js/MatrixOp/MATEXPM.js @@ -22,50 +22,51 @@ function MATEXPM() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATEXPM.prototype.details = function MATEXPM() { + return this.x; } MATEXPM.prototype.get = function MATEXPM() { } MATEXPM.prototype.set = function MATEXPM() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATEXPM.pickle b/js/MatrixOp/MATEXPM.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATEXPM.pickle +++ b/js/MatrixOp/MATEXPM.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATINV.js b/js/MatrixOp/MATINV.js index dbccd957..f260f75b 100644 --- a/js/MatrixOp/MATINV.js +++ b/js/MatrixOp/MATINV.js @@ -22,50 +22,51 @@ function MATINV() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATINV.prototype.details = function MATINV() { + return this.x; } MATINV.prototype.get = function MATINV() { } MATINV.prototype.set = function MATINV() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATINV.pickle b/js/MatrixOp/MATINV.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATINV.pickle +++ b/js/MatrixOp/MATINV.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATLU.js b/js/MatrixOp/MATLU.js index bcf94fae..24f53803 100644 --- a/js/MatrixOp/MATLU.js +++ b/js/MatrixOp/MATLU.js @@ -22,48 +22,49 @@ function MATLU() { model.dep_ut = [true,false]; label = sci2exp(1); gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATLU.prototype.details = function MATLU() { + return this.x; } MATLU.prototype.get = function MATLU() { } MATLU.prototype.set = function MATLU() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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) { - funtyp = 4; - model.sim = list(function_name,funtyp); - graphics.exprs = lab; - x.graphics = graphics; - x.model = model; -break; -} -} + [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 { + message("Datatype is not supported"); + 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) { + funtyp = 4; + model.sim = list(function_name,funtyp); + graphics.exprs = lab; + this.x.graphics = graphics; + this.x.model = model; + break; + } + } } } diff --git a/js/MatrixOp/MATLU.pickle b/js/MatrixOp/MATLU.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATLU.pickle +++ b/js/MatrixOp/MATLU.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATMAGPHI.js b/js/MatrixOp/MATMAGPHI.js index e33aded1..4716d263 100644 --- a/js/MatrixOp/MATMAGPHI.js +++ b/js/MatrixOp/MATMAGPHI.js @@ -22,54 +22,55 @@ function MATMAGPHI() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } MATMAGPHI.prototype.details = function MATMAGPHI() { + return this.x; } MATMAGPHI.prototype.get = function MATMAGPHI() { } MATMAGPHI.prototype.set = function MATMAGPHI() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("decomposition type is not supported"); - ok = false; -} - 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; -break; -} -} + [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 { + message("decomposition type is not supported"); + ok = false; + } + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATMAGPHI.pickle b/js/MatrixOp/MATMAGPHI.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATMAGPHI.pickle +++ b/js/MatrixOp/MATMAGPHI.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATMUL.js b/js/MatrixOp/MATMUL.js index 26740490..0d8657b1 100644 --- a/js/MatrixOp/MATMUL.js +++ b/js/MatrixOp/MATMUL.js @@ -11,141 +11,142 @@ function MATMUL() { model.ipar = 1; label = [sci2exp(model.ipar)]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } MATMUL.prototype.details = function MATMUL() { + return this.x; } MATMUL.prototype.get = function MATMUL() { } MATMUL.prototype.set = function MATMUL() { - x = arg1; - graphics = x.graphics; + this.x = arg1; + graphics = this.x.graphics; label = graphics.exprs; - model = x.model; + model = this.x.model; if (model.ipar==[]) { - model.ipar = 1; -} + model.ipar = 1; + } if (size(label,"*")==1) { - label[2-1] = sci2exp(1); -} + label[2-1] = sci2exp(1); + } if (size(label,"*")==2) { - label[3-1] = sci2exp(1); -} + 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)) { -message("type is not supported"); - ok = false; -} - 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; -break; -} -} + [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)) { + message("type is not supported"); + ok = false; + } + 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; + this.x.graphics = graphics; + this.x.model = model; + arg1 = this.x; + break; + } + } } } diff --git a/js/MatrixOp/MATMUL.pickle b/js/MatrixOp/MATMUL.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATMUL.pickle +++ b/js/MatrixOp/MATMUL.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATPINV.js b/js/MatrixOp/MATPINV.js index 9344c72f..467ea072 100644 --- a/js/MatrixOp/MATPINV.js +++ b/js/MatrixOp/MATPINV.js @@ -22,50 +22,51 @@ function MATPINV() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATPINV.prototype.details = function MATPINV() { + return this.x; } MATPINV.prototype.get = function MATPINV() { } MATPINV.prototype.set = function MATPINV() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATPINV.pickle b/js/MatrixOp/MATPINV.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATPINV.pickle +++ b/js/MatrixOp/MATPINV.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATRESH.js b/js/MatrixOp/MATRESH.js index c8ee4ff7..a20293de 100644 --- a/js/MatrixOp/MATRESH.js +++ b/js/MatrixOp/MATRESH.js @@ -22,75 +22,76 @@ function MATRESH() { 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); + this.x = standard_define([3,2],model,label,gr_i); } MATRESH.prototype.details = function MATRESH() { + return this.x; } MATRESH.prototype.get = function MATRESH() { } MATRESH.prototype.set = function MATRESH() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -break; -} - nout = size(out); - nin = size(l1); - if (nout==0) { -message("output must have at least one element"); - ok = false; -} - if (nin==0) { -message("input must have at least one element"); - ok = false; -} - if (ok) { - if (((out[1-1]>(l1[1-1]*l1[2-1])))) { -message("the first dimension of the output is too big"); - ok = false; -} - if (((out[2-1]>(l1[1-1]*l1[2-1])))) { -message("the second dimension of the output is too big"); - ok = false; -} - if ((((out[2-1]*out[1-1])>(l1[1-1]*l1[2-1])))) { -message("the dimensions of the output are too big"); - 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 { -message("Datatype is not supported"); - ok = false; -} - 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; -break; -} -} -needcompile=resume(needcompile) + [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) { + message("output must have at least one element"); + ok = false; + } + if (nin==0) { + message("input must have at least one element"); + ok = false; + } + if (ok) { + if (((out[1-1]>(l1[1-1]*l1[2-1])))) { + message("the first dimension of the output is too big"); + ok = false; + } + if (((out[2-1]>(l1[1-1]*l1[2-1])))) { + message("the second dimension of the output is too big"); + ok = false; + } + if ((((out[2-1]*out[1-1])>(l1[1-1]*l1[2-1])))) { + message("the dimensions of the output are too big"); + 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 { + message("Datatype is not supported"); + ok = false; + } + 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; + this.x = arg1; + break; + } + } + needcompile=resume(needcompile) } } diff --git a/js/MatrixOp/MATRESH.pickle b/js/MatrixOp/MATRESH.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATRESH.pickle +++ b/js/MatrixOp/MATRESH.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATSING.js b/js/MatrixOp/MATSING.js index 67c3170f..cd5daad6 100644 --- a/js/MatrixOp/MATSING.js +++ b/js/MatrixOp/MATSING.js @@ -22,74 +22,75 @@ function MATSING() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATSING.prototype.details = function MATSING() { + return this.x; } MATSING.prototype.get = function MATSING() { } MATSING.prototype.set = function MATSING() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("decomposition type is not supported"); - 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 { -message("decomposition type is not supported"); - ok = false; -} - it = 2; - } else { -message("Datatype is not supported"); - ok = false; -} - 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; -break; -} -} + [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 { + message("decomposition type is not supported"); + 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 { + message("decomposition type is not supported"); + ok = false; + } + it = 2; + } else { + message("Datatype is not supported"); + ok = false; + } + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATSING.pickle b/js/MatrixOp/MATSING.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATSING.pickle +++ b/js/MatrixOp/MATSING.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATSUM.js b/js/MatrixOp/MATSUM.js index 35256aa1..894c5a97 100644 --- a/js/MatrixOp/MATSUM.js +++ b/js/MatrixOp/MATSUM.js @@ -22,75 +22,76 @@ function MATSUM() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(0)]]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } MATSUM.prototype.details = function MATSUM() { + return this.x; } MATSUM.prototype.get = function MATSUM() { } MATSUM.prototype.set = function MATSUM() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("decomposition type is not supported"); - 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 { -message("decomposition type is not supported"); - ok = false; -} - it = 2; - ot = 2; - } else { -message("Datatype is not supported"); - ok = false; -} - 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; -break; -} -} + [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 { + message("decomposition type is not supported"); + 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 { + message("decomposition type is not supported"); + ok = false; + } + it = 2; + ot = 2; + } else { + message("Datatype is not supported"); + ok = false; + } + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATSUM.pickle b/js/MatrixOp/MATSUM.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATSUM.pickle +++ b/js/MatrixOp/MATSUM.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATTRAN.js b/js/MatrixOp/MATTRAN.js index b55aa3c3..4cef2ada 100644 --- a/js/MatrixOp/MATTRAN.js +++ b/js/MatrixOp/MATTRAN.js @@ -10,54 +10,55 @@ function MATTRAN() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } MATTRAN.prototype.details = function MATTRAN() { + return this.x; } MATTRAN.prototype.get = function MATTRAN() { } MATTRAN.prototype.set = function MATTRAN() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==1) { - label[2-1] = sci2exp(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) { -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"; -} - ot = 2; - it = 2; - } else { -message("Datatype is not supported"); - 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; -break; -} -} + [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"; + } + ot = 2; + it = 2; + } else { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATTRAN.pickle b/js/MatrixOp/MATTRAN.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATTRAN.pickle +++ b/js/MatrixOp/MATTRAN.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATZCONJ.js b/js/MatrixOp/MATZCONJ.js index 79a24c55..382a025c 100644 --- a/js/MatrixOp/MATZCONJ.js +++ b/js/MatrixOp/MATZCONJ.js @@ -22,13 +22,14 @@ function MATZCONJ() { model.dep_ut = [true,false]; label = []; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } MATZCONJ.prototype.details = function MATZCONJ() { + return this.x; } MATZCONJ.prototype.get = function MATZCONJ() { } MATZCONJ.prototype.set = function MATZCONJ() { - x = arg1; + this.x = arg1; } } diff --git a/js/MatrixOp/MATZCONJ.pickle b/js/MatrixOp/MATZCONJ.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATZCONJ.pickle +++ b/js/MatrixOp/MATZCONJ.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/MATZREIM.js b/js/MatrixOp/MATZREIM.js index b02e8e59..f332d237 100644 --- a/js/MatrixOp/MATZREIM.js +++ b/js/MatrixOp/MATZREIM.js @@ -22,54 +22,55 @@ function MATZREIM() { model.dep_ut = [true,false]; label = sci2exp(1); gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } MATZREIM.prototype.details = function MATZREIM() { + return this.x; } MATZREIM.prototype.get = function MATZREIM() { } MATZREIM.prototype.set = function MATZREIM() { - x = arg1; + this.x = arg1; model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("decomposition type is not supported"); - ok = false; -} - 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; -break; -} -} + [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 { + message("decomposition type is not supported"); + ok = false; + } + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/MATZREIM.pickle b/js/MatrixOp/MATZREIM.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/MATZREIM.pickle +++ b/js/MatrixOp/MATZREIM.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/RICC.js b/js/MatrixOp/RICC.js index 048958fa..037c41eb 100644 --- a/js/MatrixOp/RICC.js +++ b/js/MatrixOp/RICC.js @@ -22,39 +22,40 @@ function RICC() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } RICC.prototype.details = function RICC() { + return this.x; } RICC.prototype.get = function RICC() { } RICC.prototype.set = function RICC() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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; -break; -} -} + [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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/RICC.pickle b/js/MatrixOp/RICC.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/RICC.pickle +++ b/js/MatrixOp/RICC.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/ROOTCOEF.js b/js/MatrixOp/ROOTCOEF.js index 95702c64..8e968567 100644 --- a/js/MatrixOp/ROOTCOEF.js +++ b/js/MatrixOp/ROOTCOEF.js @@ -22,50 +22,51 @@ function ROOTCOEF() { model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp(1)]]; gr_i = []; - x = standard_define([3,2],model,label,gr_i); + this.x = standard_define([3,2],model,label,gr_i); } ROOTCOEF.prototype.details = function ROOTCOEF() { + return this.x; } ROOTCOEF.prototype.get = function ROOTCOEF() { } ROOTCOEF.prototype.set = function ROOTCOEF() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==14) { - label[9-1] = []; -} + 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) { -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 { -message("Datatype is not supported"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/ROOTCOEF.pickle b/js/MatrixOp/ROOTCOEF.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/ROOTCOEF.pickle +++ b/js/MatrixOp/ROOTCOEF.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/SQRT.js b/js/MatrixOp/SQRT.js index b235782c..f686b27a 100644 --- a/js/MatrixOp/SQRT.js +++ b/js/MatrixOp/SQRT.js @@ -12,45 +12,46 @@ function SQRT() { model.dep_ut = [true,false]; label = [sci2exp(1)]; gr_i = []; - x = standard_define([2,2],model,label,gr_i); + this.x = standard_define([2,2],model,label,gr_i); } SQRT.prototype.details = function SQRT() { + return this.x; } SQRT.prototype.get = function SQRT() { } SQRT.prototype.set = function SQRT() { - x = arg1; + this.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 { -message("type is not supported"); - 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; -break; -} -} + [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 { + message("type is not supported"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/SQRT.pickle b/js/MatrixOp/SQRT.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/SQRT.pickle +++ b/js/MatrixOp/SQRT.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file diff --git a/js/MatrixOp/SUBMAT.js b/js/MatrixOp/SUBMAT.js index 3f896eaf..a797b764 100644 --- a/js/MatrixOp/SUBMAT.js +++ b/js/MatrixOp/SUBMAT.js @@ -22,71 +22,72 @@ function SUBMAT() { 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); + this.x = standard_define([2.5,2],model,label,gr_i); } SUBMAT.prototype.details = function SUBMAT() { + return this.x; } SUBMAT.prototype.get = function SUBMAT() { } SUBMAT.prototype.set = function SUBMAT() { - x = arg1; + this.x = arg1; graphics = arg1.graphics; label = graphics.exprs; model = arg1.model; if (size(label,"*")==5) { - label[6-1] = sci2exp([1,1]); -} + 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) { -break; -} - 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; -} - if ((a<=0)||(b<=0)||(c<=0)||(d<=0)) { -message("invalid index"); - ok = false; -} - if (b<a) { -message("ending row must be greater than starting row"); - ok = false; -} - if (d<c) { -message("ending column must be greater than starting column"); - ok = false; -} - if (b>inp[1-1]) { -message("index of ending row is out of range"); - ok = false; -} - if (d>inp[2-1]) { -message("index of ending column is out of range"); - 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; -break; -} -} + [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 { + message("Datatype is not supported"); + ok = false; + } + if ((a<=0)||(b<=0)||(c<=0)||(d<=0)) { + message("invalid index"); + ok = false; + } + if (b<a) { + message("ending row must be greater than starting row"); + ok = false; + } + if (d<c) { + message("ending column must be greater than starting column"); + ok = false; + } + if (b>inp[1-1]) { + message("index of ending row is out of range"); + ok = false; + } + if (d>inp[2-1]) { + message("index of ending column is out of range"); + 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; + this.x = arg1; + break; + } + } } } diff --git a/js/MatrixOp/SUBMAT.pickle b/js/MatrixOp/SUBMAT.pickle index 154645d8..0d1dde24 100644 --- a/js/MatrixOp/SUBMAT.pickle +++ b/js/MatrixOp/SUBMAT.pickle @@ -2,6 +2,8 @@ c__builtin__ set p0 ((lp1 -tp2 -Rp3 +S'x' +p2 +atp3 +Rp4 .
\ No newline at end of file |