本文整理汇总了C++中QVec::getWriteData方法的典型用法代码示例。如果您正苦于以下问题:C++ QVec::getWriteData方法的具体用法?C++ QVec::getWriteData怎么用?C++ QVec::getWriteData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QVec
的用法示例。
在下文中一共展示了QVec::getWriteData方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: R
QMat RMat::QMat::eigenValsVectors ( QVec & vals )
{
if ( isSquare() and ( vals.size() ==cols ) )
{
QMat R ( rows,cols,0.);
#ifdef COMPILE_IPP
T valsIm[cols];
int SizeBytes;
ippmEigenValuesVectorsGetBufSize_32f(cols, &SizeBytes);
Ipp8u pBuffer[SizeBytes];
IppStatus status = ippmEigenValuesVectorsRight_m_32f (toData(), cols*sizeof(T), sizeof(T), R.toData(), cols*sizeof(T), sizeof(T), vals.getWriteData(),valsIm, cols, pBuffer);
if ( status == ippStsNoErr )
return R;
else
{
printf ( "EigenValsVectors error: %d, %s\n", status, ippGetStatusString ( status ) );
( *this ).print ( "this" );
QString s="QMat::eigenVectors() - Error returned by IPP"; throw s;
}
#else
// qFatal("eigen values using Eigen has not been properly tested yet");
double data[this->getDataSize()];
const T *dataBuffer = this->getReadData();
for(int i = 0; i < this->getDataSize(); i++)
data[i] = (double)dataBuffer[i];
gsl_matrix_view m = gsl_matrix_view_array (data, rows,rows);
gsl_vector *eval = gsl_vector_alloc (rows);
gsl_matrix *evec = gsl_matrix_alloc (rows, rows);
gsl_eigen_symmv_workspace * w = gsl_eigen_symmv_alloc (rows);
gsl_eigen_symmv (&m.matrix, eval, evec, w);
gsl_eigen_symmv_free (w);
gsl_eigen_symmv_sort (eval, evec, GSL_EIGEN_SORT_ABS_DESC);
for(int i=0;i<rows;i++)
vals(i) = gsl_vector_get(eval,i);
QMat P(evec);
gsl_vector_free (eval);
gsl_matrix_free (evec);
return P;
#endif
}
QString s="QMat::EigenValsVectors() - Not Square Matrix"; throw s;
return QMat();
}