Mentions légales du service

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

bug (resolu) transpose matlab mais (A'*x) lent par rapport a (trans_A=A';trans_A*x

parent bf381fe6
No related branches found
No related tags found
No related merge requests found
...@@ -217,7 +217,7 @@ end ...@@ -217,7 +217,7 @@ end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if isa(A,'float') P =@(z) A*z; Pt =@(z) A'*z; if isa(A,'float') P =@(z) A*z; Pt =@(z) A'*z;
elseif isobject(A) P =@(z) A*z; Pt =@(z) A'*z; elseif isobject(A) P =@(z) A*z; trans_A=A'; Pt =@(z) trans_A*z;%% modification nicolas bellot
elseif isa(A,'function_handle') elseif isa(A,'function_handle')
try try
if isa(Pt,'function_handle'); P=A; if isa(Pt,'function_handle'); P=A;
......
...@@ -52,9 +52,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) ...@@ -52,9 +52,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
std::vector<Faust::MatSparse<FFPP,Cpu> > vec_spmat; std::vector<Faust::MatSparse<FFPP,Cpu> > vec_spmat;
mwSize nb_element = mxGetNumberOfElements(prhs[1]); mwSize nb_element = mxGetNumberOfElements(prhs[1]);
if (nb_element == 0) if (nb_element != 0)
mexWarnMsgTxt("Empty cell array.");
else
{ {
mxArray * mxMat; mxArray * mxMat;
for (int i=0;i<nb_element;i++) for (int i=0;i<nb_element;i++)
...@@ -132,13 +130,9 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) ...@@ -132,13 +130,9 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{ {
// if (nlhs != 1)
// { if (nlhs > 1)
// (*core_ptr).transpose(); mexErrMsgTxt("transpose : too much output argument");
// }
// return;
if (nlhs != 1)
(*core_ptr).transpose();
else else
{ {
Faust::Transform<FFPP,Cpu>* F = new Faust::Transform<FFPP,Cpu>((*core_ptr)); Faust::Transform<FFPP,Cpu>* F = new Faust::Transform<FFPP,Cpu>((*core_ptr));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment