/* autogenerated from "macros/MatrixOp/MATRESH.sci" */ function MATRESH() { MATRESH.prototype.define = function MATRESH() { this.model = scicos_model(); function_name = "mat_reshape"; 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]); this.model.intyp = new ScilabDouble([1]); this.model.out = new ScilabDouble([-1]); this.model.out2 = new ScilabDouble([-2]); this.model.outtyp = new ScilabDouble([1]); this.model.evtin = []; this.model.evtout = []; this.model.state = []; this.model.dstate = []; this.model.rpar = []; this.model.ipar = []; this.model.blocktype = new ScilabString(["c"]); this.model.firing = []; this.model.dep_ut = [true,false]; label = [[sci2exp(1)],[sci2exp([1,1])],[sci2exp([1,1])]]; gr_i = []; this.x = standard_define([3,2],this.model,label,gr_i); return new BasicBlock(this.x); } MATRESH.prototype.details = function MATRESH() { return this.x; } MATRESH.prototype.get = function MATRESH() { var options = { typ:["Datatype(1=real double 2=Complex)",this.typ], l1:["input size",this.l1], out:["output size desired",this.out], } return options; } MATRESH.prototype.set = function MATRESH() { this.typ = inverse(arguments[0]["typ"]) this.l1 = arguments[0]["l1"] this.out = arguments[0]["out"] this.lab = arguments[0]["lab"] this.x = arg1; this.model = arg1.model; graphics = arg1.graphics; label = graphics.exprs; if (size(label,"*")==14) { label[9-1] = []; } while (true) { [ok,this.typ,this.l1,this.out,this.lab] = scicos_getvalue("Set MATRESH block parameters",["Datatype(1=real double 2=Complex)","input size","output size desired"],list("vec",-1,"vec",-1,"vec",-1),label); if (!ok) { break; } nout = size(this.out); nin = size(this.l1); if (nout==0) { message("output must have at least one element"); ok = false; } if (nin==0) { message("input must have at least one element"); ok = false; } if (ok) { if (((this.out[1-1]>(this.l1[1-1]*this.l1[2-1])))) { message("the first dimension of the output is too big"); ok = false; } if (((this.out[2-1]>(this.l1[1-1]*this.l1[2-1])))) { message("the second dimension of the output is too big"); ok = false; } if ((((this.out[2-1]*this.out[1-1])>(this.l1[1-1]*this.l1[2-1])))) { message("the dimensions of the output are too big"); ok = false; } } if ((this.typ==1)) { function_name = "mat_reshape"; ot = 1; it = 1; } else if ((this.typ==2)) { function_name = "matz_reshape"; ot = 2; it = 2; } else { message("Datatype is not supported"); ok = false; } if (ok) { label = this.lab; [this.model,graphics,ok] = set_io(this.model,graphics,list(this.l1,it),list(this.out,ot),[],[]); } if (ok) { funtyp = 4; this.model.sim = list(new ScilabString([function_name]), new ScilabDouble([funtyp])); graphics.exprs = label; arg1.graphics = graphics; arg1.model = this.model; this.x = arg1; break; } } needcompile = resume(needcompile) return new BasicBlock(this.x); } }