diff options
author | Adhitya Kamakshidasan | 2016-07-04 14:09:29 +0530 |
---|---|---|
committer | GitHub | 2016-07-04 14:09:29 +0530 |
commit | d69220e13c669b7730d8401e0803929467a59908 (patch) | |
tree | 9ca3dd556093c03e6591aa0233e7ac6613d5da9a | |
parent | dbdf4e47616be30692dd22814574b92656c2ee4e (diff) | |
parent | d110fd7d6e1f4a4b588b8b7b352bfcd074aff79a (diff) | |
download | xcos-on-web-d69220e13c669b7730d8401e0803929467a59908.tar.gz xcos-on-web-d69220e13c669b7730d8401e0803929467a59908.tar.bz2 xcos-on-web-d69220e13c669b7730d8401e0803929467a59908.zip |
Merge pull request #115 from Pooja-Mahadev-Soundalgekar/master
DS_MATSUM
-rw-r--r-- | data_structures_correct/MATSUM.js | 35 | ||||
-rw-r--r-- | data_structures_correct/MATTRAN.js | 23 | ||||
-rw-r--r-- | data_structures_correct/MATZCONJ.js | 35 | ||||
-rw-r--r-- | data_structures_correct/MFCLCK_f.js | 28 | ||||
-rw-r--r-- | data_structures_correct/MIN_f.js | 24 | ||||
-rw-r--r-- | data_structures_correct/MUX.js | 26 | ||||
-rw-r--r-- | data_structures_correct/MUX_f.js | 26 | ||||
-rw-r--r-- | data_structures_correct/Modulo_Count.js | 26 |
8 files changed, 223 insertions, 0 deletions
diff --git a/data_structures_correct/MATSUM.js b/data_structures_correct/MATSUM.js new file mode 100644 index 0000000..5af9624 --- /dev/null +++ b/data_structures_correct/MATSUM.js @@ -0,0 +1,35 @@ +function MATSUM() { + + MATSUM.prototype.define = function MATSUM() { + this.function_name = "mat_sum"; + this.funtyp = 4; + + var model = scicos_model(); + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.out2 = new ScilabDouble([1]); + model.outtyp = new ScilabDouble([1]); + model.evtin = new ScilabDouble(); + model.evtout = new ScilabDouble(); + model.state = new ScilabDouble(); + model.dstate = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)], [sci2exp(0)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATSUM\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATSUM.prototype.details = function MATSUM() { + return this.x; + } +} + diff --git a/data_structures_correct/MATTRAN.js b/data_structures_correct/MATTRAN.js new file mode 100644 index 0000000..2ab793a --- /dev/null +++ b/data_structures_correct/MATTRAN.js @@ -0,0 +1,23 @@ +function MATTRAN() { + + MATTRAN.prototype.define = function MATTRAN() { + + var model = scicos_model(); + model.sim = list(new ScilabString(["mattran_m"]), new ScilabDouble([4])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.out = new ScilabDouble([-2]); + model.out2 = new ScilabDouble([-1]); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabString([sci2exp(1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATTRAN\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATTRAN.prototype.details = function MATTRAN() { + return this.x; + } +} + diff --git a/data_structures_correct/MATZCONJ.js b/data_structures_correct/MATZCONJ.js new file mode 100644 index 0000000..7ef31bf --- /dev/null +++ b/data_structures_correct/MATZCONJ.js @@ -0,0 +1,35 @@ +function MATZCONJ() { + + MATZCONJ.prototype.define = function MATZCONJ() { + this.function_name = "matz_conj"; + this.funtyp = 4; + + var model = scicos_model(); + model.sim = list(new ScilabString([this.function_name]), new ScilabDouble([this.funtyp])); + model.in = new ScilabDouble([-1]); + model.in2 = new ScilabDouble([-2]); + model.intyp = new ScilabDouble([2]); + model.out = new ScilabDouble([-1]); + model.out2 = new ScilabDouble([-2]); + model.outtyp = new ScilabDouble([2]); + model.evtin = new ScilabDouble(); + model.evtout = new ScilabDouble(); + model.state = new ScilabDouble(); + model.dstate = new ScilabDouble(); + model.rpar = new ScilabDouble(); + model.ipar = new ScilabDouble(); + model.blocktype = new ScilabString(["c"]); + model.firing = new ScilabDouble(); + model.dep_ut = new ScilabBoolean([true, false]); + + var label = new ScilabDouble(); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MATZCONJ\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, label, gr_i); + return new BasicBlock(this.x); + } + MATZCONJ.prototype.details = function MATZCONJ() { + return this.x; + } +} + diff --git a/data_structures_correct/MFCLCK_f.js b/data_structures_correct/MFCLCK_f.js new file mode 100644 index 0000000..abdeabe --- /dev/null +++ b/data_structures_correct/MFCLCK_f.js @@ -0,0 +1,28 @@ +function MFCLCK_f() { + + MFCLCK_f.prototype.define = function MFCLCK_f() { + this.nn = 2; + this.dt = 0.1; + + var model = scicos_model(); + model.sim = new ScilabString(["mfclck"]); + model.evtin = new ScilabDouble([1]); + model.evtout = new ScilabDouble([1], [1]); + model.dstate = new ScilabDouble([0]); + model.rpar = new ScilabDouble([this.dt]); + model.ipar = new ScilabDouble([this.nn]); + model.blocktype = new ScilabString(["d"]); + model.firing = new ScilabDouble([-1, 0]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.dt], [this.nn]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MFCLCK_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MFCLCK_f.prototype.details = function MFCLCK_f() { + return this.x; + } +} + diff --git a/data_structures_correct/MIN_f.js b/data_structures_correct/MIN_f.js new file mode 100644 index 0000000..e64f3af --- /dev/null +++ b/data_structures_correct/MIN_f.js @@ -0,0 +1,24 @@ +function MIN_f() { + + MIN_f.prototype.define = function MIN_f() { + this.in1 = -1; + + var model = scicos_model(); + model.sim = new ScilabString(["minblk"]); + model.in = new ScilabDouble([this.in1]); + model.out = new ScilabDouble([1]); + model.dstate = new ScilabDouble([0], [0]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([sci2exp(this.in1)]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MIN_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([2, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MIN_f.prototype.details = function MIN_f() { + return this.x; + } +} + diff --git a/data_structures_correct/MUX.js b/data_structures_correct/MUX.js new file mode 100644 index 0000000..f968deb --- /dev/null +++ b/data_structures_correct/MUX.js @@ -0,0 +1,26 @@ +function MUX() { + + MUX.prototype.define = function MUX() { + this.in1 = 2; + var arr = []; + arr.push(math.range(-1, -this.in1, -1, true)._data); + + var model = scicos_model(); + model.sim = list(new ScilabString(["multiplex"]), new ScilabDouble([4])); + model.in = new ScilabDouble(...math.transpose(arr)); + model.out = new ScilabDouble([0]); + model.ipar = new ScilabDouble([this.in1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.in1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MUX\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([.5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MUX.prototype.details = function MUX() { + return this.x; + } +} + diff --git a/data_structures_correct/MUX_f.js b/data_structures_correct/MUX_f.js new file mode 100644 index 0000000..fa55526 --- /dev/null +++ b/data_structures_correct/MUX_f.js @@ -0,0 +1,26 @@ +function MUX_f() { + + MUX_f.prototype.define = function MUX_f() { + this.in1 = 2; + var arr = []; + arr.push(math.range(-1, -this.in1, -1, true)._data); + + var model = scicos_model(); + model.sim = list(new ScilabString(["mux"]), new ScilabDouble([1])); + model.in = new ScilabDouble(...math.transpose(arr)); + model.out = new ScilabDouble([0]); + model.ipar = new ScilabDouble([this.in1]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([true, false]); + + var exprs = new ScilabString([this.in1]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"MUX_f\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([0.5, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + MUX_f.prototype.details = function MUX_f() { + return this.x; + } +} + diff --git a/data_structures_correct/Modulo_Count.js b/data_structures_correct/Modulo_Count.js new file mode 100644 index 0000000..bb6ad29 --- /dev/null +++ b/data_structures_correct/Modulo_Count.js @@ -0,0 +1,26 @@ +function Modulo_Count() { + + Modulo_Count.prototype.define = function Modulo_Count() { + this.ini_c = 0; + this.base = 3; + + var model = scicos_model(); + model.sim = list(new ScilabString(["modulo_count"]), new ScilabDouble([4])); + model.evtin = new ScilabDouble([1]); + model.out = new ScilabDouble([1]); + model.dstate = new ScilabDouble([this.ini_c]); + model.ipar = new ScilabDouble([this.base]); + model.blocktype = new ScilabString(["c"]); + model.dep_ut = new ScilabBoolean([false, false]); + + var exprs = new ScilabString([this.ini_c], [this.base]); + + var gr_i = new ScilabString(["xstringb(orig(1),orig(2),\"Modulo_Count\",sz(1),sz(2));"]); + this.x = new standard_define(new ScilabDouble([3, 2]), model, exprs, gr_i); + return new BasicBlock(this.x); + } + Modulo_Count.prototype.details = function Modulo_Count() { + return this.x; + } +} + |