本文整理汇总了C++中GeneralMatrix::base方法的典型用法代码示例。如果您正苦于以下问题:C++ GeneralMatrix::base方法的具体用法?C++ GeneralMatrix::base怎么用?C++ GeneralMatrix::base使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeneralMatrix
的用法示例。
在下文中一共展示了GeneralMatrix::base方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SYLV_MES_EXCEPTION
void SqSylvMatrix::multInvLeft2(GeneralMatrix& a, GeneralMatrix& b,
double& rcond1, double& rcondinf) const
{
if (rows != a.numRows() || rows != b.numRows()) {
throw SYLV_MES_EXCEPTION("Wrong dimensions for multInvLeft2.");
}
// PLU factorization
Vector inv(data);
lapack_int * const ipiv = new lapack_int[rows];
lapack_int info;
lapack_int rows2 = rows;
dgetrf(&rows2, &rows2, inv.base(), &rows2, ipiv, &info);
// solve a
lapack_int acols = a.numCols();
double* abase = a.base();
dgetrs("N", &rows2, &acols, inv.base(), &rows2, ipiv,
abase, &rows2, &info);
// solve b
lapack_int bcols = b.numCols();
double* bbase = b.base();
dgetrs("N", &rows2, &bcols, inv.base(), &rows2, ipiv,
bbase, &rows2, &info);
delete [] ipiv;
// condition numbers
double* const work = new double[4*rows];
lapack_int* const iwork = new lapack_int[rows];
double norm1 = getNorm1();
dgecon("1", &rows2, inv.base(), &rows2, &norm1, &rcond1,
work, iwork, &info);
double norminf = getNormInf();
dgecon("I", &rows2, inv.base(), &rows2, &norminf, &rcondinf,
work, iwork, &info);
delete [] iwork;
delete [] work;
}