本文整理汇总了C++中Epetra_SerialDenseMatrix::M方法的典型用法代码示例。如果您正苦于以下问题:C++ Epetra_SerialDenseMatrix::M方法的具体用法?C++ Epetra_SerialDenseMatrix::M怎么用?C++ Epetra_SerialDenseMatrix::M使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Epetra_SerialDenseMatrix
的用法示例。
在下文中一共展示了Epetra_SerialDenseMatrix::M方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: identicalSignatures
//=========================================================================
// checks the signatures of two matrices
bool identicalSignatures(Epetra_SerialDenseMatrix& a, Epetra_SerialDenseMatrix& b, bool testLDA) {
if((a.M() != b.M() )|| // check properties first
(a.N() != b.N() )||
(a.CV() != b.CV() ))
return(false);
if(testLDA == true) // if we are coming from op= c->c #2 (have enough space)
if(a.LDA() != b.LDA()) // then we don't check LDA (but we do check it in the test function)
return(false);
if(a.CV() == View) { // if we're still here, we need to check the data
if(a.A() != b.A()) // for a view, this just means checking the pointers
return(false); // for a copy, this means checking each element
}
else { // CV == Copy
const int m = a.M();
const int n = a.N();
for(int i = 0; i < m; i++)
for(int j = 0; j < n; j++) {
if(a(i,j) != b(i,j))
return(false);
}
}
return(true); // if we're still here, signatures are identical
}
示例2: SetVectors
//=============================================================================
int Epetra_SerialDenseSVD::SetVectors(Epetra_SerialDenseMatrix & X_in, Epetra_SerialDenseMatrix & B_in)
{
if (B_in.M()!=X_in.M() || B_in.N() != X_in.N()) EPETRA_CHK_ERR(-1);
if (B_in.A()==0) EPETRA_CHK_ERR(-2);
if (B_in.LDA()<1) EPETRA_CHK_ERR(-3);
if (X_in.A()==0) EPETRA_CHK_ERR(-4);
if (X_in.LDA()<1) EPETRA_CHK_ERR(-5);
ResetVectors();
LHS_ = &X_in;
RHS_ = &B_in;
NRHS_ = B_in.N();
B_ = B_in.A();
LDB_ = B_in.LDA();
X_ = X_in.A();
LDX_ = X_in.LDA();
return(0);
}
示例3: ReplaceGlobalValues
int Epetra_FECrsMatrix::ReplaceGlobalValues(const Epetra_LongLongSerialDenseVector& indices,
const Epetra_SerialDenseMatrix& values,
int format)
{
if (indices.Length() != values.M() || indices.Length() != values.N()) {
return(-1);
}
return( ReplaceGlobalValues(indices.Length(), indices.Values(),
values.A(), format) );
}
示例4: seperateData
//=========================================================================
// checks if two matrices are independent or not
bool seperateData(Epetra_SerialDenseMatrix& a, Epetra_SerialDenseMatrix& b) {
bool seperate;
int r = EPETRA_MIN(a.M(),b.M()) / 2; // ensures (r,c) is valid
int c = EPETRA_MIN(a.N(),b.N()) / 2; // in both matrices
double orig_a = a(r,c);
double new_value = a(r,c) + 1;
if(b(r,c) == new_value) // there's a chance b could be independent, but
new_value++; // already have new_value in (r,c).
a(r,c) = new_value;
if(b(r,c) == new_value)
seperate = false;
else
seperate = true;
a(r,c) = orig_a; // undo change we made to a
return(seperate);
}
示例5: SetMatrix
//=============================================================================
int Epetra_SerialDenseSVD::SetMatrix(Epetra_SerialDenseMatrix & A_in) {
ResetMatrix();
Matrix_ = &A_in;
// Factor_ = &A_in;
M_ = A_in.M();
N_ = A_in.N();
Min_MN_ = EPETRA_MIN(M_,N_);
LDA_ = A_in.LDA();
// LDAF_ = LDA_;
A_ = A_in.A();
// AF_ = A_in.A();
return(0);
}