Mentions légales du service

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

Add the matfaust version of FaustFactory.fact_palm4msa_constends().

parent 0a6a6dba
No related merge requests found
...@@ -111,6 +111,32 @@ classdef FaustFactory ...@@ -111,6 +111,32 @@ classdef FaustFactory
F = Faust(core_obj, isreal(M)); F = Faust(core_obj, isreal(M));
end end
function [F, lambda] = fact_palm4msa_constends(M, p, A, B)
import matfaust.factparams.*
import matfaust.FaustFactory
consA = ConstraintList('const', A, size(A,1), size(A,2));
new_consts = {};
new_consts = [ {consA.clist{:}}, {p.constraints{:}} ];
if(ismatrix(B))
consB = ConstraintList('const', B, size(B,1), size(B,2));
new_consts = [ new_consts, {consB.clist{:}} ];
end
new_consts = ConstraintList(new_consts{:});
p = ParamsPalm4MSA(new_consts, p.stop_crit, 'is_update_way_R2L', p.is_update_way_R2L, ...
'init_lambda', p.init_lambda, 'step_size', p.step_size, 'constant_step_size', ...
p.constant_step_size, 'is_verbose', p.is_verbose, 'init_facts', p.init_facts);
[F, lambda ] = FaustFactory.fact_palm4msa(M, p);
f1 = get_factor(F, 1);
f1 = f1 / lambda;
nF = cell(1, get_num_factors(F));
nF{1} = f1;
for i=2:get_num_factors(F)
nF{i} = get_factor(F, i);
end
nF{2} = nF{2}*lambda;
F = matfaust.Faust(nF);
end
%========================================================================================== %==========================================================================================
%> @brief Factorizes the matrix M with Hierarchical Factorization using the parameters set in p. %> @brief Factorizes the matrix M with Hierarchical Factorization using the parameters set in p.
%> %>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment