本文整理汇总了C++中GeneralMatrix::Ncols方法的典型用法代码示例。如果您正苦于以下问题:C++ GeneralMatrix::Ncols方法的具体用法?C++ GeneralMatrix::Ncols怎么用?C++ GeneralMatrix::Ncols使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GeneralMatrix
的用法示例。
在下文中一共展示了GeneralMatrix::Ncols方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tr
void GetSubMatrix::operator-=(const BaseMatrix& bmx)
{
REPORT
Tracer tr("SubMatrix(-=)"); GeneralMatrix* gmx = 0;
// MatrixConversionCheck mcc; // Check for loss of info
Try
{
SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate();
if (row_number != gmx->Nrows() || col_number != gmx->Ncols())
Throw(IncompatibleDimensionsException());
MatrixRow mrx(gmx, LoadOnEntry);
MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip);
// do need LoadOnEntry
MatrixRowCol sub; int i = row_number;
while (i--)
{
mr.SubRowCol(sub, col_skip, col_number); // put values in sub
sub.Check(mrx); // check for loss of info
sub.Sub(mrx); mr.Next(); mrx.Next();
}
gmx->tDelete();
#ifdef TEMPS_DESTROYED_QUICKLY
delete this;
#endif
}
CatchAll
{
if (gmx) gmx->tDelete();
#ifdef TEMPS_DESTROYED_QUICKLY
delete this;
#endif
ReThrow;
}
}
示例2: tr
void GetSubMatrix::operator-=(const BaseMatrix& bmx)
{
REPORT
Tracer tr("SubMatrix(-=)"); GeneralMatrix* gmx = 0;
// MatrixConversionCheck mcc; // Check for loss of info
Try
{
SetUpLHS(); gmx = ((BaseMatrix&)bmx).Evaluate();
if (row_number != gmx->Nrows() || col_number != gmx->Ncols())
Throw(IncompatibleDimensionsException());
if (gm->type().is_symmetric() &&
( ! gmx->type().is_symmetric() || row_skip != col_skip) )
Throw(ProgramException("Illegal operation on symmetric"));
MatrixRow mrx(gmx, LoadOnEntry);
MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip);
// do need LoadOnEntry
MatrixRowCol sub; int i = row_number;
while (i--)
{
mr.SubRowCol(sub, col_skip, col_number); // put values in sub
sub.Check(mrx); // check for loss of info
sub.Sub(mrx); mr.Next(); mrx.Next();
}
gmx->tDelete();
}
CatchAll
{
if (gmx) gmx->tDelete();
ReThrow;
}
}
示例3: MatrixDetails
static void MatrixDetails(const GeneralMatrix& A)
// write matrix details to Exception buffer
{
MatrixBandWidth bw = A.BandWidth(); int ubw = bw.upper; int lbw = bw.lower;
Exception::AddMessage("MatrixType = ");
Exception::AddMessage(A.Type().Value());
Exception::AddMessage(" # Rows = "); Exception::AddInt(A.Nrows());
Exception::AddMessage("; # Cols = "); Exception::AddInt(A.Ncols());
if (lbw >=0)
{ Exception::AddMessage("; lower BW = "); Exception::AddInt(lbw); }
if (ubw >=0)
{ Exception::AddMessage("; upper BW = "); Exception::AddInt(ubw); }
Exception::AddMessage("\n");
}
示例4: inject
void GetSubMatrix::inject(const GeneralMatrix& gmx)
{
REPORT
Tracer tr("SubMatrix(inject)");
SetUpLHS();
if (row_number != gmx.Nrows() || col_number != gmx.Ncols())
Throw(IncompatibleDimensionsException());
MatrixRow mrx((GeneralMatrix*)(&gmx), LoadOnEntry);
MatrixRow mr(gm, LoadOnEntry+StoreOnExit+DirectPart, row_skip);
// do need LoadOnEntry
MatrixRowCol sub; int i = row_number;
while (i--)
{
mr.SubRowCol(sub, col_skip, col_number); // put values in sub
sub.Inject(mrx); mr.Next(); mrx.Next();
}
}