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  , addToDiag_("0.0")
67  , addZeroToDiag_(false)
68  , matrixProperty_(0)
69  , rcond_threshold_(1e-12)
70  , refactorize_(false)
71  , scaleMethod_(0)
72  , reindex_(false)
73  { }
74 
76  ~Control() { };
77 
78  void setControlParameters(
79  const Teuchos::RCP<Teuchos::ParameterList> & parameterList );
80 
86  int verbose_;
87 
89  int debug_;
90 
91 
93  bool useTranspose_;
94 
95 
102  std::string addToDiag_;
103 
104 
110  bool addZeroToDiag_;
111 
112 
122  int matrixProperty_;
123 
124 
127  double rcond_threshold_; // if we refactorize, the factorization
128  // may suffer in numeric quality. We
129  // compute rcond = min (abs (diag (U))) /
130  // max (abs(diag (U))). If this ratio is
131  // <= rcond_threshold_, then the
132  // "refactorization" is scrapped, and we
133  // factor with full partial pivoting
134  // instead.
135 
136 
137  bool refactorize_; // if true, and if the Symbolic and Numeric
138  // objects have already been created, then
139  // attempt to "refactorize" (factor the matrix
140  // with no changes to the pivot order since the
141  // last call the klu_btf_factor).
142 
143 
144  int scaleMethod_; // Most methods (klu, UMFPACK, Mumps, ...) can
145  // scale the input matrix prior to
146  // factorization. This can improve pivoting,
147  // reduces fill-in, and leads to a better
148  // quality factorization. The options are:
149  // 0: no scaling
150  // 1: use the default method for the specific
151  // package
152  // 2: use the method's 1st alternative (if it
153  // has one)
154  // 3: use the method's 2nd alternative, and so
155  // on.
156  //
157  // Amesos2_Klu is, at present, the only code
158  // which implements this
159 
160 
168  bool reindex_;
169 
170 }; // end class Control
171 
172 
173 } // end namespace Amesos2
174 
175 #endif // AMESOS2_CONTROL_HPP