/usr/include/trilinos/Thyra_DefaultPreconditioner_decl.hpp is in libtrilinos-dev 10.4.0.dfsg-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | // @HEADER
// ***********************************************************************
//
// Thyra: Interfaces and Support for Abstract Numerical Algorithms
// Copyright (2004) Sandia Corporation
//
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
// license for use of this work by or on behalf of the U.S. Government.
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
// USA
// Questions? Contact Michael A. Heroux (maherou@sandia.gov)
//
// ***********************************************************************
// @HEADER
#ifndef THYRA_DEFUALT_PRECONDITIONER_DECL_HPP
#define THYRA_DEFUALT_PRECONDITIONER_DECL_HPP
#include "Thyra_PreconditionerBase.hpp"
#include "Teuchos_ConstNonconstObjectContainer.hpp"
namespace Thyra {
/** \brief Default implementation of a <tt>PreconditionerBase</tt> that just
* accepts precreated preconditioner linear operators.
*
* Here is how to construct a precondtioner for the four different types of preconditioners:
* <ul>
* <li>Single preconditioner linear operator designed or targeted to be applied on the left:
* <ul>
* <li><tt>DefaultPreconditioner(leftPrecOp,Teuchos::null);
* </ul>
* <li>Single preconditioner linear operator designed or targeted to be applied on the right:
* <ul>
* <li><tt>DefaultPreconditioner(Teuchos::null,righPrecOp);
* </ul>
* <li>Split two-sided preconditioner with linear operators designed or
* targeted to be applied on the left and the right:
* <ul>
* <li><tt>DefaultPreconditioner(leftPrecOp,rightPrecOp);
* </ul>
* <li>Single preconditioner linear operator not designed or targeted to be
* applied on the left or the right:
* <ul>
* <li><tt>DefaultPreconditioner(precOp);
* </ul>
* <\ul>
*
* ToDo: Finish documentation!
*/
template <class Scalar>
class DefaultPreconditioner : virtual public PreconditionerBase<Scalar>
{
public:
/** @name Constructors/initializers/accessors */
//@{
/** \brief Construct to uninitialized.
*/
DefaultPreconditioner();
/** \brief Construct a left-only, or right-only, or split left/right
* preconditioner.
*/
DefaultPreconditioner(
const Teuchos::RCP<LinearOpBase<Scalar> > &leftPrecOp,
const Teuchos::RCP<LinearOpBase<Scalar> > &rightPrecOp
);
/** \brief Construct a const-only left-only, or right-only, or split
* left/right preconditioner.
*/
DefaultPreconditioner(
const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp,
const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
);
/** \brief Construct a single unspecified preconditioner.
*/
DefaultPreconditioner(
const Teuchos::RCP<LinearOpBase<Scalar> > &unspecifiedPrecOp
);
/** \brief Construct a const-only single unspecified preconditioner.
*/
DefaultPreconditioner(
const Teuchos::RCP<const LinearOpBase<Scalar> > &unspecifiedPrecOp
);
/** \brief Initialize a left preconditioner.
*/
void initializeLeft(
const Teuchos::RCP<LinearOpBase<Scalar> > &leftPrecOp
);
/** \brief Initialize a const-only left preconditioner.
*/
void initializeLeft(
const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
);
/** \brief Initialize a right preconditioner.
*/
void initializeRight(
const Teuchos::RCP<LinearOpBase<Scalar> > &rightPrecOp
);
/** \brief Initialize a const-only right preconditioner.
*/
void initializeRight(
const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
);
/** \brief Initialize a split left/right preconditioner.
*/
void initializeLeftRight(
const Teuchos::RCP<LinearOpBase<Scalar> > &leftPrecOp
,const Teuchos::RCP<LinearOpBase<Scalar> > &rightPrecOp
);
/** \brief Initialize a const-only split left/right preconditioner.
*/
void initializeLeftRight(
const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
,const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
);
/** \brief Initialize a single unspecified preconditioner
* operator.
*/
void initializeUnspecified(
const Teuchos::RCP<LinearOpBase<Scalar> > &unspecifiedPrecOp
);
/** \brief Initialize a const-only single unspecified preconditioner
* operator.
*/
void initializeUnspecified(
const Teuchos::RCP<const LinearOpBase<Scalar> > &unspecifiedPrecOp
);
/** \brief Uninitialize.
*
* Note: If the client wants to access the underlying preconditioner
* operators, then it had better grab them with the below access functions
* before calling this function.
*/
void uninitialize();
//@}
/** @name Overridden from Teuchos::Describable */
//@{
/** \brief . */
std::string description() const;
/** \brief . */
void describe(
Teuchos::FancyOStream &out,
const Teuchos::EVerbosityLevel verbLevel
) const;
//@}
/** @name Overridden from PreconditionerBase */
//@{
/** \brief . */
bool isLeftPrecOpConst() const;
/** \brief . */
Teuchos::RCP<LinearOpBase<Scalar> > getNonconstLeftPrecOp();
/** \brief . */
Teuchos::RCP<const LinearOpBase<Scalar> > getLeftPrecOp() const;
/** \brief . */
bool isRightPrecOpConst() const;
/** \brief . */
Teuchos::RCP<LinearOpBase<Scalar> > getNonconstRightPrecOp();
/** \brief . */
Teuchos::RCP<const LinearOpBase<Scalar> > getRightPrecOp() const;
/** \brief . */
bool isUnspecifiedPrecOpConst() const;
/** \brief . */
Teuchos::RCP<LinearOpBase<Scalar> > getNonconstUnspecifiedPrecOp();
/** \brief . */
Teuchos::RCP<const LinearOpBase<Scalar> > getUnspecifiedPrecOp() const;
//@}
private:
Teuchos::ConstNonconstObjectContainer<LinearOpBase<Scalar> > leftPrecOp_;
Teuchos::ConstNonconstObjectContainer<LinearOpBase<Scalar> > rightPrecOp_;
Teuchos::ConstNonconstObjectContainer<LinearOpBase<Scalar> > unspecifiedPrecOp_;
};
// ///////////////////////
// Related functions
/** \brief Create a precondioner from a single linear operator not targeted to
* be used on the left or the right.
*
* \relates DefaultPreconditioner
*/
template <class Scalar>
Teuchos::RCP<const DefaultPreconditioner<Scalar> >
unspecifiedPrec(
const Teuchos::RCP<const LinearOpBase<Scalar> > &unspecifiedPrecOp
)
{
return Teuchos::rcp(new DefaultPreconditioner<Scalar>(unspecifiedPrecOp));
}
/** \brief Create a precondioner from a single linear operator targeted to be
* used on the left.
*
* \relates DefaultPreconditioner
*/
template <class Scalar>
Teuchos::RCP<const DefaultPreconditioner<Scalar> >
leftPrec(
const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
)
{
return Teuchos::rcp(new DefaultPreconditioner<Scalar>(leftPrecOp,Teuchos::null));
}
/** \brief Create a precondioner from a single linear operator targeted to be
* used on the right.
*
* \relates DefaultPreconditioner
*/
template <class Scalar>
Teuchos::RCP<const DefaultPreconditioner<Scalar> >
rightPrec(
const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
)
{
return Teuchos::rcp(new DefaultPreconditioner<Scalar>(Teuchos::null,rightPrecOp));
}
/** \brief Create a split precondioner from two linear operators, one to be
* applied on the left and one to be applied on the right.
*
* \relates DefaultPreconditioner
*/
template <class Scalar>
Teuchos::RCP<const DefaultPreconditioner<Scalar> >
splitPrec(
const Teuchos::RCP<const LinearOpBase<Scalar> > &leftPrecOp
,const Teuchos::RCP<const LinearOpBase<Scalar> > &rightPrecOp
)
{
return Teuchos::rcp(new DefaultPreconditioner<Scalar>(leftPrecOp,rightPrecOp));
}
} // namespace Thyra
#endif // THYRA_DEFUALT_PRECONDITIONER_DECL_HPP
|