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.3.
Show more breadcrumbs
faust group
faust
Commits
d634ebf9
Commit
d634ebf9
authored
3 years ago
by
hhakim
Browse files
Options
Downloads
Patches
Plain Diff
Fix mexsvdtj (template) compiling error (issue #217).
parent
77e4d815
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wrapper/matlab/src/mexsvdtj.cpp.in
+14
-13
14 additions, 13 deletions
wrapper/matlab/src/mexsvdtj.cpp.in
with
14 additions
and
13 deletions
wrapper/matlab/src/mexsvdtj.cpp.in
+
14
−
13
View file @
d634ebf9
...
...
@@ -51,13 +51,14 @@
#include <stdexcept>
typedef @FAUST_SCALAR@ SCALAR;
typedef @FACT_FPP@ FPP2;
//typedef complex<SCALAR> CPLX_SCALAR; // re-enable if one day complex<float> is supported
typedef complex<double> CPLX_SCALAR;
using namespace Faust;
//void svdtj_cplx(const mxArray* matlab_matrix, int J, int t, double tol, unsigned int verbosity, bool relErr, int order, const bool enable_large_Faust mxArray **plhs);
void svdtj(const mxArray* matlab_matrix, int J, int t,
double
tol, unsigned int verbosity, bool relErr, int order, const bool enable_large_Faust, mxArray **plhs);
void svdtj(const mxArray* matlab_matrix, int J, int t,
Real<SCALAR>
tol, unsigned int verbosity, bool relErr, int order, const bool enable_large_Faust, mxArray **plhs);
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{
...
...
@@ -65,7 +66,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
int J;
int t = 1; // default value for non-parallel Givens FGFT
unsigned int verbosity = 0; //default verbosity (no info. displayed)
double
tol = 0;
Real<SCALAR>
tol = 0;
bool relErr = true;
int order = -1;
bool enable_large_Faust = false;
...
...
@@ -79,7 +80,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
if(nrhs >= 4)
verbosity = (int) mxGetScalar(prhs[3]);
if(nrhs >= 5)
tol = (
double
) mxGetScalar(prhs[4]);
tol = (
Real<SCALAR>
) mxGetScalar(prhs[4]);
if(nrhs >= 6)
relErr = (bool) mxGetScalar(prhs[5]);
if(nrhs >= 7)
...
...
@@ -97,16 +98,16 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
}
void svdtj(const mxArray* matlab_matrix, int J, int t,
double
tol, unsigned int verbosity, bool relErr, int order, const bool enable_large_Faust, mxArray **plhs)
void svdtj(const mxArray* matlab_matrix, int J, int t,
Real<SCALAR>
tol, unsigned int verbosity, bool relErr, int order, const bool enable_large_Faust, mxArray **plhs)
{
Faust::MatDense<SCALAR,Cpu> dM;
Faust::MatSparse<SCALAR,Cpu> sM;
TransformHelper<SCALAR,Cpu> *U = nullptr, *V = nullptr;
Faust::Vect<SCALAR,Cpu>* S;
Faust::MatDense<
complex<
SCALAR
>
,Cpu> dM_cplx;
Faust::MatSparse<
complex<
SCALAR
>
,Cpu> sM_cplx;
TransformHelper<
complex<
SCALAR
>
,Cpu> *U_cplx = nullptr, *V_cplx = nullptr;
Faust::Vect<
complex<
SCALAR
>
,Cpu>* S_cplx;
Faust::MatDense<
CPLX_
SCALAR,Cpu> dM_cplx;
Faust::MatSparse<
CPLX_
SCALAR,Cpu> sM_cplx;
TransformHelper<
CPLX_
SCALAR,Cpu> *U_cplx = nullptr, *V_cplx = nullptr;
Faust::Vect<
CPLX_
SCALAR,Cpu>* S_cplx;
Faust::BlasHandle<Cpu> blas_handle;
Faust::SpBlasHandle<Cpu> spblas_handle;
...
...
@@ -120,17 +121,17 @@ void svdtj(const mxArray* matlab_matrix, int J, int t, double tol, unsigned int
if (mxIsSparse(matlab_matrix))
{
mxArray2FaustspMat(matlab_matrix,sM_cplx);
svdtj_cplx<
complex<
SCALAR
>
,Cpu,
FPP2
>(sM_cplx, J, t, tol, verbosity, relErr, order, enable_large_Faust, &U_cplx, &V_cplx, &S_cplx);
svdtj_cplx<
CPLX_
SCALAR,Cpu,
Real<CPLX_SCALAR>
>(sM_cplx, J, t, tol, verbosity, relErr, order, enable_large_Faust, &U_cplx, &V_cplx, &S_cplx);
}else
{
mxArray2FaustMat(matlab_matrix, dM_cplx);
svdtj_cplx<
complex<
SCALAR
>
,Cpu,
FPP2
>(dM_cplx, J, t, tol, verbosity, relErr, order, enable_large_Faust, &U_cplx, &V_cplx, &S_cplx);
svdtj_cplx<
CPLX_
SCALAR,Cpu,
Real<CPLX_SCALAR>
>(dM_cplx, J, t, tol, verbosity, relErr, order, enable_large_Faust, &U_cplx, &V_cplx, &S_cplx);
}
if(U_cplx != nullptr)
{
plhs[0] = convertPtr2Mat<Faust::TransformHelper<
complex<
SCALAR
>
, Cpu>>(U_cplx);
plhs[0] = convertPtr2Mat<Faust::TransformHelper<
CPLX_
SCALAR, Cpu>>(U_cplx);
plhs[1] = FaustVec2mxArray(*S_cplx);
plhs[2] = convertPtr2Mat<Faust::TransformHelper<
complex<
SCALAR
>
, Cpu>>(V_cplx);
plhs[2] = convertPtr2Mat<Faust::TransformHelper<
CPLX_
SCALAR, Cpu>>(V_cplx);
delete S_cplx; //allocated internally by Faust::svdtj
}
...
...
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