MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AbstractLinAlgPack_MA28CommonBlockEncap.hpp
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 // These classes are used to encapsulate the copy of ma28 common block data from
43 // on set to another.
44 
45 #ifndef MA28_COMMON_BLOCK_ENCAP_H
46 #define MA28_COMMON_BLOCK_ENCAP_H
47 
48 #include <iostream>
49 
51 
52 namespace MA28_Cpp {
53 
54  using MA28_CppDecl::MA28ED_struct;
55  using MA28_CppDecl::MA28FD_struct;
56  using MA28_CppDecl::MA28GD_struct;
57  using MA28_CppDecl::MA28HD_struct;
58  using MA28_CppDecl::MA30ED_struct;
59  using MA28_CppDecl::MA30FD_struct;
60  using MA28_CppDecl::MA30GD_struct;
61  using MA28_CppDecl::MA30HD_struct;
62  using MA28_CppDecl::MA30ID_struct;
63  using MA28_CppDecl::MC23BD_struct;
64 
65 class MA28CommonBlockStorage; // forward declaration
66 
67 // This is a class for storing the references to MA28 common blocks.
68 // It is used to simplify copy of common block members.
70 public:
71  // Construct with references.
73  MA28ED_struct& ma28ed,
74  MA28FD_struct& ma28fd,
75  MA28GD_struct& ma28gd,
76  MA28HD_struct& ma28hd,
77  MA30ED_struct& ma30ed,
78  MA30FD_struct& ma30fd,
79  MA30GD_struct& ma30gd,
80  MA30HD_struct& ma30hd,
81  MA30ID_struct& ma30id,
82  MC23BD_struct& mc23bd
83  ) :
84  ma28ed_(ma28ed),
85  ma28fd_(ma28fd),
86  ma28gd_(ma28gd),
87  ma28hd_(ma28hd),
88  ma30ed_(ma30ed),
89  ma30fd_(ma30fd),
90  ma30gd_(ma30gd),
91  ma30hd_(ma30hd),
92  ma30id_(ma30id),
93  mc23bd_(mc23bd)
94  {}
95 
96  // Use default copy constructor ....
97 
98  // public reference members
99  MA28ED_struct& ma28ed_;
100  MA28FD_struct& ma28fd_;
101  MA28GD_struct& ma28gd_;
102  MA28HD_struct& ma28hd_;
103  MA30ED_struct& ma30ed_;
104  MA30FD_struct& ma30fd_;
105  MA30GD_struct& ma30gd_;
106  MA30HD_struct& ma30hd_;
107  MA30ID_struct& ma30id_;
108  MC23BD_struct& mc23bd_;
109 
110  // Assignment operator
112 
113  // Use default assignment operator ....
114 
115  // Output common block info to a ostream
116  void dump_values(std::ostream& o);
117 private:
118  MA28CommonBlockReferences(); // not defined and not to be called.
119 };
120 
121 // This is a storage class for MA28 common blocks. It is ment to be
122 // used by objects that wish to save the state of MA28. The default
123 // C++ copy constructor and assignment operator are use since a
124 // memberwise copy of member data is exactly what I want.
126 public:
127  // Use default constructor ....
128  // Use default copy constructor .....
129 
130  // Copy the values
132  ma28ed_(cb.ma28ed_),
133  ma28fd_(cb.ma28fd_),
134  ma28gd_(cb.ma28gd_),
135  ma28hd_(cb.ma28hd_),
136  ma30ed_(cb.ma30ed_),
137  ma30fd_(cb.ma30fd_),
138  ma30gd_(cb.ma30gd_),
139  ma30hd_(cb.ma30hd_),
140  ma30id_(cb.ma30id_),
141  mc23bd_(cb.mc23bd_)
142  {}
143 
144  // Public storage members
145  MA28ED_struct ma28ed_;
146  MA28FD_struct ma28fd_;
147  MA28GD_struct ma28gd_;
148  MA28HD_struct ma28hd_;
149  MA30ED_struct ma30ed_;
150  MA30FD_struct ma30fd_;
151  MA30GD_struct ma30gd_;
152  MA30HD_struct ma30hd_;
153  MA30ID_struct ma30id_;
154  MC23BD_struct mc23bd_;
155 
156  // Assignment operator
158 
159  // Use default assignment operator
160 
161  // Output common block info to a ostream
162  void dump_values(std::ostream& o);
163 
164 };
165 
166 } // end namespace MA28_Cpp
167 
168 #endif // MA28_COMMON_BLOCK_ENCAP_H
void dump_values(std::ostream &o)
void dump_values(std::ostream &o)
MA28CommonBlockReferences(MA28ED_struct &ma28ed, MA28FD_struct &ma28fd, MA28GD_struct &ma28gd, MA28HD_struct &ma28hd, MA30ED_struct &ma30ed, MA30FD_struct &ma30fd, MA30GD_struct &ma30gd, MA30HD_struct &ma30hd, MA30ID_struct &ma30id, MC23BD_struct &mc23bd)
MA28CommonBlockStorage(const MA28CommonBlockReferences &cb)
MA28CommonBlockReferences & operator=(const MA28CommonBlockStorage &ma28cbs)
MA28CommonBlockStorage & operator=(const MA28CommonBlockReferences &ma28cbs)