本文整理汇总了C++中BigMatrix::row_offset方法的典型用法代码示例。如果您正苦于以下问题:C++ BigMatrix::row_offset方法的具体用法?C++ BigMatrix::row_offset怎么用?C++ BigMatrix::row_offset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BigMatrix
的用法示例。
在下文中一共展示了BigMatrix::row_offset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SepMatrixAccessor
SepMatrixAccessor( BigMatrix &bm)
{
_ppMat = reinterpret_cast<T**>(bm.matrix());
_rowOffset = bm.row_offset();
_colOffset = bm.col_offset();
_totalRows = bm.nrow();
}
示例2: install
/* Pointer utility, returns a double pointer for either a BigMatrix or a
* standard R matrix.
*/
double *
make_double_ptr (SEXP matrix, SEXP isBigMatrix)
{
double *matrix_ptr;
if (LOGICAL_VALUE (isBigMatrix) == (Rboolean) TRUE) // Big Matrix
{
SEXP address = GET_SLOT (matrix, install ("address"));
BigMatrix *pbm =
reinterpret_cast < BigMatrix * >(R_ExternalPtrAddr (address));
if (!pbm)
return (NULL);
// Check that have acceptable big.matrix
if (pbm->row_offset () > 0 && pbm->ncol () > 1)
{
std::string errMsg =
string ("sub.big.matrix objects cannoth have row ") +
string
("offset greater than zero and number of columns greater than 1");
Rf_error (errMsg.c_str ());
return (NULL);
}
index_type offset = pbm->nrow () * pbm->col_offset ();
matrix_ptr = reinterpret_cast < double *>(pbm->matrix ()) + offset;
}
else // Regular R Matrix
{
matrix_ptr = NUMERIC_DATA (matrix);
}
return (matrix_ptr);
};
示例3: MatrixAccessor
MatrixAccessor( BigMatrix &bm )
{
_pMat = reinterpret_cast<T*>(bm.matrix());
_totalRows = bm.total_rows();
_totalCols = bm.total_columns();
_rowOffset = bm.row_offset();
_colOffset = bm.col_offset();
_nrow = bm.nrow();
_ncol = bm.ncol();
}