22 #define lapack_complex_double std::complex<double> 23 #define lapack_complex_float std::complex<float> 24 #define LAPACK_COMPLEX_CUSTOM 28 #include <rvapi_interface.h> 47 std::vector<double> ProSHADE_internal::ProSHADE_comparePairwise::getSingularValues (
unsigned int band,
52 double *singularValues =
new double[dim];
53 __extension__ std::complex<double> rotMatU[dim][dim];
54 __extension__ std::complex<double> rotMatV[dim][dim];
55 std::vector<double> ret;
59 std::complex<double> *matrixToDecompose =
new std::complex<double>[dim*dim];
60 for (
unsigned int rowIt = 0; rowIt < dim; rowIt++ )
62 for (
unsigned int colIt = 0; colIt < dim; colIt++ )
64 matrixToDecompose[(colIt*dim)+rowIt] = std::complex<double> ( this->_trSigmaEMatrix[band][rowIt][colIt][0],
65 this->_trSigmaEMatrix[band][rowIt][colIt][1] );
70 returnValue = LAPACKE_zgesdd ( LAPACK_COL_MAJOR,
'A', dim, dim, matrixToDecompose, dim, singularValues, *rotMatU, dim, *rotMatV, dim );
73 if ( returnValue != 0 )
75 std::cerr <<
"!!! ProSHADE ERROR !!! Complex Matrix SVD algorithm did not converge, cannot proceed!" << std::endl;
79 std::stringstream hlpSS;
80 hlpSS <<
"<font color=\"red\">" <<
"The LAPACK Complex Matrix SVD algorithm did not converge, cannot proceed with computation of Trace Sigma distances. This problem could be resolved by changing the resolution or not using the Trace Sigma distances; these are not good solutions, but they are all I have got right now." <<
"</font>";
81 rvapi_set_text ( hlpSS.str().c_str(),
95 for (
unsigned int iter = 0; iter < dim; iter++ )
97 ret.emplace_back ( singularValues[iter] );
101 delete[] singularValues;
102 delete[] matrixToDecompose;
122 std::vector<double> ProSHADE_internal::ProSHADE_compareOneAgainstAll::getSingularValues (
unsigned int strNo,
unsigned int band,
unsigned int dim,
ProSHADE::ProSHADE_settings* settings )
125 double *singularValues =
new double[dim];
126 __extension__ std::complex<double> rotMatU[dim][dim];
127 __extension__ std::complex<double> rotMatV[dim][dim];
128 std::vector<double> ret;
132 std::complex<double> *matrixToDecompose =
new std::complex<double>[dim*dim];
133 for (
unsigned int rowIt = 0; rowIt < dim; rowIt++ )
135 for (
unsigned int colIt = 0; colIt < dim; colIt++ )
137 matrixToDecompose[(colIt*dim)+rowIt] = std::complex<double> ( this->_EMatrices.at(strNo).at(band).at(rowIt).at(colIt)[0],
138 this->_EMatrices.at(strNo).at(band).at(rowIt).at(colIt)[1] );
143 returnValue = LAPACKE_zgesdd ( LAPACK_COL_MAJOR,
'A', dim, dim, matrixToDecompose, dim, singularValues, *rotMatU, dim, *rotMatV, dim );
146 if ( returnValue != 0 )
148 std::cerr <<
"!!! ProSHADE ERROR !!! Complex Matrix SVD algorithm did not converge, cannot proceed!" << std::endl;
152 std::stringstream hlpSS;
153 hlpSS <<
"<font color=\"red\">" <<
"The LAPACK Complex Matrix SVD algorithm did not converge, cannot proceed with computation of Trace Sigma distances. This problem could be resolved by changing the resolution or not using the Trace Sigma distances; these are not good solutions, but they are all I have got right now." <<
"</font>";
154 rvapi_set_text ( hlpSS.str().c_str(),
168 for (
unsigned int iter = 0; iter < dim; iter++ )
170 ret.emplace_back ( singularValues[iter] );
174 delete[] singularValues;
175 delete[] matrixToDecompose;
194 std::vector< std::vector< std::vector<double> > > ProSHADE_internal::ProSHADE_comparePairwise::getSingularValuesUandVMatrix ( std::vector< std::vector<double> > mat,
199 double *singularValues =
new double[dim];
200 __extension__ std::complex<double> rotMatU[dim][dim];
201 __extension__ std::complex<double> rotMatV[dim][dim];
202 std::vector< std::vector< std::vector<double> > > ret;
203 std::vector< std::vector<double> > retHlp;
204 std::vector<double> hlpVec;
208 std::complex<double> *matrixToDecompose =
new std::complex<double>[dim*dim];
209 for (
unsigned int rowIt = 0; rowIt < dim; rowIt++ )
211 for (
unsigned int colIt = 0; colIt < dim; colIt++ )
213 matrixToDecompose[(colIt*dim)+rowIt] = std::complex<double> ( mat.at(rowIt).at(colIt),
219 returnValue = LAPACKE_zgesdd ( LAPACK_COL_MAJOR,
'A', dim, dim, matrixToDecompose, dim, singularValues, *rotMatU, dim, *rotMatV, dim );
222 if ( returnValue != 0 )
224 std::cerr <<
"!!! ProSHADE ERROR !!! Complex Matrix SVD algorithm did not converge, cannot proceed!" << std::endl;
228 std::stringstream hlpSS;
229 hlpSS <<
"<font color=\"red\">" <<
"The LAPACK Complex Matrix SVD algorithm did not converge, cannot proceed with computation of Trace Sigma distances. This problem could be resolved by changing the resolution or not using the Trace Sigma distances; these are not good solutions, but they are all I have got right now." <<
"</font>";
230 rvapi_set_text ( hlpSS.str().c_str(),
244 for (
unsigned int iter = 0; iter < dim; iter++ ) { hlpVec.emplace_back ( 0.0 ); }
245 for (
unsigned int iter = 0; iter < dim; iter++ ) { retHlp.emplace_back ( hlpVec ); }
246 ret.emplace_back ( retHlp ); ret.emplace_back ( retHlp );
249 for (
unsigned int rowIt = 0; rowIt < dim; rowIt++ )
251 for (
unsigned int colIt = 0; colIt < dim; colIt++ )
253 ret.at(0).at(rowIt).at(colIt) = rotMatU[rowIt][colIt].real();
258 for (
unsigned int rowIt = 0; rowIt < dim; rowIt++ )
260 for (
unsigned int colIt = 0; colIt < dim; colIt++ )
262 ret.at(1).at(rowIt).at(colIt) = rotMatV[rowIt][colIt].real();
267 delete[] singularValues;
268 delete[] matrixToDecompose;
bool htmlReport
Should HTML report for the run be created?
The main header file containing all declarations the user of the library needs.
The main header file containing all declarations for the innter workings of the library.
int htmlReportLineProgress
Iterator for current HTML line in the progress bar.
This class stores all the settings and is passed to the executive classes instead of multitude of par...