示例#1
0
void MatrixOps<T>::SetSubMatrix (const Matrix<T> *const matrix_dst, ssi_size_t start_dst, ssi_size_t start_src, MATRIX_DIMENSION dimension, ssi_size_t number, const Matrix<T> *const matrix_src) {

	switch (dimension) {
		case MATRIX_DIMENSION_ROW:
			SSI_ASSERT (matrix_dst->cols == matrix_src->cols);
			SetSubMatrix (matrix_dst, start_dst, 0, start_src, 0, number, matrix_dst->cols, matrix_src);
			break;
		case MATRIX_DIMENSION_COL:
			SSI_ASSERT (matrix_dst->rows == matrix_src->rows);
			SetSubMatrix (matrix_dst, 0, start_dst, 0, start_src, matrix_dst->rows, number, matrix_src);
			break;
	}
}
示例#2
0
void MatrixOps<T>::SetSubMatrix (const Matrix<T> *const matrix, ssi_size_t start, MATRIX_DIMENSION dimension, const Matrix<T> *const submatrix) {

	switch (dimension) {
		case MATRIX_DIMENSION_ROW:
			SSI_ASSERT (matrix->cols == submatrix->cols);
			SetSubMatrix (matrix, start, 0, submatrix);
			break;
		case MATRIX_DIMENSION_COL:
			SSI_ASSERT (matrix->rows == submatrix->rows);
			SetSubMatrix (matrix, 0, start, submatrix);
			break;
	}
}
示例#3
0
文件: cDMatrix.cpp 项目: cran/RHmm
void AddColRow(const cDVector& theColRow, cDMatrix& theMat) 
{
uint myNRow = theMat.GetNRows() ;
uint myNCol = theMat.GetNCols() ;
uint mySize = theColRow.GetSize() ;
	if ( (myNRow != myNCol) || (myNRow + 1 != mySize) )
		throw cOTError("Wrong sizes in AddColRow") ;
cDMatrix mySrcMatrix = theMat ;
	theMat.ReAlloc(mySize, mySize) ;
	SetSubMatrix(mySrcMatrix, 0, 0, theMat) ;
	for (register uint i = 0 ; i < mySize  ; i++)
		theMat[i][mySize-1] = theMat[mySize-1][i] = theColRow[i] ;
}
示例#4
0
void MatrixOps<T>::SetSubMatrix (const Matrix<T> *const matrix, ssi_size_t row, ssi_size_t col, const Matrix<T> *const submatrix) {

	SetSubMatrix (matrix, row, col, 0, 0, submatrix->rows, submatrix->cols, submatrix);
}