MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstrainedOptPack_DecompositionSystemVarReductPermStd.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 #ifndef DECOMPOSITION_SYSTEM_VAR_REDUCT_PERM_STD_H
43 #define DECOMPOSITION_SYSTEM_VAR_REDUCT_PERM_STD_H
44 
45 #include <stdexcept>
46 
49 
50 namespace ConstrainedOptPack {
51 
58 public:
59 
62 
67 
69 
72 
77  ,bool basis_selected = false
80  );
81 
83  void initialize(
86  ,bool basis_selected = false
89  );
90 
92 
95 
97  const decomp_sys_imp_ptr_t& decomp_sys_imp() const;
99  const basis_sys_ptr_t& basis_sys() const;
100 
102 
105 
107  size_type n() const;
109  size_type m() const;
111  size_type r() const;
113  Range1D equ_decomp() const;
115  Range1D equ_undecomp() const;
117  const VectorSpace::space_ptr_t space_range() const;
119  const VectorSpace::space_ptr_t space_null() const;
121  const mat_fcty_ptr_t factory_Z() const;
123  const mat_fcty_ptr_t factory_Y() const;
125  const mat_nonsing_fcty_ptr_t factory_R() const;
127  const mat_fcty_ptr_t factory_Uz() const;
129  const mat_fcty_ptr_t factory_Uy() const;
131  void update_decomp(
132  std::ostream *out
133  ,EOutputLevel olevel
134  ,ERunTests test_what
135  ,const MatrixOp &Gc
136  ,MatrixOp *Z
137  ,MatrixOp *Y
138  ,MatrixOpNonsing *R
139  ,MatrixOp *Uz
140  ,MatrixOp *Uy
141  ,EMatRelations mat_rel
142  ) const;
144  void print_update_decomp(
145  std::ostream& out, const std::string& leading_str ) const;
146 
148 
151 
153  Range1D var_indep() const;
155  Range1D var_dep() const;
156 
158 
161 
163  const perm_fcty_ptr_t factory_P_var() const;
165  const perm_fcty_ptr_t factory_P_equ() const;
167  bool has_basis() const;
169  void set_decomp(
170  std::ostream *out
171  ,EOutputLevel olevel
172  ,ERunTests test_what
173  ,const Permutation &P_var
174  ,const Range1D &var_dep
175  ,const Permutation *P_equ
176  ,const Range1D *equ_decomp
177  ,const MatrixOp &Gc
178  ,MatrixOp *Z
179  ,MatrixOp *Y
180  ,MatrixOpNonsing *R
181  ,MatrixOp *Uz
182  ,MatrixOp *Uy
183  ,EMatRelations mat_rel
184  );
186  void select_decomp(
187  std::ostream *out
188  ,EOutputLevel olevel
189  ,ERunTests test_what
190  ,const Vector *nu
191  ,MatrixOp *Gc
192  ,Permutation *P_var
193  ,Range1D *var_dep
194  ,Permutation *P_equ
196  ,MatrixOp *Z
197  ,MatrixOp *Y
198  ,MatrixOpNonsing *R
199  ,MatrixOp *Uz
200  ,MatrixOp *Uy
201  ,EMatRelations mat_rel
202  );
203 
205 
206 private:
207 
208  // /////////////////////////
209  // Private data members
210 
211  bool basis_selected_; // True if a basis is currently selected
214 
215  // /////////////////////////
216  // Private member functions
217 
219  void assert_basis_selected() const;
220 
221  // Not defined and not to be called!
225 
226 }; // end class DecompositionSystemVarReductPermStd
227 
228 // ///////////////////////////////////////
229 // Inline members
230 
231 inline
234 {
235  return decomp_sys_imp_;
236 }
237 
238 inline
241 {
242  return basis_sys_;
243 }
244 
245 } // end namespace ConstrainedOptPack
246 
247 #endif // DECOMPOSITION_SYSTEM_VAR_REDUCT_PERM_STD_H
f_dbl_prec const f_int f_dbl_prec * Y
AbstractLinAlgPack::size_type size_type
DecompositionSystemVarReductPermStd & operator=(const DecompositionSystemVarReductPermStd &)
Concreate subclass of DecompositionSystemVarReductPerm that uses an aggregate DecompostionSystemVarRe...
void initialize(const decomp_sys_imp_ptr_t &decomp_sys_imp, const basis_sys_ptr_t &basis_sys, bool basis_selected=false, EExplicitImplicit D_imp=MAT_IMP_AUTO, EExplicitImplicit Uz_imp=MAT_IMP_AUTO)
Initialize given decomposition system and basis system objects.
EOutputLevel
Enumeration for the amount of output to create from update_decomp().
ERunTests
Enumeration for if to run internal tests or not.
void set_decomp(std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Permutation &P_var, const Range1D &var_dep, const Permutation *P_equ, const Range1D *equ_decomp, const MatrixOp &Gc, MatrixOp *Z, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uz, MatrixOp *Uy, EMatRelations mat_rel)
void update_decomp(std::ostream *out, EOutputLevel olevel, ERunTests test_what, const MatrixOp &Gc, MatrixOp *Z, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uz, MatrixOp *Uy, EMatRelations mat_rel) const
void print_update_decomp(std::ostream &out, const std::string &leading_str) const
std::ostream * out
Specialization interface of DecompositonSystem that allows basis permutations.
void select_decomp(std::ostream *out, EOutputLevel olevel, ERunTests test_what, const Vector *nu, MatrixOp *Gc, Permutation *P_var, Range1D *var_dep, Permutation *P_equ, Range1D *equ_decomp, MatrixOp *Z, MatrixOp *Y, MatrixOpNonsing *R, MatrixOp *Uz, MatrixOp *Uy, EMatRelations mat_rel)