Mentions légales du service

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

Make Palm4MSA and HierarchicalFact. algos compatible with complex matrices (C++, Matlab, Python).

Faust now manages to factorize complex matrices in the C++ core and wrappers are bound to it.

The results for real matrices are not changed at all: unit tests still return the exact same relative error between the original matrix and its approximate by factorization.

- For C++ core:
* Adapting the Palm4MSA class/algorithm: in calculation of gradient, transpose ops are replaced by conjugate-transpose.
* Adding a template parameter FPP2 to be able to instantiate StoppingCriterion with a different template parameter than for example MatDense. Before the template type was shared and obviously when the MatDense scalar type is complex we don't want the StoppingCriterion to become complex for the error treshold (that must remain a real value). This new template parameter type is passed through Palm4MSA, Hierarchical, Params, ParamsPalm classes and some functions. It is also used for ConstraintFPP because again we don't want a complex type (used for MatDense) to set the norm-based constraints (it must remain a real).
* Generate (cmake) new unit tests for hierarchicalFactorization test_palm4MSA faust_multiplication to test complex<float> and complex<double> (however the matrix tested remains a real matrix taken as complex matrix ; imaginary part is the zero matrix).
* ConstraintGeneric is not a template class anymore. The reason is that it's needed to know FPP2 when down-casting from ConstraintGeneric to ConstraintFPP and it makes the code a bit complicated when using a collection of ConstraintGeneric. (But maybe this modification is to rolli-back later).
To replace template class ConstraintGeneric, some member functions of that class become template functions.
Consistently, ConstraintType also receives the new template parameter type FPP2.

- For Matlab:
* Update cmake script for compilation of mex files mexPalm4MSA.cpp, mexHierarchical_fact.cpp for complex.
* New unit tests for complex versions of Palm4MSA and HierarchicalFact in FaustFactoryTest.m.

- For Python:
* New unit tests, equivalent to matlab's.
parent 9306b220
No related branches found
No related tags found
No related merge requests found
Showing
with 493 additions and 276 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment