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
526b43f2
Commit
526b43f2
authored
8 years ago
by
Nicolas Bellot
Committed by
hhakim
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
wrapper matlab : save a transposed faust
parent
b2914171
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
misc/test/src/test_matlab_faust.m
+49
-25
49 additions, 25 deletions
misc/test/src/test_matlab_faust.m
wrapper/matlab/tools/Faust.m
+1
-2
1 addition, 2 deletions
wrapper/matlab/tools/Faust.m
wrapper/matlab/tools/FaustCore.m
+1
-1
1 addition, 1 deletion
wrapper/matlab/tools/FaustCore.m
with
51 additions
and
28 deletions
misc/test/src/test_matlab_faust.m
+
49
−
25
View file @
526b43f2
...
...
@@ -11,7 +11,8 @@ threshold = 10^(-5);
disp
(
'****** TEST MATLAB_FAUST ******* '
);
%% creation du faust
disp
(
' TEST CONSTRUCTOR : '
);
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
));
for
i
=
2
:
nb_fact
...
...
@@ -62,31 +63,7 @@ for i=1:nb_fact
end
disp
(
'Ok'
);
%% load_faust and save_faust test
disp
(
'TEST LOAD AND SAVE : '
);
filename
=
[
'@FAUST_BIN_TEST_OUTPUT_DIR@'
filesep
'faust.mat'
];
disp
([
'save faust into the file : '
filename
]);
save
(
F
,
filename
);
F_loaded
=
Faust
(
filename
);
[
dim1_loaded
,
dim2_loaded
]
=
size
(
F_loaded
);
if
(
dim1_loaded
~=
dim1
)
|
(
dim2_loaded
~=
dim2
)
error
(
'load and save faust : invalid dimension'
);
end
nb_fact_load
=
get_nb_factor
(
F
);
if
(
nb_fact_load
~=
nb_fact
)
error
(
'load and save faust : invalid number of factor of the loaded faust '
);
end
for
i
=
1
:
nb_fact
A
=
get_fact
(
F_loaded
,
i
);
if
(
A
~=
factors
{
i
})
error
(
'get_fact : invalid factor'
);
end
end
disp
(
'Ok'
);
%% get_product test
...
...
@@ -179,7 +156,54 @@ end
disp
(
'Ok'
);
%% load_faust and save_faust test
disp
(
'TEST LOAD AND SAVE : '
);
filename
=
[
'@FAUST_BIN_TEST_OUTPUT_DIR@'
filesep
'faust.mat'
];
disp
([
'save faust into the file : '
filename
]);
save
(
F
,
filename
);
F_loaded
=
Faust
(
filename
)
[
dim1_loaded
,
dim2_loaded
]
=
size
(
F_loaded
);
if
(
dim1_loaded
~=
dim1
)
|
(
dim2_loaded
~=
dim2
)
error
(
'load and save faust : invalid dimension'
);
end
nb_fact_load
=
get_nb_factor
(
F
);
if
(
nb_fact_load
~=
nb_fact
)
error
(
'load and save faust : invalid number of factor of the loaded faust '
);
end
for
i
=
1
:
nb_fact
A
=
get_fact
(
F_loaded
,
i
);
if
(
A
~=
factors
{
i
})
error
(
'get_fact : invalid factor'
);
end
end
filename_trans
=
[
'@FAUST_BIN_TEST_OUTPUT_DIR@'
filesep
'faust_trans.mat'
];
disp
([
'save transposed faust into the file : '
filename_trans
]);
save
(
F_trans
,
filename_trans
);
F_trans_loaded
=
Faust
(
filename_trans
)
[
dim1_trans_faust_loaded
,
dim2_trans_faust_loaded
]
=
size
(
F_trans_loaded
);
if
(
dim1_trans_faust_loaded
~=
dim2
)
|
(
dim2_trans_faust_loaded
~=
dim1
)
error
([
'save transposed : invalid dimension to the loaded-saved faust'
]);
end
F_dense_trans_loaded
=
get_product
(
F_trans_loaded
);
if
(
F_dense_trans_loaded
~=
F_dense
'
)
error
([
'save transposed : invalid faust'
]);
end
disp
(
'Ok'
);
%% slicing test
disp
(
'TEST SLICING : '
);
...
...
This diff is collapsed.
Click to expand it.
wrapper/matlab/tools/Faust.m
+
1
−
2
View file @
526b43f2
...
...
@@ -193,8 +193,7 @@ classdef Faust
for i=1:nb_fact
faust_factors{i}=get_fact(this,i);
end
transpose_flag=this.transpose_flag;
save(filename,'faust_factors','transpose_flag');
save(filename,'faust_factors');
end
...
...
This diff is collapsed.
Click to expand it.
wrapper/matlab/tools/FaustCore.m
+
1
−
1
View file @
526b43f2
...
...
@@ -23,7 +23,7 @@ classdef FaustCore < handle
if
(
nargin
==
1
)
&&
ischar
(
varargin
{
1
})
filename
=
varargin
{
1
};
load
(
filename
);
if
(
~
exist
(
'faust_factors'
,
'var'
)
||
~
exist
(
'transpose_flag'
,
'var'
)
)
if
(
~
exist
(
'faust_factors'
,
'var'
)
)
error
(
'Faust : invalid file'
);
end
this
=
FaustCore
(
faust_factors
);
...
...
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