Mentions légales du service
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
faust
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
GitLab upgrade completed. Current version is 17.11.4.
Show more breadcrumbs
faust group
faust
Commits
f53067d6
Commit
f53067d6
authored
8 years ago
by
Nicolas Bellot
Committed by
hhakim
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
bug Faust à 1 facteur solved
parent
9f60fac0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
misc/test/CMakeLists.txt
+7
-3
7 additions, 3 deletions
misc/test/CMakeLists.txt
misc/test/src/test_matlab_faust.m
+31
-7
31 additions, 7 deletions
misc/test/src/test_matlab_faust.m
src/faust_linear_operator/CPU/faust_Transform.hpp
+2
-2
2 additions, 2 deletions
src/faust_linear_operator/CPU/faust_Transform.hpp
with
40 additions
and
12 deletions
misc/test/CMakeLists.txt
+
7
−
3
View file @
f53067d6
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
misc/test/src/test_matlab_faust.m
+
31
−
7
View file @
f53067d6
%% 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'
);
...
...
This diff is collapsed.
Click to expand it.
src/faust_linear_operator/CPU/faust_Transform.hpp
+
2
−
2
View file @
f53067d6
...
...
@@ -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
++
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment