Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 53bf1423 authored by Nicolas Bellot's avatar Nicolas Bellot Committed by hhakim
Browse files

documentation developpeur wrapper matlab

parent eb12bb43
Branches
Tags
No related merge requests found
##############################################################################
## Description: ##
## For more information on the FAuST Project, please visit the website ##
## of the project : <http://faust.gforge.inria.fr> ##
## ##
## License: ##
## Copyright (2016): Nicolas Bellot, Adrien Leman, Thomas Gautrais, ##
## Luc Le Magoarou, Remi Gribonval ##
## INRIA Rennes, FRANCE ##
## http://www.inria.fr/ ##
## ##
## The FAuST Toolbox is distributed under the terms of the GNU Affero ##
## General Public License. ##
## This program is free software: you can redistribute it and/or modify ##
## it under the terms of the GNU Affero General Public License as ##
## published by the Free Software Foundation. ##
## ##
## This program is distributed in the hope that it will be useful, but ##
## WITHOUT ANY WARRANTY; without even the implied warranty of ##
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ##
## See the GNU Affero General Public License for more details. ##
## ##
## You should have received a copy of the GNU Affero General Public ##
## License along with this program. ##
## If not, see <http://www.gnu.org/licenses/>. ##
## ##
## Contacts: ##
## Nicolas Bellot : nicolas.bellot@inria.fr ##
## Adrien Leman : adrien.leman@inria.fr ##
## Thomas Gautrais : thomas.gautrais@inria.fr ##
## Luc Le Magoarou : luc.le-magoarou@inria.fr ##
## Remi Gribonval : remi.gribonval@inria.fr ##
##############################################################################
/****************************************************************************/
/* Description: */
/* For more information on the FAuST Project, please visit the website */
/* of the project : <http://faust.gforge.inria.fr> */
/* */
/* License: */
/* Copyright (2016): Nicolas Bellot, Adrien Leman, Thomas Gautrais, */
/* Luc Le Magoarou, Remi Gribonval */
/* INRIA Rennes, FRANCE */
/* http://www.inria.fr/ */
/* */
/* The FAuST Toolbox is distributed under the terms of the GNU Affero */
/* General Public License. */
/* This program is free software: you can redistribute it and/or modify */
/* it under the terms of the GNU Affero General Public License as */
/* published by the Free Software Foundation. */
/* */
/* This program is distributed in the hope that it will be useful, but */
/* WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */
/* See the GNU Affero General Public License for more details. */
/* */
/* You should have received a copy of the GNU Affero General Public */
/* License along with this program. */
/* If not, see <http://www.gnu.org/licenses/>. */
/* */
/* Contacts: */
/* Nicolas Bellot : nicolas.bellot@inria.fr */
/* Adrien Leman : adrien.leman@inria.fr */
/* Thomas Gautrais : thomas.gautrais@inria.fr */
/* Luc Le Magoarou : luc.le-magoarou@inria.fr */
/* Remi Gribonval : remi.gribonval@inria.fr */
/* */
/* References: */
/* [1] Le Magoarou L. and Gribonval R., "Flexible multi-layer sparse */
/* approximations of matrices and applications", Journal of Selected */
/* Topics in Signal Processing, 2016. */
/* <https://hal.archives-ouvertes.fr/hal-01167948v1> */
/****************************************************************************/
%% Description
%
%
% For more information on the FAuST Project, please visit the website of
% the project : <http://faust.gforge.inria.fr>
%
%% License:
% Copyright (2016): Nicolas Bellot, Adrien Leman, Thomas Gautrais, Luc Le Magoarou, Remi Gribonval
% INRIA Rennes, FRANCE
% http://www.inria.fr/
%
% The FAuST Toolbox is distributed under the terms of the GNU Affero
% General Public License.
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public License as published
% by the Free Software Foundation.
%
% This program is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% See the GNU Affero General Public License for more details.
%
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
%% Contacts:
% Nicolas Bellot : nicolas.bellot@inria.fr
% Adrien Leman : adrien.leman@inria.fr
% Thomas Gautrais : thomas.gautrais@inria.fr
% Luc Le Magoarou : luc.le-magoarou@inria.fr
% Remi Gribonval : remi.gribonval@inria.fr
%
%% References:
% [1] Le Magoarou L. and Gribonval R., "Flexible multi-layer sparse
% approximations of matrices and applications", Journal of Selected
% Topics in Signal Processing, 2016.
% <https://hal.archives-ouvertes.fr/hal-01167948v1>
%%
DANS LE CAS DE L UTILISATION DE LA MATRICE MEG
%% Description
%
%
% For more information on the FAuST Project, please visit the website of
% the project : <http://faust.gforge.inria.fr>
%
%% License:
% Copyright (2016): Nicolas Bellot, Adrien Leman, Thomas Gautrais, Luc Le Magoarou, Remi Gribonval
% INRIA Rennes, FRANCE
% http://www.inria.fr/
%
% The FAuST Toolbox is distributed under the terms of the GNU Affero
% General Public License.
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU Affero General Public License as published
% by the Free Software Foundation.
%
% This program is distributed in the hope that it will be useful, but
% WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% See the GNU Affero General Public License for more details.
%
% You should have received a copy of the GNU Affero General Public License
% along with this program. If not, see <http://www.gnu.org/licenses/>.
%
%% Contacts:
% Nicolas Bellot : nicolas.bellot@inria.fr
% Adrien Leman : adrien.leman@inria.fr
% Thomas Gautrais : thomas.gautrais@inria.fr
% Luc Le Magoarou : luc.le-magoarou@inria.fr
% Remi Gribonval : remi.gribonval@inria.fr
%
%% References:
% [1] Le Magoarou L. and Gribonval R., "Flexible multi-layer sparse
% approximations of matrices and applications", Journal of Selected
% Topics in Signal Processing, 2016.
% <https://hal.archives-ouvertes.fr/hal-01167948v1>
%
% [2] A. Gramfort, M. Luessi, E. Larson, D. Engemann, D. Strohmeier,
% C. Brodbeck, L. Parkkonen, M. Hamalainen, MNE software for processing
% MEG and EEG data <http://www.ncbi.nlm.nih.gov/pubmed/24161808>,
% NeuroImage, Volume 86, 1 February 2014, Pages 446-460, ISSN 1053-8119,
% [DOI] <http://dx.doi.org/10.1016/j.neuroimage.2013.10.027>
%%
...@@ -30,10 +30,12 @@ endif(BUILD_OPENBLAS) ...@@ -30,10 +30,12 @@ endif(BUILD_OPENBLAS)
add_library(${FAUST_MEXTOOLS_TARGET} OBJECT ${CPP_MEXTOOLS_FILES}) add_library(${FAUST_MEXTOOLS_TARGET} OBJECT ${CPP_MEXTOOLS_FILES})
#target_link_libraries(${FAUST_MEXTOOLS_TARGET} ${FAUST_TARGET})
# specialisation template scalar with real # configuration de mexFaust.cpp.in
# specialisation of the class mexFaust template scalar with real
set(FAUST_SCALAR "double") set(FAUST_SCALAR "double")
configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexFaust.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexFaustReal.cpp @ONLY) configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexFaust.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexFaustReal.cpp @ONLY)
# specialisation of the class mexFaust template scalar with complex scalar
set(FAUST_SCALAR "std::complex<double>") set(FAUST_SCALAR "std::complex<double>")
configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexFaust.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexFaustCplx.cpp @ONLY) configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexFaust.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexFaustCplx.cpp @ONLY)
...@@ -158,8 +160,8 @@ foreach(mex_target ${MEXFILE_TARGET_LIST}) ...@@ -158,8 +160,8 @@ foreach(mex_target ${MEXFILE_TARGET_LIST})
# CONFIGURATION DES CHEMINS # CONFIGURATION DES CHEMINS
configure_file(${FAUST_MATLAB_SRC_DIR}/setup_FAUST.m.in ${FAUST_MATLAB_BIN_DIR}/setup_FAUST.m @ONLY) configure_file(${FAUST_MATLAB_SRC_DIR}/setup_FAUST.m ${FAUST_MATLAB_BIN_DIR}/setup_FAUST.m COPYONLY)
#install(FILES ${FAUST_MATLAB_BIN_DIR}/setup_FAUST.m DESTINATION ${CMAKE_INSTALL_MATLAB_PREFIX} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_WRITE WORLD_EXECUTE )
### OLD MATLAB VERSION CODE TO MAKE TIME COMPARISON ######## ### OLD MATLAB VERSION CODE TO MAKE TIME COMPARISON ########
......
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
classdef Faust classdef Faust
properties (SetAccess = private, Hidden = true) properties (SetAccess = private, Hidden = true)
matrix; % Handle to the underlying C++ class instance matrix; % Handle to the FaustCore class instance
transpose_flag; % boolean to know if the Faust is transpose or not transpose_flag; % boolean to know if the Faust is transpose or not
isReal; isReal;
end end
...@@ -214,7 +214,7 @@ classdef Faust ...@@ -214,7 +214,7 @@ classdef Faust
if (isreal(F)) if (isreal(F))
F_ctrans=transpose(F); F_ctrans=transpose(F);
else else
error('ctranspose is not yet implemented for complex scalar Faust'); error('TODO : ctranspose is not yet implemented for complex scalar Faust');
end end
end end
...@@ -228,7 +228,7 @@ classdef Faust ...@@ -228,7 +228,7 @@ classdef Faust
% %
error('conjugate is not yet implemented for Faust'); error('TODO : conjugate is not yet implemented for Faust');
end end
......
##########################################################################
######## README for developer ###########
######## FAuST Toolbox MATLAB wrapper ##########
######## Flexible Approximate Multi-Layer Sparse Transform ##########
##########################################################################
##########################################################################
General purpose :
The Matlab wrapper intefaces the Faust C++ with Python.
Which means that it delivered two package :
-the factorization algorithm (mexPalm4MSA and mexHierarchical_fact)
-the class Faust representing our new type of matrix
##########################################################################
Current state :
the Faust class currently support complex scalar,
the main built-in Matlab function are overloaded (mtimes, transposed, slicing ...)
However, the conjugate, conjugate-transposed is not implemented.
##########################################################################
File's Structure :
*****************
Main Files :
*****************
Faust.m :
--> this class represents the main class representing our new matrix type.
To have a good understanding of the different class structure,
see the diagram doc/diagram_class.png
setup_FAUST.m :
--> file that configure the Matlab path, access to demo files...
*****************
Sources Files (mexFunction):
*****************
src/mexFaust.cpp.in :
--> file where the C++ class Faust::Transform is interface with Matlab
WARNING : this file is configured into two files :
- mexFaustReal.cpp interfaces the class Faust::Transform<double> (i.e real scalar Faust)
- mexFaustCplx.cpp interfaces the class Faust::Transform<std::complex<double<> (i.e complex scalar Faust)
--> these 2 mexfunctions are directly used by FaustCore class (tools/FaustCore.m) and Faust.m
src/mexHierarchical_fact.cpp and mexpalm4MSA.cpp :
--> the 2 mexfunctions are used to factorize/decompose a matrix into a Faust
*****************
Tools directory (mexFunction):
*****************
tools/faust2Mx.h and faust2Mx.hpp :
--> C++ header files : here are all the C++ functions useful to convert
the C++ Faust objects (Matrices ...) into a Matlab object
tools/mx2Faust.h and tools/mx2Faust.hpp :
--> C++ header files : here are all the C++ functions useful to convert
a Matlab object (Matrices ...) into C++ Faust objects
tools/FaustCore.m :
--> this Matlab class wrap the C++ mexfunctions mexFaustReal and mexFaustReal
This class should not be used directly by the user.
It's only a purpose it's to inherited from Matlab built-in class handle
which allows different object to have the same reference.
(https://fr.mathworks.com/help/matlab/handle-classes.html)
In particular, this means that the operator = for this class doesn't copy the memory.
If we have 2 objects FaustCore A and B, A=B,
A and B share the same memory, so the operation = is faster.
To have a good understanding of the different class structure,
see the diagram doc/diagram_class.png
tools/class_handle.hpp :
--> C++ header file : file useful from wrapping an underlying C++ class into matlab
WARNING : with recent version of gcc, it can generate compile error
tools/faust_decompose.m and generate_params.m (beta version) :
--> 2 Matlab functions are useful to simplify the use of the factorization algorithm hierarchical_fact
--> in particular decompose a matrix into a Faust, the only input information needed is
the matrix to be factorized, the number of factors, the RCG (Rational Complexity Gain)
*******************
Other directories :
*******************
The directory GUI/ is where the Matlab documentation of the factorization algorithm is (cf mexpalm4MSA.m and mexHierarchical_fact.m)
The directory old_matlab/ is where all the pure Matlab factorization algorithm are stored. It's only useful to make comparison for the test with the mexfunction factorization algorithm.
##########################################################################
License:
Copyright (2016): Luc Le Magoarou, Remi Gribonval,
Nicolas Bellot, Adrien Leman, Thomas Gautrais
INRIA Rennes, FRANCE
http://www.inria.fr/
The FAuST Toolbox is distributed under the terms of the GNU Affero General
Public License.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
##########################################################################
##########################################################################
Contacts:
Luc Le Magoarou: luc.le-magoarou@inria.fr
Remi Gribonval : remi.gribonval@inria.fr
Nicolas Bellot : nicolas.bellot@inria.fr
Adrien Leman : adrien.leman@inria.fr
Thomas Gautrais : thomas.gautrais@inria.fr
##########################################################################
##########################################################################
References:
[1] Le Magoarou L. and Gribonval R., "Flexible multi-layer sparse
approximations of matrices and applications", Journal of Selected
Topics in Signal Processing, 2016.
<https://hal.archives-ouvertes.fr/hal-01167948v1>
##########################################################################
wrapper/matlab/doc/diagram_class.png

18.4 KiB

File moved
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
#ifndef __MACH__ #ifndef __MACH__
// WARNING :
// with the recent version of gcc
// this 2 definition can cause compile error of redefinition,
// in this case, comment the 2 following lines
typedef unsigned long int uint32_t; typedef unsigned long int uint32_t;
typedef unsigned long long int uint64_t; typedef unsigned long long int uint64_t;
#endif #endif
......
...@@ -34,7 +34,7 @@ File's Structure : ...@@ -34,7 +34,7 @@ File's Structure :
Main Files : Main Files :
***************** *****************
src/FaustPy.py : FaustPy.py :
--> this python module is directly utilised by the user. --> this python module is directly utilised by the user.
It allows the handling of FaustPy.Faust class representing our type of matrices It allows the handling of FaustPy.Faust class representing our type of matrices
...@@ -51,6 +51,9 @@ setup.py.in : ...@@ -51,6 +51,9 @@ setup.py.in :
(which consists in only one class FaustCorePy.FaustCore) (which consists in only one class FaustCorePy.FaustCore)
This class is used by the FaustPy.Faust class This class is used by the FaustPy.Faust class
quickstart.py :
--> Little demo to illustrate the behaviour of the class FaustPy.Faust
***************** *****************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment