本文整理汇总了C++中DoubleMatrix::fromGetDense方法的典型用法代码示例。如果您正苦于以下问题:C++ DoubleMatrix::fromGetDense方法的具体用法?C++ DoubleMatrix::fromGetDense怎么用?C++ DoubleMatrix::fromGetDense使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DoubleMatrix
的用法示例。
在下文中一共展示了DoubleMatrix::fromGetDense方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: atPutSubmatrix
void DenseGenMatrix::atPutSubmatrix( int destRow, int destCol,
DoubleMatrix & Mat,
int srcRow, int srcCol,
int rowExtent, int colExtent )
{
int m = mStorage->m, n = mStorage->n;
double ** M = mStorage->M;
assert( destRow >= 0 && destRow + rowExtent <= m );
assert( destCol >= 0 && destCol + colExtent <= n );
// If assertions are turned off, clip to the actual size of this matrix
destRow = ( destRow >= 0 ) ? destRow : 0;
destCol = ( destCol >= 0 ) ? destCol : 0;
rowExtent = ( destRow + rowExtent <= m ) ? rowExtent : m - destRow;
colExtent = ( destCol + colExtent <= n ) ? colExtent : n - destCol;
Mat.fromGetDense( srcRow, srcCol, &M[destRow][destCol], n,
rowExtent, colExtent );
}
示例2: symAtPutSubmatrix
void DenseSymMatrix::symAtPutSubmatrix( int destRow, int destCol,
DoubleMatrix& Mat,
int srcRow, int srcCol,
int rowExtent, int colExtent,
int forceSymUpdate)
{
if(forceSymUpdate==0) {
symAtPutSubmatrix(destRow, destCol,
Mat, srcRow, srcCol, rowExtent, colExtent);
return;
}
int m = mStorage->m, n = mStorage->n;
double ** M = mStorage->M;
assert( destRow >= 0 && destRow + rowExtent <= m );
assert( destCol >= 0 && destCol + colExtent <= n );
// If assertions are turned off, clip to the actual size of this matrix
destRow = ( destRow >= 0 ) ? destRow : 0;
destCol = ( destCol >= 0 ) ? destCol : 0;
rowExtent = ( destRow + rowExtent <= m ) ? rowExtent : m - destRow;
colExtent = ( destCol + colExtent <= n ) ? colExtent : n - destCol;
Mat.fromGetDense( srcRow, srcCol, &M[destRow][destCol], n,
rowExtent, colExtent );
//!exec
for(int i=destRow; i<destRow + rowExtent; i++) {
for(int j=destCol; j<destCol + colExtent; j++) {
M[j][i] = M[i][j];
}
}
}