Mentions légales du service

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

Fix two bugs related to the recent refactoring of matfaust.

Faust.complex was errored because of factors variable which is now a function.
FaustTest has errors due to the same reason and because of rand function conflicts between matfaust and matlab builtin.
parent ed5f50cf
Branches
Tags
No related merge requests found
......@@ -446,7 +446,6 @@ classdef FaustTest < matlab.unittest.TestCase
this.verifyEqual(norm(full_test_F), norm(ref), 'RelTol', 10^-2)
end
disp('test plus(Faust1,Faust2)')
import matfaust.FaustFactory
import matfaust.Faust
fausts = {matfaust.rand(5,size(F,1))*Faust(rand(size(F,1),size(F,2))), matfaust.rand(5,size(F,1), .5, 'complex')*Faust(rand(size(F,1),size(F,2)))}
for i=1:length(fausts)
......@@ -467,7 +466,6 @@ classdef FaustTest < matlab.unittest.TestCase
this.verifyEqual(full_test_F, ref, 'RelTol', 10^-2)
end
disp('test minus(Faust1,Faust2)')
import matfaust.FaustFactory
import matfaust.Faust
fausts = {matfaust.rand(5,size(F,1))*Faust(rand(size(F,1),size(F,2)))} %, matfaust.rand(5,size(F,1), .5, 'complex')*rand(size(F,2),size(F,2))} %TODO: re-enable complex Faust when #72 is solved
for i=1:length(fausts)
......@@ -477,7 +475,6 @@ classdef FaustTest < matlab.unittest.TestCase
end
function testcat(this)
import matfaust.rand
import matfaust.Faust
disp('Test cat')
FAUST=0;
......@@ -503,6 +500,7 @@ classdef FaustTest < matlab.unittest.TestCase
H_facs{i} = factors(G, i);
end
end
H_facs
H = Faust(H_facs);
if(typeG == SPARSE)
H_ = sparse(full(H));
......
......@@ -1913,17 +1913,17 @@ classdef Faust
cF = F;
else
n = numfactors(F);
factors = cell(1,n);
facs = cell(1,n);
for i=1:n
factors{i} = factors(F,i);
if(issparse(factors{i}))
facs{i} = factors(F,i);
if(issparse(facs{i}))
% avoid complex() error: Input A must be numeric and full.
factors{i} = sparse(complex(full(factors{i})));
facs{i} = sparse(complex(full(facs{i})));
else
factors{i} = complex(factors{i});
facs{i} = complex(facs{i});
end
end
cF = matfaust.Faust(factors);
cF = matfaust.Faust(facs);
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment