Mentions légales du service

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

Add matfaust.factpararms.ParamsHierarchicalWHTNoResCons and adjust pyfaust counterpart doc.

parent 999a03f1
Branches
Tags
No related merge requests found
......@@ -31,7 +31,7 @@ if(BUILD_DOCUMENTATION)
string(CONCAT DOXYGEN_FILE_PATTERNS "*.cpp *.hpp *.h *.cu *.hu")
endif()
if(BUILD_WRAPPER_MATLAB)
string(CONCAT DOXYGEN_FILE_PATTERNS ${DOXYGEN_FILE_PATTERNS} " Faust.m FaustMulMode.m StoppingCriterion.m ConstraintGeneric.m ConstraintMat.m ConstraintReal.m ConstraintInt.m ConstraintName.m ParamsFact.m ParamsHierarchical.m ParamsPalm4MSA.m FaustFactory.m hadamard.m quickstart.m fft.m bsl.m runtimecmp.m runall.m version.m faust_fact.m ParamsHierarchicalSquareMat.m ParamsHierarchicalRectMat.m license.m omp.m wht.m dft.m eye.m rand.m rand_bsr.m eigtj.m hierarchical.m fact.m palm4msa.m fgft_givens.m fgft_palm.m svdtj.m splin.m spcol.m proj_gen.m sp.m const.m supp.m hankel.m toeplitz.m circ.m normcol.m normlin.m splincol.m blockdiag.m skperm.m enable_gpu_mod.m isFaust.m poly.m basis.m next.m expm_multiply.m FaustPoly.m MHTPParams.m palm4msa_mhtp.m hierarchical_mhtp.m butterfly.m ParamsHierarchicalDFT.m create_bsr.m ParamsPalm4msaWHT.m proj_id.m ParamsHierarchicalNoResCons.m ") # warning: the space on the end matters
string(CONCAT DOXYGEN_FILE_PATTERNS ${DOXYGEN_FILE_PATTERNS} " Faust.m FaustMulMode.m StoppingCriterion.m ConstraintGeneric.m ConstraintMat.m ConstraintReal.m ConstraintInt.m ConstraintName.m ParamsFact.m ParamsHierarchical.m ParamsPalm4MSA.m FaustFactory.m hadamard.m quickstart.m fft.m bsl.m runtimecmp.m runall.m version.m faust_fact.m ParamsHierarchicalSquareMat.m ParamsHierarchicalRectMat.m license.m omp.m wht.m dft.m eye.m rand.m rand_bsr.m eigtj.m hierarchical.m fact.m palm4msa.m fgft_givens.m fgft_palm.m svdtj.m splin.m spcol.m proj_gen.m sp.m const.m supp.m hankel.m toeplitz.m circ.m normcol.m normlin.m splincol.m blockdiag.m skperm.m enable_gpu_mod.m isFaust.m poly.m basis.m next.m expm_multiply.m FaustPoly.m MHTPParams.m palm4msa_mhtp.m hierarchical_mhtp.m butterfly.m ParamsHierarchicalDFT.m create_bsr.m ParamsPalm4msaWHT.m proj_id.m ParamsHierarchicalNoResCons.m ParamsHierarchicalWHTNoResCons.m ") # warning: the space on the end matters
endif()
if(BUILD_WRAPPER_PYTHON)
string(CONCAT DOXYGEN_FILE_PATTERNS ${DOXYGEN_FILE_PATTERNS} "__init__.py factparams.py demo.py tools.py fact.py proj.py poly.py")
......
......@@ -133,7 +133,7 @@ classdef ConstraintName
id = ConstraintName.HANKEL;
case 'blockdiag'
id = ConstraintName.BLKDIAG;
case 'id'
case {'id', 'proj_id'}
id = ConstraintName.ID;
otherwise
error(err_msg)
......
% =================================================
%> The simplified parameterization class for factorizing a Hadamard matrix with the hierarchical factorization algorithm.
%> This type of parameters is typically used for a Hadamard matrix factorization.
%> This is a variant of ParamsHierarchicalWHT. Here the intermediate residual
%> factors are not constrained at all, the other factors are constrained with
%> matfaust.proj.skperm.
%>
%> @b Example
%> @code
%> import matfaust.wht
%> import matfaust.factparams.*
%> import matfaust.fact.hierarchical
%>
%> H = full(wht(32));
%> p = ParamsHierarchicalWHTNoResCons(5);
%> F = hierarchical(H, p)
%> @endcode
%>
%> <b/> See also matfaust.fact.hierarchical, matfaust.demo.hadamard
% =================================================
classdef ParamsHierarchicalWHTNoResCons < matfaust.factparams.ParamsHierarchicalNoResCons
methods
% =================================================
%> @param n: the number of output factors (the input matrix to factorize must
%> be of size [2^n, 2^n]) .
% =================================================
function p = ParamsHierarchicalWHTNoResCons(n, varargin)
import matfaust.factparams.*
proj_name = 'skperm'; % because splincol doesn't work well
cons_name = ConstraintName.str2name_int(proj_name);
d = 2^ceil(n);
stop_crit = StoppingCriterion(30);
cons = {};
for i=1:n-1
cons = {cons{:} ConstraintInt(ConstraintName(cons_name), d, d, 2)};
end
cons = {cons{:} ConstraintInt(ConstraintName(cons_name), d, d, ceil(d/2^(n-1)))};
p@matfaust.factparams.ParamsHierarchicalNoResCons(cons, stop_crit, ...
stop_crit, 'is_update_way_R2L', true, 'packing_RL', false, ...
varargin{:});
end
end
methods(Static)
function sp = createParams(M, p)
import matfaust.factparams.ParamsHierarchicalWHTNoResCons
pot = log2(size(M,1));
if(size(M,1) ~= size(M,2) || pot-floor(pot) > 0)
error('M must be a square matrix of order a power of two.')
end
sp = ParamsHierarchicalWHTNoResCons(pot);
end
end
end
......@@ -1547,11 +1547,9 @@ class ParamsHierarchicalWHTNoResCons(ParamsHierarchicalNoResCons):
"""
def __init__(self, n):
"""
args:
Args:
n: the number of output factors (the input matrix to factorize must
be of shape (2**n, 2**n)) .
proj_name: the type of projector used, must be either
'splincol' (default value) or 'skperm'.
"""
proj_name = 'skperm' # when proj_id is used to constraint intermediate
# residual factors the splincol prox doesn't work well (bad
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment