Mentions légales du service

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

bug Faust à 1 facteur solved

parent 9f60fac0
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,8 @@ if(BUILD_MATLAB_MEX_FILES)
add_test(NAME MATLAB_DEMO_INSTALL COMMAND ${FAUST_SRC_TEST_TOOL_DIR}/windows_test_matlab.bat "addpath('${CMAKE_INSTALL_MATLAB_PREFIX}')$setup_FAUST$run_all_demo$" "${FAUST_BIN_TEST_BIN_DIR}/MATLAB_DEMO_INSTALL")
add_test(NAME MATLAB_DEMO_BUILD COMMAND ${FAUST_SRC_TEST_TOOL_DIR}/windows_test_matlab.bat "addpath('${FAUST_MATLAB_BIN_DIR}')$setup_FAUST$run_all_demo$" "${FAUST_BIN_TEST_BIN_DIR}/MATLAB_DEMO_BUILD")
add_test(NAME MATLAB_FAUST_1 COMMAND ${FAUST_SRC_TEST_TOOL_DIR}/windows_test_matlab.bat "addpath('${FAUST_BIN_TEST_BIN_DIR}'@'${FAUST_BIN_TEST_TOOLS_DIR}')$set_path$test_matlab_faust$" "${FAUST_BIN_TEST_BIN_DIR}/MATLAB_FAUST_1")
add_test(NAME MATLAB_FAUST_CONFIG1 COMMAND ${FAUST_SRC_TEST_TOOL_DIR}/windows_test_matlab.bat "addpath('${FAUST_BIN_TEST_BIN_DIR}'@'${FAUST_BIN_TEST_TOOLS_DIR}')$set_path$test_matlab_faust(5@4@10@3)$" "${FAUST_BIN_TEST_BIN_DIR}/MATLAB_FAUST_1")
add_test(NAME MATLAB_FAUST_CONFIG2 COMMAND ${FAUST_SRC_TEST_TOOL_DIR}/windows_test_matlab.bat "addpath('${FAUST_BIN_TEST_BIN_DIR}'@'${FAUST_BIN_TEST_TOOLS_DIR}')$set_path$test_matlab_faust(2@15@1@1)$" "${FAUST_BIN_TEST_BIN_DIR}/MATLAB_FAUST_1")
# test the matlab Faust class methods with incorrect parameter
add_test(NAME MATLAB_FAUST_2 COMMAND ${FAUST_SRC_TEST_TOOL_DIR}/windows_test_matlab.bat "addpath('${FAUST_BIN_TEST_BIN_DIR}'@'${FAUST_BIN_TEST_TOOLS_DIR}')$set_path$test_matlab_faust2$" "${FAUST_BIN_TEST_BIN_DIR}/MATLAB_FAUST_2")
add_test(NAME MATLAB_FAUST_SPEED COMMAND ${FAUST_SRC_TEST_TOOL_DIR}/windows_test_matlab.bat "addpath('${FAUST_BIN_TEST_BIN_DIR}'@'${FAUST_BIN_TEST_TOOLS_DIR}')$set_path$test_matlab_faust_time$" "${FAUST_BIN_TEST_BIN_DIR}/MATLAB_FAUST_SPEED")
......@@ -75,7 +76,10 @@ if(BUILD_MATLAB_MEX_FILES)
add_test(NAME MATLAB_DEMO_INSTALL COMMAND matlab -nodesktop -r "try;testpass=0;addpath('${CMAKE_INSTALL_MATLAB_PREFIX}');setup_FAUST;run_all_demo;catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
add_test(NAME MATLAB_DEMO_BUILD COMMAND matlab -nodesktop -r "try;testpass=0;addpath('${FAUST_MATLAB_BIN_DIR}');setup_FAUST;run_all_demo;catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
add_test(NAME MATLAB_FAUST_1 COMMAND matlab -nojvm -r "try;testpass=0;addpath('${FAUST_BIN_TEST_BIN_DIR}','${FAUST_BIN_TEST_TOOLS_DIR}');set_path;test_matlab_faust;catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
add_test(NAME MATLAB_FAUST_CONFIG1 COMMAND matlab -nojvm -r "try;testpass=0;addpath('${FAUST_BIN_TEST_BIN_DIR}','${FAUST_BIN_TEST_TOOLS_DIR}');set_path;test_matlab_faust(5,4,10,3);catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
add_test(NAME MATLAB_FAUST_CONFIG2 COMMAND matlab -nojvm -r "try;testpass=0;addpath('${FAUST_BIN_TEST_BIN_DIR}','${FAUST_BIN_TEST_TOOLS_DIR}');set_path;test_matlab_faust(2,15,1,1);catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
#add_test(NAME MATLAB_FAUST_CONFIG_EMPTY COMMAND matlab -nojvm -r "try;testpass=0;addpath('${FAUST_BIN_TEST_BIN_DIR}','${FAUST_BIN_TEST_TOOLS_DIR}');set_path;test_matlab_faust(0,0,1,0);catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
## test the matlab Faust class methods with incorrect parameter
add_test(NAME MATLAB_FAUST_2 COMMAND matlab -nojvm -r "try;testpass=0;addpath('${FAUST_BIN_TEST_BIN_DIR}','${FAUST_BIN_TEST_TOOLS_DIR}');set_path;test_matlab_faust2;catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
add_test(NAME MATLAB_FAUST_SPEED COMMAND matlab -nojvm -r "try;testpass=0;addpath('${FAUST_BIN_TEST_BIN_DIR}','${FAUST_BIN_TEST_TOOLS_DIR}');set_path;test_matlab_faust_time;catch ME ;testpass=-1;disp(getReport(ME)); end ; exit(testpass)")
......@@ -89,7 +93,7 @@ if(BUILD_MATLAB_MEX_FILES)
#DEBUT MODIF NB VM MAC XCode
set_tests_properties(MATLAB_FACT_HIER_MEX MATLAB_FACT_HIER_MATLAB PROPERTIES TIMEOUT 100)
set_tests_properties(MATLAB_DEMO_INSTALL MATLAB_DEMO_BUILD PROPERTIES TIMEOUT 6000)
set_tests_properties(MATLAB_FAUST_1 MATLAB_FAUST_2 PROPERTIES TIMEOUT 30)
set_tests_properties(MATLAB_FAUST_CONFIG1 MATLAB_FAUST_CONFIG2 MATLAB_FAUST_2 PROPERTIES TIMEOUT 30)
set_tests_properties(MATLAB_FACT_MEG_MATLAB MATLAB_FACT_MEG_MEX PROPERTIES TIMEOUT ${TIMEOUT_MEG})
#FIN MODIF NB VM MAC XCode
endif()
......
%% Description test_matlab_faust
% This script tests the Faust class, i.e the different method
% This functions test different method
% overloaded for a faust (constructor, size, mtimes, mtimes_trans ...)
% with a given Faust
%
% input parameter : dim1 number of row of the Faust F
% dim2 number of column of the Faust F
% dim3 number of column of the matrix that will be multiplied by the Faust
% nb_fact number of factor of the Faust
%
%
%
%
% For more information on the FAuST Project, please visit the website of
% the project : <http://faust.gforge.inria.fr>
......@@ -40,25 +49,40 @@
%%
nb_fact = 3;
dim1 = 5;
dim2 = 4;
dim3 = 10;
%nb_fact = 3;
%dim1 = 5;
%dim2 = 4;
%dim3 = 10;
function test_matlab_faust(dim1,dim2,dim3,nb_fact)
int_max= 100;
threshold = 10^(-5);
disp('****** TEST MATLAB_FAUST ******* ');
disp(' CONFIG OF THE FAUST ');
disp(['number of row of the Faust : ' int2str(dim1)]);
disp(['number of column of the Faust : ' int2str(dim2)]);
disp(['number of factor of the Faust : ' int2str(nb_fact)]);
disp('');
disp(['number of column of the matrix that will be multiplied by the Faust : ' int2str(dim3)]);
disp('');
%% creation du faust
disp(' TEST CONSTRUCTOR : ');
disp(['generate a faust of size ' int2str(dim1) ' by ' int2str(dim2)]);
factors=cell(1,nb_fact);
factors{1}=double(randi(int_max,dim1,dim2));
if (nb_fact > 0)
factors{1}=double(randi(int_max,dim1,dim2));
end
for i=2:nb_fact
factors{i}=double(randi(int_max,dim2,dim2));
end
F = Faust(factors);
empty_F = Faust({});
empty_F=Faust({});
disp('Ok');
......
......@@ -180,7 +180,7 @@ template<typename FPP>
Faust::Transform<FPP,Cpu>::Transform(const std::vector<Faust::MatSparse<FPP,Cpu> > & facts, const FPP lambda_ /* =1.0 */) :
data(facts),
totalNonZeros(0)
{
{
for (int i=0 ; i<data.size() ; i++)
totalNonZeros += data[i].getNonZeros();
......@@ -198,7 +198,7 @@ template<typename FPP>
void Faust::Transform<FPP,Cpu>::check_factors_validity() const
{
if (size() > 0)
if (size() > 1)
{
for (int i=0;i<=size()-2;i++)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment