/usr/include/trilinos/AbstractLinAlgPack_MA28Solver.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 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | // @HEADER
// ***********************************************************************
//
// Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
// Copyright (2003) 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 Roscoe A. Bartlett (rabartl@sandia.gov)
//
// ***********************************************************************
// @HEADER
//
// This is a class for encapsulsting the MA28 package as
// and object so that multiple sparse matrix systems can
// be solved at the same time.
#ifndef SSP_MA28_SOLVER_H
#define SSP_MA28_SOLVER_H
#include "AbstractLinAlgPack_MA28CommonBlockEncap.hpp"
namespace MA28_Cpp {
// Adobt some of the declarations from MA29_CppDecl
using MA28_CppDecl::f_int;
using MA28_CppDecl::f_logical;
using MA28_CppDecl::f_real;
using MA28_CppDecl::f_dbl_prec;
/** \brief MA28 Basic Encapsulation Class.
*
* Each object of this class represents a specific MA28 package.
* Each object encapsulates the common block data for MA28.
* This class has the same interface functions as MA28 (#ma28ad#
* , #ma28bd#, and #ma28cd#). It also has functions for
* getting and retrieving the common block data from the
* MA28 common blocks.
*
*/
class MA28Solver {
public:
/// Construct a solver object that is initialized with the default common block data variables.
MA28Solver();
/// Construct a solver object that is initialized with the common block data of another solver.
MA28Solver(const MA28Solver& s);
// MA28 interface functions
/** \brief . */
void ma28ad(const f_int& n, const f_int& nz, f_dbl_prec a[], const f_int& licn
, f_int irn[], const f_int& lirn, f_int icn[], const f_dbl_prec& u
, f_int ikeep[], f_int iw[], f_dbl_prec w[], f_int* iflag)
{
set_common_block_data();
MA28_CppDecl::ma28ad(n,nz,a,licn,irn,lirn,icn,u,ikeep,iw,w,iflag);
get_common_block_data();
}
/** \brief . */
void ma28bd(const f_int& n, const f_int& nz, f_dbl_prec a[], const f_int& licn
, const f_int ivect[], const f_int jvect[], const f_int icn[]
, const f_int ikeep[], f_int iw[], f_dbl_prec w[], f_int* iflag)
{
set_common_block_data();
MA28_CppDecl::ma28bd(n,nz,a,licn,ivect,jvect,icn,ikeep,iw,w,iflag);
get_common_block_data();
}
/** \brief . */
void ma28cd(const f_int& n, const f_dbl_prec a[], const f_int& licn, const f_int icn[]
, const f_int ikeep[], f_dbl_prec rhs[], f_dbl_prec w[], const f_int& mtype)
{
set_common_block_data();
MA28_CppDecl::ma28cd(n,a,licn,icn,ikeep,rhs,w,mtype);
get_common_block_data();
}
// Common block data setting and retrieval functions
/** \brief . */
void lp(f_int lp)
{ changed_=true; common_blocks_.ma28ed_.lp=lp; }
/** \brief . */
f_int lp()
{ return common_blocks_.ma28ed_.lp; }
/** \brief . */
void mp(f_int mp)
{ changed_=true; common_blocks_.ma28ed_.mp=mp; }
/** \brief . */
f_int mp()
{ return common_blocks_.ma28ed_.mp; }
/** \brief . */
void lblock(f_logical lblock)
{ changed_=true; common_blocks_.ma28ed_.lblock=lblock; }
/** \brief . */
f_logical lblock()
{ return common_blocks_.ma28ed_.lblock; }
/** \brief . */
void grow(f_logical grow)
{ changed_=true; common_blocks_.ma28ed_.grow=grow; }
/** \brief . */
f_logical grow()
{ return common_blocks_.ma28ed_.grow; }
/** \brief . */
void eps(f_dbl_prec eps)
{ changed_=true; common_blocks_.ma28fd_.eps=eps; }
/** \brief . */
f_dbl_prec eps()
{ return common_blocks_.ma28fd_.eps; }
/** \brief . */
void rmin(f_dbl_prec rmin)
{ changed_=true; common_blocks_.ma28fd_.rmin=rmin; }
/** \brief . */
f_dbl_prec rmin()
{ return common_blocks_.ma28fd_.rmin; }
/** \brief . */
void resid(f_dbl_prec resid)
{ changed_=true; common_blocks_.ma28fd_.resid=resid; }
/** \brief . */
f_dbl_prec resid()
{ return common_blocks_.ma28fd_.resid; }
/** \brief . */
void irncp(f_int irncp)
{ changed_=true; common_blocks_.ma28fd_.irncp=irncp; }
/** \brief . */
f_int irncp()
{ return common_blocks_.ma28fd_.irncp; }
/** \brief . */
void icncp(f_int icncp)
{ changed_=true; common_blocks_.ma28fd_.icncp=icncp; }
/** \brief . */
f_int icncp()
{ return common_blocks_.ma28fd_.icncp; }
/** \brief . */
void minirn(f_int minirn)
{ changed_=true; common_blocks_.ma28fd_.minirn=minirn; }
/** \brief . */
f_int minirn()
{ return common_blocks_.ma28fd_.minirn; }
/** \brief . */
void minicn(f_int minicn)
{ changed_=true; common_blocks_.ma28fd_.minicn=minicn; }
/** \brief . */
f_int minicn()
{ return common_blocks_.ma28fd_.minicn; }
/** \brief . */
void irank(f_int irank)
{ changed_=true; common_blocks_.ma28fd_.irank=irank; }
/** \brief . */
f_int irank()
{ return common_blocks_.ma28fd_.irank; }
/** \brief . */
void abort1(f_logical abort1)
{ changed_=true; common_blocks_.ma28fd_.abort1=abort1; }
/** \brief . */
f_logical abort1()
{ return common_blocks_.ma28fd_.abort1; }
/** \brief . */
void abort2(f_logical abort2)
{ changed_=true; common_blocks_.ma28fd_.abort2=abort2; }
/** \brief . */
f_logical abort2()
{ return common_blocks_.ma28fd_.abort2; }
/** \brief . */
void idisp(f_int val, f_int i)
{ changed_=true; common_blocks_.ma28gd_.idisp[i]=val; }
/** \brief . */
f_int idisp(f_int i)
{ return common_blocks_.ma28gd_.idisp[i]; }
/** \brief . */
void tol(f_dbl_prec tol)
{ changed_=true; common_blocks_.ma28hd_.tol=tol; }
/** \brief . */
f_dbl_prec tol()
{ return common_blocks_.ma28hd_.tol; }
/** \brief . */
void themax(f_dbl_prec themax)
{ changed_=true; common_blocks_.ma28hd_.themax=themax; }
/** \brief . */
f_dbl_prec themax()
{ return common_blocks_.ma28hd_.themax; }
/** \brief . */
void big(f_dbl_prec big)
{ changed_=true; common_blocks_.ma28hd_.big=big; }
/** \brief . */
f_dbl_prec big()
{ return common_blocks_.ma28hd_.big; }
/** \brief . */
void dxmax(f_dbl_prec dxmax)
{ changed_=true; common_blocks_.ma28hd_.dxmax=dxmax; }
/** \brief . */
f_dbl_prec dxmax()
{ return common_blocks_.ma28hd_.dxmax; }
/** \brief . */
void errmax(f_dbl_prec errmax)
{ changed_=true; common_blocks_.ma28hd_.errmax=errmax; }
/** \brief . */
f_dbl_prec errmax()
{ return common_blocks_.ma28hd_.errmax; }
/** \brief . */
void dres(f_dbl_prec dres)
{ changed_=true; common_blocks_.ma28hd_.dres=dres; }
/** \brief . */
f_dbl_prec dres()
{ return common_blocks_.ma28hd_.dres; }
/** \brief . */
void cgce(f_dbl_prec cgce)
{ changed_=true; common_blocks_.ma28hd_.cgce=cgce; }
/** \brief . */
f_dbl_prec cgce()
{ return common_blocks_.ma28hd_.cgce; }
/** \brief . */
void ndrop(f_int ndrop)
{ changed_=true; common_blocks_.ma28hd_.ndrop=ndrop; }
/** \brief . */
f_int ndrop()
{ return common_blocks_.ma28hd_.ndrop; }
/** \brief . */
void maxit(f_int maxit)
{ changed_=true; common_blocks_.ma28hd_.maxit=maxit; }
/** \brief . */
f_int maxit()
{ return common_blocks_.ma28hd_.maxit; }
/** \brief . */
void noiter(f_int noiter)
{ changed_=true; common_blocks_.ma28hd_.noiter=noiter; }
/** \brief . */
f_int noiter()
{ return common_blocks_.ma28hd_.noiter; }
/** \brief . */
void nsrch(f_int nsrch)
{ changed_=true; common_blocks_.ma28hd_.nsrch=nsrch; }
/** \brief . */
f_int nsrch()
{ return common_blocks_.ma28hd_.nsrch; }
/** \brief . */
void istart(f_int istart)
{ changed_=true; common_blocks_.ma28hd_.istart=istart; }
/** \brief . */
f_int istart()
{ return common_blocks_.ma28hd_.istart; }
/** \brief . */
void lbig(f_logical lbig)
{ changed_=true; common_blocks_.ma28hd_.lbig=lbig; }
/** \brief . */
f_logical lbig()
{ return common_blocks_.ma28hd_.lbig; }
/// Dump the common block infomation for this solver object.
void dump_common_blocks(std::ostream& o)
{ common_blocks_.dump_values(o); }
/// Copy the state of one solver to another
MA28Solver& operator=(const MA28Solver& solver)
{ changed_ = true; common_blocks_ = solver.common_blocks_; return *this; }
// ///////////////////////////////////
// Static member functions
/// Dump the common block infomation for ma28 common blocks
static void dump_ma28_common_blocks(std::ostream& o)
{ ma28_common_blocks_.dump_values(o); }
private:
// ////////////////////////////////////
// Private member functions
// Copy the local copy the common block data to MA28 before a MA28 call.
void set_common_block_data();
// Retrieve the common block data after a ma28 call.
void get_common_block_data();
// ///////////////////////////////////
// Private member data
// Common block data for this solver object
MA28CommonBlockStorage common_blocks_;
// Flag for if the common bock data has changed
bool changed_;
// ///////////////////////////////////
// Static member data
// Copies of the default values for the
// common block data.
static MA28CommonBlockStorage default_common_blocks_;
// References to the MA28 common blocks
static MA28CommonBlockReferences ma28_common_blocks_;
// Pointer variable who's purpose it to identify
// what solver object is the current one.
static MA28Solver* curr_solver_;
};
} // end namespace MA28_Cpp
#endif // SSP_MA28_SOLVER_H
|