Amesos Package Browser (Single Doxygen Collection) Development
Amesos_Control.cpp
Go to the documentation of this file.
00001 // @HEADER
00002 // ***********************************************************************
00003 //
00004 //                Amesos: Direct Sparse Solver Package
00005 //                 Copyright (2004) Sandia Corporation
00006 //
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 //
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00025 //
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #include "Amesos_Control.h"
00030 void Amesos_Control::SetControlParameters( const Teuchos::ParameterList &ParameterList) {
00031 
00032   // add zero to diagonal if diagonal element is not present
00033   // - not supported for matrices which are missing elements from the diagonal.  See bug #1928 for discussion
00034   if( ParameterList.isParameter("AddZeroToDiag") ) 
00035     AddZeroToDiag_ = ParameterList.get<bool>("AddZeroToDiag");
00036 
00037   // add this value to all diagonal elements which are structurally non-zero
00038   // no change is made to non-zero structure of the matrix.
00039   if( ParameterList.isParameter("AddToDiag") )
00040     AddToDiag_ = ParameterList.get<double>("AddToDiag");
00041 
00042   // Determine whether to Refactorize
00043   if( ParameterList.isParameter("Refactorize") )
00044     refactorize_ = ParameterList.get<bool>("Refactorize");
00045 
00046 
00047   // threshold for determining if refactorize worked OK
00048   // UNUSED at present - KSS June 2004
00049   if( ParameterList.isParameter("RcondThreshold") )
00050     rcond_threshold_ = ParameterList.get<double>("RcondThreshold");
00051 
00052   // define how many processes to use in the ScaLAPACK factor and solve
00053   // if (-1), a heuristic is used to determine the number of processes to use 
00054   if( ParameterList.isParameter("MaxProcs") )
00055     MaxProcesses_ = ParameterList.get<int>("MaxProcs");
00056   
00057   // Matrix property, defined internally in Amesos_Mumps as an integer,
00058   // whose value can be:
00059   // - 0 : general unsymmetric matrix;
00060   // - 1 : SPD;
00061   // - 2 : general symmetric matrix.
00062   if( ParameterList.isParameter("MatrixProperty") ) {
00063     std::string MatrixProperty;
00064     MatrixProperty = ParameterList.get<std::string>("MatrixProperty");
00065     if( MatrixProperty == "SPD" )
00066       MatrixProperty_ = 1;
00067     else if( MatrixProperty == "symmetric" ) 
00068       MatrixProperty_ = 2;
00069     else if( MatrixProperty == "general" )   
00070       MatrixProperty_ = 0;
00071     else {
00072       //      AMESOS_CHK_ERR( -1 ) ;
00073       //      if ( verbose_ ) std::cerr << "Amesos : ERROR" << std::endl 
00074       //       << "Amesos : MatrixProperty value not recognized ("
00075       //       << MatrixProperty << ")" << std::endl;
00076     }
00077   }
00078 
00079   // scaling method: 0: none, 1: use method's default, 2: use
00080   // the method's 1st alternative, 3: etc.
00081   if( ParameterList.isParameter("ScaleMethod") )
00082     ScaleMethod_ = ParameterList.get<int>("ScaleMethod");
00083 
00084 
00085   if( ParameterList.isParameter("Reindex") )
00086     Reindex_ = ParameterList.get<bool>("Reindex");
00087 
00088 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines