diff options
author | Sunil Shetye | 2018-07-11 13:05:13 +0530 |
---|---|---|
committer | Sunil Shetye | 2018-07-11 15:21:08 +0530 |
commit | 079d0b4a3ec15a4d7d2644484d116df9d1c694bb (patch) | |
tree | 785ed59b5b238203a9e91f3e323da59d1083d86e /js/MatrixOp/MATSUM.js | |
parent | 0e9bc36f45fa1bb598c6ebb0febc1989439a8d98 (diff) | |
download | sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.gz sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.tar.bz2 sci2js-079d0b4a3ec15a4d7d2644484d116df9d1c694bb.zip |
fix assignment to list
Diffstat (limited to 'js/MatrixOp/MATSUM.js')
-rw-r--r-- | js/MatrixOp/MATSUM.js | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/js/MatrixOp/MATSUM.js b/js/MatrixOp/MATSUM.js index d60e4191..f4348aa7 100644 --- a/js/MatrixOp/MATSUM.js +++ b/js/MatrixOp/MATSUM.js @@ -2,8 +2,8 @@ function MATSUM() { MATSUM.prototype.define = function MATSUM() { this.model = scicos_model(); - function_name = "mat_sum"; - funtyp = 4; + var function_name = "mat_sum"; + 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 MATSUM() { this.model.blocktype = new ScilabString(["c"]); this.model.firing = []; this.model.dep_ut = [true,false]; - label = [[sci2exp(1)],[sci2exp(0)]]; - gr_i = []; + var label = [[sci2exp(1)],[sci2exp(0)]]; + var gr_i = []; this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } @@ -41,8 +41,8 @@ function MATSUM() { 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,47 +51,50 @@ function MATSUM() { if (!ok) { break; } - label = this.lab; + var label = this.lab; if ((this.typ==1)) { if ((this.decomptyp==0)) { - function_name = "mat_sum"; - out = [1,1]; + var function_name = "mat_sum"; + var out = [1,1]; } else if ((this.decomptyp==2)) { - function_name = "mat_suml"; - out = [-1,1]; + var function_name = "mat_suml"; + var out = [-1,1]; } else if ((this.decomptyp==1)) { - function_name = "mat_sumc"; - out = [1,-2]; + var function_name = "mat_sumc"; + var out = [1,-2]; } else { message("decomposition type is not supported"); - ok = false; + var ok = false; } - it = 1; - ot = 1; + var it = 1; + var ot = 1; } else if ((this.typ==2)) { if ((this.decomptyp==0)) { - function_name = "matz_sum"; - out = [1,1]; + var function_name = "matz_sum"; + var out = [1,1]; } else if ((this.decomptyp==2)) { - function_name = "matz_suml"; - out = [-1,1]; + var function_name = "matz_suml"; + var out = [-1,1]; } else if ((this.decomptyp==1)) { - function_name = "matz_sumc"; - out = [1,-2]; + var function_name = "matz_sumc"; + var out = [1,-2]; } else { message("decomposition type is not supported"); - ok = false; + var ok = false; } - it = 2; - ot = 2; + var it = 2; + var ot = 2; } else { message("Datatype is not supported"); - ok = false; + var ok = false; } - in1 = [this.model.in1,this.model.in2]; - funtyp = 4; + var in1 = [this.model.in1,this.model.in2]; + 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])); |