summaryrefslogtreecommitdiff
path: root/combined.js
diff options
context:
space:
mode:
Diffstat (limited to 'combined.js')
-rw-r--r--combined.js247
1 files changed, 245 insertions, 2 deletions
diff --git a/combined.js b/combined.js
index 451f3024..558e512c 100644
--- a/combined.js
+++ b/combined.js
@@ -4435,8 +4435,7 @@ if (size(exprs,"*")==2) {
exprs=exprs(2);
}
while (true) {
-[ok,Amplitude,exprs]=scicos_getvalue([
- "Set Square generator block parameters"],["Amplitude"],list("vec",1),exprs);
+[ok,Amplitude,exprs]=scicos_getvalue(["Set Square generator block parameters"],["Amplitude"],list("vec",1),exprs);
if (!ok) {
break
}
@@ -5512,6 +5511,157 @@ x=standard_define([3,2],model,exprs,gr_i);
GENSIN_f.prototype.details = function GENSIN_f() {
}
}
+/* autogenerated from "macros/MatrixOp/MATMUL.sci" */
+function MATMUL() {
+MATMUL.prototype.get = function MATMUL() {
+}
+MATMUL.prototype.set = function MATMUL() {
+x=arg1;
+graphics=x.graphics;
+label=graphics.exprs;
+model=x.model;
+if (model.ipar==[]) {
+model.ipar=1;
+}
+if (size(label,"*")==1) {
+label[2-1]=sci2exp(1);
+}
+if (size(label,"*")==2) {
+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=None;
+}
+if ((rule<1||rule>3)) {
+message("Multiplication rule must be only 1,2 or 3");
+ok=None;
+}
+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);
+kmax=TABMAX(dtype);
+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
+}
+}
+}
+MATMUL.prototype.define = function MATMUL() {
+model=scicos_model();
+model.sim=list("matmul_m",4);
+model.in=[-1,-2];
+model.in2=[-2,-3];
+model.out=-1;
+model.out2=-3;
+model.dep_ut=[true,None];
+model.ipar=1;
+label=[sci2exp(model.ipar)];
+gr_i=[];
+x=standard_define([3,2],model,label,gr_i);
+}
+MATMUL.prototype.details = function MATMUL() {
+}
+}
/* autogenerated from "macros/MatrixOp/MATMAGPHI.sci" */
function MATMAGPHI() {
MATMAGPHI.prototype.get = function MATMAGPHI() {
@@ -8816,6 +8966,99 @@ x=standard_define([3.5,2],model,exprs,gr_i);
RATELIMITER.prototype.details = function RATELIMITER() {
}
}
+/* autogenerated from "macros/Misc/RELATIONALOP.sci" */
+function RELATIONALOP() {
+RELATIONALOP.prototype.get = function RELATIONALOP() {
+}
+RELATIONALOP.prototype.set = function RELATIONALOP() {
+x=arg1;
+graphics=arg1.graphics;
+exprs=graphics.exprs;
+model=arg1.model;
+if (size(exprs,1)==2) {
+exprs=[exprs,sci2exp(1)];
+}
+while (true) {
+[ok,rule,zcr,Datatype,exprs]=scicos_getvalue("Set parameters",["Operator: == (0), ~= (1), < (2), <= (3), > (4), >= (5)","Use zero crossing (no: 0), (yes: 1)","Datatype (1=double 3=int32 ...)"],list("vec",1,"vec",1,"vec",1),exprs);
+if (!ok) {
+break
+}
+rule=int(rule);
+if (zcr!=0) {
+zcr=1;
+}
+if ((rule<0)||(rule>5)) {
+message("Incorrect operator "+string(rule)+" ; must be 0 to 5.");
+ok=None;
+}
+if ((Datatype==1)) {
+model.sim=list("relational_op",4);
+} else if ((Datatype==3||Datatype==9)) {
+model.sim=list("relational_op_i32",4);
+} else if ((Datatype==4)) {
+model.sim=list("relational_op_i16",4);
+} else if ((Datatype==5)) {
+model.sim=list("relational_op_i8",4);
+} else if ((Datatype==6)) {
+model.sim=list("relational_op_ui32",4);
+} else if ((Datatype==7)) {
+model.sim=list("relational_op_ui16",4);
+} else if ((Datatype==8)) {
+model.sim=list("relational_op_ui8",4);
+} else {
+message("Datatype is not supported");
+ok=None;
+}
+if (ok) {
+it=Datatype*ones(1,2);
+ot=Datatype;
+in1=[-1,-2,-1,-2];
+out=[-1,-2];
+[model,graphics,ok]=set_io(model,graphics,list(in1,it),list(out,ot),[],[]);
+}
+if (ok) {
+if (rule==0) {
+label="==";
+} else if (rule==1) {
+label="~=";
+} else if (rule==2) {
+label="&#60;";
+} else if (rule==3) {
+label="&#8804;";
+} else if (rule==4) {
+label="&#62;";
+} else if (rule==5) {
+label="&#8805;";
+}
+graphics.exprs=exprs;
+graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
+model.ipar=[rule];
+model.nzcross=zcr;
+model.nmode=zcr;
+x.graphics=graphics;
+x.model=model;
+break
+}
+}
+}
+RELATIONALOP.prototype.define = function RELATIONALOP() {
+ipar=[2];
+label="&lt";
+model=scicos_model();
+model.sim=list("relationalop",4);
+model.in=[1,1];
+model.out=1;
+model.ipar=ipar;
+model.blocktype="c";
+model.dep_ut=[true,None];
+exprs=[string(ipar),string(0)];
+gr_i=[];
+x=standard_define([2,2],model,exprs,gr_i);
+x.graphics.style=["fontSize=13;fontStyle=1;displayedLabel="+label];
+}
+RELATIONALOP.prototype.details = function RELATIONALOP() {
+}
+}
/* autogenerated from "macros/Misc/CONSTRAINT_c.sci" */
function CONSTRAINT_c() {
CONSTRAINT_c.prototype.get = function CONSTRAINT_c() {