ConstrainedOptPack: C++ Tools for Constrained (and Unconstrained) Optimization  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ConstrainedOptPack_MatrixHessianSuperBasic.hpp
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 MATRIX_HESSIAN_SUPER_BASIC_H
43 #define MATRIX_HESSIAN_SUPER_BASIC_H
44 
45 #include <vector>
46 
47 #include "ConstrainedOptPack/src/ConstrainedOptPack_Types.hpp"
48 #include "AbstractLinAlgPack/src/MatrixSymWithOpFactorized.hpp"
49 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_GenPermMatrixSlice.hpp"
50 #include "Miref_count_ptr.h"
51 
52 namespace ConstrainedOptPack {
53 
88  : public virtual MatrixSymOp
89 {
90 public:
91 
102  typedef std::vector<EBounds>
104 
108 
172  virtual void initialize(
173  size_type n
174  ,size_type n_R
175  ,const size_type i_x_free[]
176  ,const size_type i_x_fixed[]
177  ,const EBounds bnd_fixed[]
178  ,const B_RR_ptr_t& B_RR_ptr
179  ,const B_RX_ptr_t& B_RX_ptr
181  ,const B_XX_ptr_t& B_XX_ptr
182  );
183 
186 
188  const GenPermMatrixSlice& Q_R() const;
190  const GenPermMatrixSlice& Q_X() const;
192  const bnd_fixed_t& bnd_fixed() const;
194  const B_RR_ptr_t& B_RR_ptr() const;
196  const B_RX_ptr_t& B_RX_ptr() const;
200  const B_XX_ptr_t& B_XX_ptr() const;
201 
203 
206 
208  size_type rows() const;
209 
211 
214 
216  void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
217  , const DVectorSlice& vs_rhs2, value_type beta) const;
219  void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
220  , const SpVectorSlice& sv_rhs2, value_type beta) const;
222  void Vp_StPtMtV(DVectorSlice* vs_lhs, value_type alpha
223  , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
224  , BLAS_Cpp::Transp M_rhs2_trans
225  , const DVectorSlice& sv_rhs3, value_type beta) const;
227  value_type transVtMtV(const SpVectorSlice& sv_rhs1, BLAS_Cpp::Transp trans_rhs2
228  , const SpVectorSlice& sv_rhs3) const ;
229 
231 
232 protected:
233 
235  void assert_initialized() const;
236 
237 private:
238 
239  // ///////////////////////////////////
240  // Private types
241 
242  typedef std::vector<size_type> row_i_t;
243  typedef std::vector<size_type> col_j_t;
244 
245  // ///////////////////////////////////
246  // Private data members
247 
248  size_type n_;
249  size_type n_R_;
250  GenPermMatrixSlice Q_R_; // Sorted by row
251  row_i_t Q_R_row_i_;
252  col_j_t Q_R_col_j_;
253  GenPermMatrixSlice Q_X_; // Sorted by row
254  row_i_t Q_X_row_i_;
255  col_j_t Q_X_col_j_;
256  bnd_fixed_t bnd_fixed_;
257  B_RR_ptr_t B_RR_ptr_;
258  B_RX_ptr_t B_RX_ptr_;
259  BLAS_Cpp::Transp B_RX_trans_;
260  B_XX_ptr_t B_XX_ptr_;
261 
262 }; // end class MatrixHessianSuperBasic
263 
264 // ////////////////////////////////////////////
265 // Inline members for MatrixHessianSuperBasic
266 
267 inline
268 const GenPermMatrixSlice& MatrixHessianSuperBasic::Q_R() const
269 {
271  return Q_R_;
272 }
273 
274 inline
275 const GenPermMatrixSlice& MatrixHessianSuperBasic::Q_X() const
276 {
278  return Q_X_;
279 }
280 
281 inline
284 {
285  return bnd_fixed_;
286 }
287 
288 inline
291 {
293  return B_RR_ptr_;
294 }
295 
296 inline
300  return B_RX_ptr_;
301 }
302 
303 inline
305 {
307  return B_RX_trans_;
308 }
309 
310 inline
313 {
315  return B_XX_ptr_;
316 }
317 
318 } // end namespace ConstrainedOptPack
319 
320 #endif // MATRIX_HESSIAN_SUPER_BASIC_H
virtual void initialize(size_type n, size_type n_R, const size_type i_x_free[], const size_type i_x_fixed[], const EBounds bnd_fixed[], const B_RR_ptr_t &B_RR_ptr, const B_RX_ptr_t &B_RX_ptr, BLAS_Cpp::Transp B_RX_trans, const B_XX_ptr_t &B_XX_ptr)
Initialize the matrix.
value_type transVtMtV(const SpVectorSlice &sv_rhs1, BLAS_Cpp::Transp trans_rhs2, const SpVectorSlice &sv_rhs3) const
MatrixHessianSuperBasic()
Constructs to uninitialized.
void Vp_StPtMtV(DVectorSlice *vs_lhs, value_type alpha, const GenPermMatrixSlice &P_rhs1, BLAS_Cpp::Transp P_rhs1_trans, BLAS_Cpp::Transp M_rhs2_trans, const DVectorSlice &sv_rhs3, value_type beta) const
void Vp_StMtV(DVectorSlice *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const DVectorSlice &vs_rhs2, value_type beta) const
size_t size_type
Matrix class that represents a hessian matrix where only the super submatrix for the super basic vari...
Transp
Teuchos::RCP< const MatrixSymWithOpFactorized > B_RR_ptr_t