Mentions légales du service

Skip to content
Snippets Groups Projects
Commit e10cf343 authored by hhakim's avatar hhakim
Browse files

Rename mexsvdtjReal to mexsvdtjdouble and mexsvdtjRealFloat to mexsvdtjfloat...

Rename mexsvdtjReal to mexsvdtjdouble and mexsvdtjRealFloat to mexsvdtjfloat because both of them handle complex too.
parent 8a2e8a71
No related branches found
No related tags found
No related merge requests found
......@@ -168,11 +168,11 @@ function [V,D] = eigtj(M, varargin)
nGivens_per_fac = min(nGivens_per_fac, nGivens);
end
if(strcmp(class(M), 'single'))
[core_obj, D] = mexfgftgivensRealFloat(M, nGivens, nGivens_per_fac, verbosity, tol, relerr, order, enable_large_Faust, err_period);
[core_obj, D] = mexfgftgivensfloat(M, nGivens, nGivens_per_fac, verbosity, tol, relerr, order, enable_large_Faust, err_period);
D = sparse(diag(real(double(D))));
V = Faust(core_obj, isreal(M), 'cpu', 'float');
else
[core_obj, D] = mexfgftgivensReal(M, nGivens, nGivens_per_fac, verbosity, tol, relerr, order, enable_large_Faust, err_period);
[core_obj, D] = mexfgftgivensdouble(M, nGivens, nGivens_per_fac, verbosity, tol, relerr, order, enable_large_Faust, err_period);
D = sparse(diag(real(D)));
V = Faust(core_obj, isreal(M));
end
......
......@@ -268,18 +268,18 @@ function [U,S,V] = svdtj(M, varargin)
mex_args = {M, nGivens(1), nGivens(2), nGivens_per_fac(1), nGivens_per_fac(2), verbosity, tol, relerr, order, enable_large_Faust, err_period};
if isreal(M)
if(strcmp(class(M), 'single'))
[core_obj1, S, core_obj2] = mexsvdtjRealFloat(mex_args{:});
[core_obj1, S, core_obj2] = mexsvdtjfloat(mex_args{:});
S = spdiags(double(S), 0, size(M, 1), size(M, 2)); % matlab doesn't support single precision sparse matrix
U = Faust(core_obj1, isreal(M), 'cpu', 'float');
V = Faust(core_obj2, isreal(M), 'cpu', 'float');
else
[core_obj1, S, core_obj2] = mexsvdtjReal(mex_args{:});
[core_obj1, S, core_obj2] = mexsvdtjdouble(mex_args{:});
S = spdiags(double(S), 0, size(M, 1), size(M, 2));
U = Faust(core_obj1, isreal(M));
V = Faust(core_obj2, isreal(M));
end
else % M is complex
[core_obj1, S, core_obj2] = mexsvdtjReal(mex_args{:});
[core_obj1, S, core_obj2] = mexsvdtjdouble(mex_args{:});
S = spdiags(S, 0, size(M, 1), size(M, 2));
U = Faust(core_obj1, isreal(M), 'cpu', 'double', true);
V = Faust(core_obj2, isreal(M), 'cpu', 'double', true);
......
......@@ -157,16 +157,16 @@ foreach(SCALAR_AND_FSUFFIX IN LISTS MEX_TYPES_AND_SUFFIXES) # TODO: complex<floa
# Truncated Jacobi eigtj and svdtj
if(NOT ${FAUST_SCALAR} MATCHES "complex")
configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexfgftgivens.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexfgftgivens${FSUFFIX}.cpp @ONLY)
configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexsvdtj.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexsvdtj${FSUFFIX}.cpp @ONLY)
configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexfgftgivens.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexfgftgivens${SCALAR}.cpp @ONLY)
configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexsvdtj.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexsvdtj${SCALAR}.cpp @ONLY)
endif()
# copy the *.m for factorization now, because we have the FSUFFIX in hands
configure_file(${FAUST_MATLAB_DOC_SRC_DIR}/mexHierarchical_fact.m.in ${FAUST_MATLAB_DOC_SRC_DIR}/mexHierarchical_fact${FSUFFIX}.m COPYONLY)
configure_file(${FAUST_MATLAB_DOC_SRC_DIR}/mexPalm4MSA.m.in ${FAUST_MATLAB_DOC_SRC_DIR}/mexPalm4MSA${FSUFFIX}.m COPYONLY)
configure_file(${FAUST_MATLAB_DOC_SRC_DIR}/mexButterfly.m.in ${FAUST_MATLAB_DOC_SRC_DIR}/mexButterfly${FSUFFIX}.m @ONLY)
if(NOT ${FAUST_SCALAR} MATCHES "complex")
configure_file(${FAUST_MATLAB_DOC_SRC_DIR}/mexfgftgivens.m.in ${FAUST_MATLAB_DOC_SRC_DIR}/mexfgftgivens${FSUFFIX}.m COPYONLY)
configure_file(${FAUST_MATLAB_DOC_SRC_DIR}/mexsvdtj.m.in ${FAUST_MATLAB_DOC_SRC_DIR}/mexsvdtj${FSUFFIX}.m COPYONLY)
configure_file(${FAUST_MATLAB_DOC_SRC_DIR}/mexfgftgivens.m.in ${FAUST_MATLAB_DOC_SRC_DIR}/mexfgftgivens${SCALAR}.m COPYONLY)
configure_file(${FAUST_MATLAB_DOC_SRC_DIR}/mexsvdtj.m.in ${FAUST_MATLAB_DOC_SRC_DIR}/mexsvdtj${SCALAR}.m COPYONLY)
endif()
configure_file(${FAUST_MATLAB_MEX_SRC_DIR}/mexPoly.cpp.in ${FAUST_MATLAB_MEX_SRC_DIR}/mexPoly${FSUFFIX}.cpp @ONLY)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment