Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
Amesos2_Control.hpp
Go to the documentation of this file.
1 // @HEADER
2 //
3 // ***********************************************************************
4 //
5 // Amesos2: Templated Direct Sparse Solver Package
6 // Copyright 2011 Sandia Corporation
7 //
8 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
9 // the U.S. Government retains certain rights in this software.
10 //
11 // Redistribution and use in source and binary forms, with or without
12 // modification, are permitted provided that the following conditions are
13 // met:
14 //
15 // 1. Redistributions of source code must retain the above copyright
16 // notice, this list of conditions and the following disclaimer.
17 //
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice, this list of conditions and the following disclaimer in the
20 // documentation and/or other materials provided with the distribution.
21 //
22 // 3. Neither the name of the Corporation nor the names of the
23 // contributors may be used to endorse or promote products derived from
24 // this software without specific prior written permission.
25 //
26 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
27 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
30 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 //
38 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
39 //
40 // ***********************************************************************
41 //
42 // @HEADER
43 
51 #ifndef AMESOS2_CONTROL_HPP
52 #define AMESOS2_CONTROL_HPP
53 
54 #include <Teuchos_ParameterList.hpp>
55 #include <Teuchos_RCP.hpp>
56 
57 namespace Amesos2 {
58 
59 
60 struct Control {
62  Control()
63  : verbose_(0)
64  , debug_(0)
65  , useTranspose_(false)
66  , useIterRefine_(false)
67  , maxNumIterRefines_(2)
68  , verboseIterRefine_(false)
69  , addToDiag_("0.0")
70  , addZeroToDiag_(false)
71  , matrixProperty_(0)
72  , rcond_threshold_(1e-12)
73  , refactorize_(false)
74  , scaleMethod_(0)
75  , reindex_(false)
76  { }
77 
79  ~Control() { };
80 
81  void setControlParameters(
82  const Teuchos::RCP<Teuchos::ParameterList> & parameterList );
83 
89  int verbose_;
90 
92  int debug_;
93 
94 
96  bool useTranspose_;
97 
99  bool useIterRefine_;
100 
102  int maxNumIterRefines_;
103 
105  bool verboseIterRefine_;
106 
113  std::string addToDiag_;
114 
115 
121  bool addZeroToDiag_;
122 
123 
133  int matrixProperty_;
134 
135 
138  double rcond_threshold_; // if we refactorize, the factorization
139  // may suffer in numeric quality. We
140  // compute rcond = min (abs (diag (U))) /
141  // max (abs(diag (U))). If this ratio is
142  // <= rcond_threshold_, then the
143  // "refactorization" is scrapped, and we
144  // factor with full partial pivoting
145  // instead.
146 
147 
148  bool refactorize_; // if true, and if the Symbolic and Numeric
149  // objects have already been created, then
150  // attempt to "refactorize" (factor the matrix
151  // with no changes to the pivot order since the
152  // last call the klu_btf_factor).
153 
154 
155  int scaleMethod_; // Most methods (klu, UMFPACK, Mumps, ...) can
156  // scale the input matrix prior to
157  // factorization. This can improve pivoting,
158  // reduces fill-in, and leads to a better
159  // quality factorization. The options are:
160  // 0: no scaling
161  // 1: use the default method for the specific
162  // package
163  // 2: use the method's 1st alternative (if it
164  // has one)
165  // 3: use the method's 2nd alternative, and so
166  // on.
167  //
168  // Amesos2_Klu is, at present, the only code
169  // which implements this
170 
171 
179  bool reindex_;
180 
181 }; // end class Control
182 
183 
184 } // end namespace Amesos2
185 
186 #endif // AMESOS2_CONTROL_HPP