Mentions légales du service

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

Update matfaust.Faust ctor to auto-convert factors passed as arguments for...

Update matfaust.Faust ctor to auto-convert factors passed as arguments for type precision consistency (all factors must be of the same matlab class).
parent 3efd830c
No related branches found
No related tags found
No related merge requests found
......@@ -179,9 +179,16 @@ classdef Faust
F.isReal = false;
break
end
end
if(strcmp(class(factors{1}), 'single'))
F.dtype = 'float';
if(i == 1 && strcmp(class(factors{1}), 'single'))
F.dtype = 'float';
elseif(~ strcmp(class(factors{1}), class(factors{i})))
if(strcmp(F.dtype, 'float'))
factors{i} = single(factors{i});
else
factors{i} = double(factors{i});
end
warning(['Faust constructor: first factor is ' dtype ' but the ' int2str(i) '-th factor is ' class(factors{i}) '. It has been auto-converted to ' dtype ])
end
end
for i=2:nargin
switch(varargin{i})
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment