summaryrefslogtreecommitdiff
path: root/js/MatrixOp
diff options
context:
space:
mode:
Diffstat (limited to 'js/MatrixOp')
-rw-r--r--js/MatrixOp/CUMSUM.js95
-rw-r--r--js/MatrixOp/EXTRACT.js93
-rw-r--r--js/MatrixOp/MATCATH.js2
-rw-r--r--js/MatrixOp/MATEIG.js93
-rw-r--r--js/MatrixOp/MATMAGPHI.js76
-rw-r--r--js/MatrixOp/MATSING.js96
-rw-r--r--js/MatrixOp/MATSUM.js97
-rw-r--r--js/MatrixOp/MATZREIM.js76
-rw-r--r--js/MatrixOp/ROOTCOEF.js72
-rw-r--r--js/MatrixOp/SUBMAT.js93
10 files changed, 774 insertions, 19 deletions
diff --git a/js/MatrixOp/CUMSUM.js b/js/MatrixOp/CUMSUM.js
index 83f3df26..0b111b2f 100644
--- a/js/MatrixOp/CUMSUM.js
+++ b/js/MatrixOp/CUMSUM.js
@@ -1,3 +1,94 @@
-Syntax error in input LexToken(CLOSESQBRACKET,']',1,1605)
/* autogenerated from "macros/MatrixOp/CUMSUM.sci" */
-None
+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]=[];
+}
+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=None;
+}
+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=None;
+}
+it=2;
+ot=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+in1=[model.in,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
+}
+}
+}
+CUMSUM.prototype.define = function CUMSUM() {
+model=scicos_model();
+function_name="cumsum_m";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=[sci2exp(1),sci2exp(0)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+CUMSUM.prototype.details = function CUMSUM() {
+}
+}
diff --git a/js/MatrixOp/EXTRACT.js b/js/MatrixOp/EXTRACT.js
index aacb03a7..5189f49a 100644
--- a/js/MatrixOp/EXTRACT.js
+++ b/js/MatrixOp/EXTRACT.js
@@ -1,3 +1,92 @@
-Syntax error in input LexToken(CLOSESQBRACKET,']',1,1345)
/* autogenerated from "macros/MatrixOp/EXTRACT.sci" */
-None
+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]=[];
+}
+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=None;
+}
+ma=size(a,1);
+mb=size(b,1);
+if ((ma==0||mb==0)) {
+message("empty field");
+ok=None;
+}
+for(i=1;i<=ma;i+=1) {
+if ((a(i)<=0)) {
+message("invalid index");
+ok=None;
+}
+}
+for(j=1;j<=mb;j+=1) {
+if ((b(j)<=0)) {
+message("invalid index");
+ok=None;
+}
+}
+model.ipar=[a,b,ma,mb];
+in1=[model.in,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
+}
+}
+}
+EXTRACT.prototype.define = function EXTRACT() {
+model=scicos_model();
+function_name="extract";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=[sci2exp(1),sci2exp([1]),sci2exp([1])];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+EXTRACT.prototype.details = function EXTRACT() {
+}
+}
diff --git a/js/MatrixOp/MATCATH.js b/js/MatrixOp/MATCATH.js
index 66648256..40f8c5b8 100644
--- a/js/MatrixOp/MATCATH.js
+++ b/js/MatrixOp/MATCATH.js
@@ -1,3 +1,3 @@
-Syntax error in input LexToken(COLON,':',1,1460)
+Syntax error in input LexToken(OPENBRACKET,'(',1,1457)
/* autogenerated from "macros/MatrixOp/MATCATH.sci" */
None
diff --git a/js/MatrixOp/MATEIG.js b/js/MatrixOp/MATEIG.js
index 1a4da13a..6f87ebc6 100644
--- a/js/MatrixOp/MATEIG.js
+++ b/js/MatrixOp/MATEIG.js
@@ -1,3 +1,92 @@
-Syntax error in input LexToken(CLOSESQBRACKET,']',1,2562)
/* autogenerated from "macros/MatrixOp/MATEIG.sci" */
-None
+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]=[];
+}
+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=None;
+}
+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=None;
+}
+it=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+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
+}
+}
+}
+MATEIG.prototype.define = function MATEIG() {
+model=scicos_model();
+function_name="mat_vps";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=[sci2exp(1),sci2exp(1)];
+gr_i=[];
+x=standard_define([2,2],model,label,gr_i);
+}
+MATEIG.prototype.details = function MATEIG() {
+}
+}
diff --git a/js/MatrixOp/MATMAGPHI.js b/js/MatrixOp/MATMAGPHI.js
index 125685a5..ee8c394a 100644
--- a/js/MatrixOp/MATMAGPHI.js
+++ b/js/MatrixOp/MATMAGPHI.js
@@ -1,3 +1,75 @@
-Syntax error in input LexToken(CLOSESQBRACKET,']',1,1510)
/* autogenerated from "macros/MatrixOp/MATMAGPHI.sci" */
-None
+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]=[];
+}
+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=None;
+}
+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
+}
+}
+}
+MATMAGPHI.prototype.define = function MATMAGPHI() {
+model=scicos_model();
+function_name="matz_abs";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=[sci2exp(1)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+MATMAGPHI.prototype.details = function MATMAGPHI() {
+}
+}
diff --git a/js/MatrixOp/MATSING.js b/js/MatrixOp/MATSING.js
index 682208e5..789a1349 100644
--- a/js/MatrixOp/MATSING.js
+++ b/js/MatrixOp/MATSING.js
@@ -1,3 +1,95 @@
-Syntax error in input LexToken(CLOSESQBRACKET,']',1,1605)
/* autogenerated from "macros/MatrixOp/MATSING.sci" */
-None
+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]=[];
+}
+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=None;
+}
+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=None;
+}
+it=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+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
+}
+}
+}
+MATSING.prototype.define = function MATSING() {
+model=scicos_model();
+function_name="mat_sing";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=[sci2exp(1),sci2exp(1)];
+gr_i=[];
+x=standard_define([2,2],model,label,gr_i);
+}
+MATSING.prototype.details = function MATSING() {
+}
+}
diff --git a/js/MatrixOp/MATSUM.js b/js/MatrixOp/MATSUM.js
index ca92cefa..c85eb356 100644
--- a/js/MatrixOp/MATSUM.js
+++ b/js/MatrixOp/MATSUM.js
@@ -1,3 +1,96 @@
-Syntax error in input LexToken(CLOSESQBRACKET,']',1,1814)
/* autogenerated from "macros/MatrixOp/MATSUM.sci" */
-None
+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]=[];
+}
+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=None;
+}
+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=None;
+}
+it=2;
+ot=2;
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+in1=[model.in,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
+}
+}
+}
+MATSUM.prototype.define = function MATSUM() {
+model=scicos_model();
+function_name="mat_sum";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=[sci2exp(1),sci2exp(0)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+MATSUM.prototype.details = function MATSUM() {
+}
+}
diff --git a/js/MatrixOp/MATZREIM.js b/js/MatrixOp/MATZREIM.js
index a719dd60..ba3a7deb 100644
--- a/js/MatrixOp/MATZREIM.js
+++ b/js/MatrixOp/MATZREIM.js
@@ -1,3 +1,75 @@
-Syntax error in input LexToken(CLOSESQBRACKET,']',1,1513)
/* autogenerated from "macros/MatrixOp/MATZREIM.sci" */
-None
+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]=[];
+}
+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=None;
+}
+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
+}
+}
+}
+MATZREIM.prototype.define = function MATZREIM() {
+model=scicos_model();
+function_name="matz_reim";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=sci2exp(1);
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+MATZREIM.prototype.details = function MATZREIM() {
+}
+}
diff --git a/js/MatrixOp/ROOTCOEF.js b/js/MatrixOp/ROOTCOEF.js
index eb039445..7f24dee9 100644
--- a/js/MatrixOp/ROOTCOEF.js
+++ b/js/MatrixOp/ROOTCOEF.js
@@ -1,3 +1,71 @@
-Syntax error in input LexToken(VAR,'model',1,1794)
/* autogenerated from "macros/MatrixOp/ROOTCOEF.sci" */
-None
+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]=[];
+}
+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=None;
+}
+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
+}
+}
+}
+ROOTCOEF.prototype.define = function ROOTCOEF() {
+model=scicos_model();
+function_name="root_coef";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+label=[sci2exp(1),sci2exp(1)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+ROOTCOEF.prototype.details = function ROOTCOEF() {
+}
+}
diff --git a/js/MatrixOp/SUBMAT.js b/js/MatrixOp/SUBMAT.js
index 78645082..de8fdf66 100644
--- a/js/MatrixOp/SUBMAT.js
+++ b/js/MatrixOp/SUBMAT.js
@@ -1,3 +1,92 @@
-Syntax error in input LexToken(OPENBRACKET,'(',1,2697)
/* autogenerated from "macros/MatrixOp/SUBMAT.sci" */
-None
+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]);
+}
+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=None;
+}
+if ((a<=0)||(b<=0)||(c<=0)||(d<=0)) {
+message("invalid index");
+ok=None;
+}
+if (b<a) {
+message("ending row must be greater than starting row");
+ok=None;
+}
+if (d<c) {
+message("ending column must be greater than starting column");
+ok=None;
+}
+if (b>inp(1)) {
+message("index of ending row is out of range");
+ok=None;
+}
+if (d>inp(2)) {
+message("index of ending column is out of range");
+ok=None;
+}
+model.ipar=[a,b,c,d];
+in1=[inp(1),inp(2)];
+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
+}
+}
+}
+SUBMAT.prototype.define = function SUBMAT() {
+model=scicos_model();
+function_name="submat";
+funtyp=4;
+model.sim=list(function_name,funtyp);
+model.in=-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,None];
+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() {
+}
+}