MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbstractLinAlgPack_MA28Solver.cpp
Go to the documentation of this file.
1 // @HEADER
2 // ***********************************************************************
3 //
4 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
5 // Copyright (2003) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov)
38 //
39 // ***********************************************************************
40 // @HEADER
41 
42 #include "Moocho_ConfigDefs.hpp"
43 
44 
45 #ifdef HAVE_MOOCHO_MA28
46 
47 
49 
50 // Initialize static variables
52 
53 // Initialize the references to the ma28 common blocks defined in the fortran code.
65  );
66 
67 // Save the default values of the ma28 common block variables.
68 // By setting the references to the common block variables first we are guarented that
69 // references will be bound to the proper memory locations. The only problem with this is that
70 // how can I be sure that the initializations for the fortran BLOCK DATA units have
71 // be performed before these global initializations are carried out. I need to look into this in
72 // different platforms to ensure that this will work. Otherwise I will just have to set the
73 // default values myself.
75  MA28Solver::ma28_common_blocks_);
76 
77 // ///////////////////////////////
78 // Member functions
79 
81  : common_blocks_(default_common_blocks_), changed_(false)
82 {
83  mp(0); // We can't print to standard fortran streams from C++
84  lp(0);
85 }
86 
87 MA28_Cpp::MA28Solver::MA28Solver(const MA28Solver& s)
88  : common_blocks_(s.common_blocks_), changed_(false)
89 {}
90 
92  // Copy to the ma28 ma28 common blocks if this is not the current solver.
93  if( (this != curr_solver_ )|| ( (this == curr_solver_) && changed_ ) )
94  ma28_common_blocks_ = common_blocks_;
95  // Make this solver the current solver
96  curr_solver_ = this;
97  changed_ = false;
98 }
99 
101  // You must save the common block data back in order to get the return parameters.
102  // Later I should differentiate what is control and what is return but for
103  // now this is the easiest thing to do.
104  common_blocks_ = ma28_common_blocks_;
105 }
106 
107 
108 #endif // HAVE_MOOCHO_MA28
static MA28CommonBlockReferences ma28_common_blocks_
static MA30FD_struct & ma30fd_cb
static MC23BD_struct & mc23bd_cb
static MA30ID_struct & ma30id_cb
static MA30GD_struct & ma30gd_cb
static MA30ED_struct & ma30ed_cb
static MA28GD_struct & ma28gd_cb
static MA30HD_struct & ma30hd_cb
static MA28FD_struct & ma28fd_cb
static MA28CommonBlockStorage default_common_blocks_
static MA28ED_struct & ma28ed_cb
static MA28HD_struct & ma28hd_cb
MA28Solver()
Construct a solver object that is initialized with the default common block data variables.
MA28 Basic Encapsulation Class.