Mentions légales du service

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

Rewrite Faust.get_factor() (for both pyfaust and matfaust) to firstly not...

Rewrite Faust.get_factor() (for both pyfaust and matfaust) to firstly not altering the storage organization of the matrix copy of the factor (sparse or full) and secondly to optimize the function (fewer copies, etc.).

Before to this impl. the factor returned was a full matrix whatever the corresponding matrix was in the Faust (sparse or dense).

About optimization:
- the pyfaust version of get_factor() is clearly better than the former, in all situations (dense, sparse, transpose). The script misc/test/src/Python/test_getfact.py shows out the comparative performance results.
- The matfaust version is better in most cases but some issues proper to Matlab lower the benefits, see #13, #14 and #15 for possible solutions.

- The new implementation lays mainly in C++ core lib:
        * New signatures for Faust::Transform::get_fact() that allow to interact directly with MatSparse/MatDense buffers to diminish the number of copies made and simply permit to construct a sparse matrix from them into the wrapper interface.
        * New optional argument in Faust::MatSparse constructor for creating a sparse matrix from buffers: transpose bool for transposing the matrix at creation/copy time (instead of creating and then transposing which is more expensive).
        * New Faust::Transform::get_fact_nnz(), Faust::Transform::is_fact_sparse(), is_fact_dense() useful for gathering necessary information in wrappers before to copying back the factor.
        * Faust::TransformHelper links the added functions to make them available from wrapper (which use TransformHelper as underlying object, not Transform directly).
- In C++ matlab wrapper code: adding transformFact2SparseMxArray(), transformFact2FullMxArray() template functions to convert a factor buffers (obtained from TransformHelper) to a sparse matrix or full matrix (complex or real).
- Adapting and completing unit tests, in particular FaustTest.testGetFactorAndConstructor (matlab) and TestFaustPy.testGetFactorAndConstructor (python).
- A bit of documentation (related or unrelated to get_factor()).
- The previous version of the function is kept as get_factor_nonopt() but it's hidden in the doxydoc.
- Few minor changes in attribute names for Constraint* etc.
parent a870fb67
No related branches found
No related tags found
No related merge requests found
Showing
with 1010 additions and 101 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment