diff options
Diffstat (limited to 'js/MatrixOp/MATSING.js')
-rw-r--r-- | js/MatrixOp/MATSING.js | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/js/MatrixOp/MATSING.js b/js/MatrixOp/MATSING.js index 7f0bd2ec..66956d3f 100644 --- a/js/MatrixOp/MATSING.js +++ b/js/MatrixOp/MATSING.js @@ -2,8 +2,8 @@ function MATSING() { MATSING.prototype.define = function MATSING() { this.model = scicos_model(); - function_name = "mat_sing"; - funtyp = 4; + var function_name = "mat_sing"; + var funtyp = 4; this.model.sim = list(new ScilabString([function_name]), new ScilabDouble([funtyp])); this.model.in1 = new ScilabDouble([-1]); this.model.in2 = new ScilabDouble([-2]); @@ -20,8 +20,8 @@ function MATSING() { this.model.blocktype = new ScilabString(["c"]); this.model.firing = []; this.model.dep_ut = [true,false]; - label = [[sci2exp(1)],[sci2exp(1)]]; - gr_i = []; + var label = [[sci2exp(1)],[sci2exp(1)]]; + var gr_i = []; this.x = standard_define([2,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -41,8 +41,8 @@ function MATSING() { this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; - graphics = arg1.graphics; - label = graphics.exprs; + var graphics = arg1.graphics; + var label = graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } @@ -51,46 +51,49 @@ function MATSING() { if (!ok) { break; } - label = this.lab; + var label = this.lab; if ((this.typ==1)) { if ((this.decomptyp==1)) { - function_name = "mat_sing"; - in1 = [-1,-2]; - out = [-1,1]; - ot = 1; + var function_name = "mat_sing"; + var in1 = [-1,-2]; + var out = [-1,1]; + var ot = 1; } else if ((this.decomptyp==2)) { - function_name = "mat_svd"; - in1 = [-1,-2]; - out = [[-1,-1],[-1,-2],[-2,-2]]; - ot = [1,1,1]; + var function_name = "mat_svd"; + var in1 = [-1,-2]; + var out = [[-1,-1],[-1,-2],[-2,-2]]; + var ot = [1,1,1]; } else { message("decomposition type is not supported"); - ok = false; + var ok = false; } - it = 1; + var it = 1; } else if ((this.typ==2)) { if ((this.decomptyp==1)) { - function_name = "matz_sing"; - in1 = [-1,-2]; - out = [-1,1]; - ot = 1; + var function_name = "matz_sing"; + var in1 = [-1,-2]; + var out = [-1,1]; + var ot = 1; } else if ((this.decomptyp==2)) { - function_name = "matz_svd"; - in1 = [-1,-2]; - out = [[-1,-1],[-1,-2],[-2,-2]]; - ot = [2,1,2]; + var function_name = "matz_svd"; + var in1 = [-1,-2]; + var out = [[-1,-1],[-1,-2],[-2,-2]]; + var ot = [2,1,2]; } else { message("decomposition type is not supported"); - ok = false; + var ok = false; } - it = 2; + var it = 2; } else { message("Datatype is not supported"); - ok = false; + var ok = false; } - funtyp = 4; + var funtyp = 4; if (ok) { - [this.model,graphics,ok] = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]); + var tmpvar0 = set_io(this.model,graphics,list(in1,it),list(out,ot),[],[]) + this.model = tmpvar0[0] + var graphics = tmpvar0[1] + var ok = tmpvar0[2]; } if (ok) { this.model.sim = list(new ScilabString([function_name]), new ScilabDouble([funtyp])); |