本文整理汇总了C++中Matrix::GetNumberOfRows方法的典型用法代码示例。如果您正苦于以下问题:C++ Matrix::GetNumberOfRows方法的具体用法?C++ Matrix::GetNumberOfRows怎么用?C++ Matrix::GetNumberOfRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Matrix
的用法示例。
在下文中一共展示了Matrix::GetNumberOfRows方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: new_v
// Vector matrix multiplication
Vector operator *(const Vector& v, const Matrix& m){
int orig_size = v.GetSize();
assert(m.GetNumberOfRows() == orig_size);
int new_size = m.GetNumberOfCols();
Vector new_v(new_size);
for (int i=0; i<new_size; i++){
for (int j=0; j<orig_size; j++){
new_v[i] += v.Read(j)*m.mData[j][i];
}
}
return new_v;
}
示例2: assert
// Copy matrix and vector so that original matrix and vector
// specified are unchanged by Gaussian elimination
LinearSystem::LinearSystem(const Matrix& A, const Vector& b)
{
// check matrix and vector are of compatible sizes
int local_size = A.GetNumberOfRows();
assert(A.GetNumberOfColumns() == local_size);
assert(b.GetSize() == local_size);
// set variables for linear system
mSize = local_size;
mpA = new Matrix(A);
mpb = new Vector(b);
}
示例3:
//Copy
Matrix::Matrix(const Matrix& otherMatrix){
mNumRows = otherMatrix.GetNumberOfRows();
mNumCols = otherMatrix.GetNumberOfCols();
mData = new double*[mNumRows];
for(int i=0; i<mNumRows; i++){
mData[i] = new double [mNumCols];
}
for(int i=0; i<mNumRows; i++){
for(int j=0; j<mNumCols; j++){
mData[i][j] = otherMatrix.mData[i][j];
}
}
}