Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 0a6a6dba authored by hhakim's avatar hhakim
Browse files

Make matfaust ConstraintList ctor accept ConstraintGeneric arguments as pyfaust version does.

parent 9e5b9389
Branches
Tags
No related merge requests found
...@@ -12,6 +12,11 @@ classdef ConstraintList ...@@ -12,6 +12,11 @@ classdef ConstraintList
nargs = length(varargin); nargs = length(varargin);
this.clist = {}; this.clist = {};
while(i <= length(varargin)) while(i <= length(varargin))
if(isa(varargin{i}, 'ConstraintGeneric'))
this.clist = [ this.clist, {varargin{i}} ];
i = i + 1;
continue
end
cname = ConstraintName(varargin{i}); cname = ConstraintName(varargin{i});
if(i+1 > nargs) if(i+1 > nargs)
% ENOTE: throw() is a function (it needs ()) % ENOTE: throw() is a function (it needs ())
...@@ -34,7 +39,7 @@ classdef ConstraintList ...@@ -34,7 +39,7 @@ classdef ConstraintList
elseif(cname.is_real_constraint()) elseif(cname.is_real_constraint())
cons = ConstraintReal(cname, nrows, ncols, cval); cons = ConstraintReal(cname, nrows, ncols, cval);
elseif(cname.is_mat_constraint()) elseif(cname.is_mat_constraint())
cons = ConstraintMat(cname, nrows, ncols, cval); cons = ConstraintMat(cname, cval);
else else
% it shouldn't happen because ConstraintName has verified the input data % it shouldn't happen because ConstraintName has verified the input data
msg = ' Not a valid name for a ConstraintGeneric object.'; msg = ' Not a valid name for a ConstraintGeneric object.';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment