SparseGenMatrix::SparseGenMatrix( int rows, int cols, int nnz,
                                  int krowM[], int jcolM[],  double M[],
                                  int deleteElts)
    : m_Mt(NULL)
{
    //cout << "SparseGenMatrix1  " << rows << " " << cols << " " << nnz << endl;
    mStorage = SparseStorageHandle( new SparseStorage( rows, cols,nnz,
                                    krowM, jcolM, M,
                                    deleteElts) );
}
Exemple #2
0
//public Ma57Solver::Ma57Solver( SparseSymMatrix * sgm, const int numOfNegEigVal_in ):this(sgm){}; 
void Ma57Solver::SetUpMa57Solver( SparseSymMatrix * sgm )
{
  irowM = 0;
  jcolM = 0;
  fact  = 0;
  ifact = 0;
  keep  = 0;

  iworkn  = NULL; dworkn = NULL;
  niworkn = ndworkn = 0;
 
  ipessimism = 1.05;
  rpessimism = 1.05;

  FNAME(ma57id)( cntl, icntl );
  icntl[1-1] = 0;	   // don't print warning messages
  icntl[2-1] = 0;	   // no Warning messages
  icntl[4-1] = 1;	   // no statistics messages
  icntl[5-1] = 0;	   // no Print messages.

  icntl[6-1] = gMA57_Ordering; // 4 use Metis; 5 automatic choice(MA47 or Metis); 3 min
	      // degree ordering as in MA27; 2 use MC47;  
  icntl[7-1] = 1;      /* Pivoting strategy. */

  icntl[9-1] = 10; // up to 10 steps of iterative refinement
  icntl[11-1] = 16;
  icntl[12-1] = 16; 

  icntl[15-1] = 1;
  icntl[16-1] = 0;

  setValTreatAsZero(1.e-20);

  // set initial value of Threshold parameter
  setPivotTol(gHSL_PivotLV);


  // set the required precision for each linear system solve
  kPrecision = 1.e-9;

  mStorage = SparseStorageHandle( sgm->getStorage() );
  n        = mStorage->n;

  if (gOuterSolve >=3 && separateHandDiag==1){
  	nnz = mStorage->krowM[n] + n;
	M   = new double[nnz];
	memcpy( &M[0], &mStorage->M[0],  mStorage->krowM[n] * sizeof( double ) );
	memcpy( &M[mStorage->krowM[n]], &mStorage->additiveDiag[0], n * sizeof( double ) );
  }else {
	nnz = mStorage->krowM[n];
	M	= mStorage->M;	
  }
  
}
Exemple #3
0
Ma57Solver::Ma57Solver( SparseSymMatrix * sgm )
{
  irowM = 0;
  jcolM = 0;
  fact  = 0;
  ifact = 0;
  keep  = 0;

  iworkn  = NULL; dworkn = NULL;
  niworkn = ndworkn = 0;
 
  ipessimism = 1.4;
  rpessimism = 1.4;

  FNAME(ma57id)( cntl, icntl );
  //icntl[1] = -1; // don't print warning messages
  icntl[8] = 10; // up to 10 steps of iterative refinement
  icntl[5] = 5; // 4 use Metis; 5 automatic choice(MA47 or Metis); 3 min
	      // degree ordering as in MA27; 2 use MC47;  

  // set initial value of "Treat As Zero" parameter
  kTreatAsZero = 1.e-10;      this->setTreatAsZero();

  // set initial value of Threshold parameter
  kThresholdPivoting = 1.e-5; this->setThresholdPivoting();

  // set the largest value of ThresholdPivoting parameter we are
  // willing to tolerate.
  kThresholdPivotingMax = 1.e-1;

  // set the increase factor for ThresholdPivoting parameter
  kThresholdPivotingFactor = 10.0;

  // set the required precision for each linear system solve
  kPrecision = 1.e-9;

  mStorage = SparseStorageHandle( sgm->getStorage() );
  n        = mStorage->n;
  M        = mStorage->M;

  nnz = mStorage->krowM[n];

  //!
  ma27=new Ma27Solver(sgm);
  sgm_=sgm;

}
Ma57Solver::Ma57Solver( SparseSymMatrix * sgm )
{
    irowM = 0;
    jcolM = 0;
    fact  = 0;
    ifact = 0;
    keep  = 0;

    ipessimism = 1.2;
    rpessimism = 1.2;

    ma57id_( cntl, icntl );
    icntl[1] = -1; // don't print warning messages
    icntl[8] = 10; // up to 10 steps of iterative refinement

    // set initial value of "Treat As Zero" parameter
    kTreatAsZero = 1.e-10;
    this->setTreatAsZero();

    // set initial value of Threshold parameter
    kThresholdPivoting = 1.e-8;
    this->setThresholdPivoting();

    // set the largest value of ThresholdPivoting parameter we are
    // willing to tolerate.
    kThresholdPivotingMax = 1.e-2;

    // set the increase factor for ThresholdPivoting parameter
    kThresholdPivotingFactor = 10.0;

    // set the required precision for each linear system solve
    kPrecision = 1.e-7;

    mStorage = SparseStorageHandle( sgm->getStorage() );
    n        = mStorage->n;
    M        =  mStorage->M;

    nnz = mStorage->krowM[n];
}
SparseGenMatrix::SparseGenMatrix( int rows, int cols, int nnz )
    : m_Mt(NULL)
{
    mStorage = SparseStorageHandle( new SparseStorage( rows, cols, nnz ) );
}