Mentions légales du service

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

Update matfaust/pyfaust to premultiply output Faust by lambda with 2020...

Update matfaust/pyfaust to premultiply output Faust by lambda with 2020 backend (as it's done with 2016 backend -- consistency).

Other minor change.
parent a9103aa3
No related branches found
No related tags found
No related merge requests found
......@@ -1191,7 +1191,7 @@ class TestFaustFactory(unittest.TestCase):
err = norm((F.todense()*D)*F.T.todense()-Lap,"fro")/norm(Lap,"fro")
# matrix to factorize and reference relative error come from
# misc/test/src/C++/hierarchicalFactorizationFFT.cpp
self.assertAlmostEqual(err, 0.08480, places=5)
self.assertAlmostEqual(err, 0.08480, places=4)
def test_splin(self):
from pyfaust.proj import splin
......
......@@ -177,7 +177,6 @@ function varargout = hierarchical(M, p, varargin)
error('backend 2020 doesn''t handle yet the complex matrices')
end
F = Faust(core_obj, isreal(M));
F = F * lambda; % TODO: should be multiplied before
end
varargout = {F, lambda, p};
end
......@@ -119,6 +119,10 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
bool compute_2norm_on_arrays = false;
auto th = Faust::hierarchical(matrix, params->stop_crit_global.get_crit(), fac_cons, res_cons, lambda, params->isUpdateWayR2L, params->isFactSideLeft, params->use_csr, params->packing_RL, compute_2norm_on_arrays, params->norm2_threshold, params->norm2_max_iter);
auto th_times_lambda = th->multiply(lambda);
delete th;
th = th_times_lambda;
Faust::MatDense<FPP2,Cpu> mat1x1Lambda = Faust::MatDense<FPP2, Cpu>(&lambda, 1, 1);
plhs[0] = FaustMat2mxArray(mat1x1Lambda);
......
......@@ -549,7 +549,7 @@ FaustCoreCpp<FPP>* hierarchical2020(FPP* mat, unsigned int num_rows, unsigned in
if(norm2_max_iter == 0)
norm2_max_iter = FAUST_NORM2_MAX_ITER;
Faust::TransformHelper<FPP,Cpu>* th;
Faust::TransformHelper<FPP,Cpu>* th, *th_times_lambda;
try
{
th = Faust::hierarchical(inMat, nites, fact_cons, residuum_cons, inout_lambda[0], is_update_way_R2L,
......@@ -558,7 +558,9 @@ FaustCoreCpp<FPP>* hierarchical2020(FPP* mat, unsigned int num_rows, unsigned in
/* compute_2norm_on_array*/ false,
norm2_threshold,
norm2_max_iter);
th_times_lambda = th->multiply(inout_lambda[0]);
delete th;
th = th_times_lambda;
}
catch(std::logic_error& e)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment