MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ConstrainedOptPack_MatrixGenBanded.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 MATRIX_GEN_BANDED_H
43 #define MATRIX_GEN_BANDED_H
44 
46 #include "AbstractLinAlgPack/src/AbstractLinAlgPack_MatrixOp.hpp"
48 #include "Miref_count_ptr.h"
49 #include "MiReleaseResource.h"
50 
51 namespace ConstrainedOptPack {
72 class MatrixGenBanded : public MatrixOp
73 {
74 public:
75 
77  typedef Teuchos::RCP<
79 
80  // //////////////
81  // Constructors
82 
88  size_type m = 0
89  ,size_type n = 0
90  ,size_type kl = 0
91  ,size_type ku = 0
92  ,DMatrixSlice *MB = NULL
93  ,const release_resource_ptr_t& MB_release_resource_ptr = NULL
94  );
95 
96  // ///////////////////////////
97  // Access representation
98 
117  void initialize(
118  size_type m = 0
119  ,size_type n = 0
120  ,size_type kl = 0
121  ,size_type ku = 0
122  ,DMatrixSlice *MB = NULL
123  ,const release_resource_ptr_t& MB_release_resource_ptr = NULL
124  );
125 
127  size_type kl() const;
129  size_type ku() const;
132  DMatrixSlice& MB();
134  const DMatrixSlice& MB() const;
135 
136  // /////////////////////////////
137  // Overridden from MatrixOp
138 
140  size_type rows() const;
142  size_type cols() const;
144  size_type nz() const;
146  std::ostream& output(std::ostream& out) const;
148  void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
149  , const DVectorSlice& vs_rhs2, value_type beta) const;
151  void Vp_StMtV(DVectorSlice* vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1
152  , const SpVectorSlice& sv_rhs2, value_type beta) const;
154  void Vp_StPtMtV(DVectorSlice* vs_lhs, value_type alpha
155  , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
156  , BLAS_Cpp::Transp M_rhs2_trans
157  , const DVectorSlice& vs_rhs3, value_type beta) const;
159  void Vp_StPtMtV(DVectorSlice* vs_lhs, value_type alpha
160  , const GenPermMatrixSlice& P_rhs1, BLAS_Cpp::Transp P_rhs1_trans
161  , BLAS_Cpp::Transp M_rhs2_trans
162  , const SpVectorSlice& sv_rhs3, value_type beta) const;
163 
164 private:
165 
166  // /////////////////////////////
167  // Private data members
168 
175 
176  // /////////////////////////////
177  // Private member functions
178 
179  void assert_initialized() const;
180 
181 }; // end class MatrixGenBanded
182 
183 // ///////////////////////////////////////////////////////
184 // Inline members for MatrixGenBanded
185 
186 inline
188 {
189  return kl_;
190 }
191 
192 inline
194 {
195  return ku_;
196 }
197 
198 inline
200 {
201  return MB_;
202 }
203 
204 inline
206 {
207  return MB_;
208 }
209 
210 } // end namespace ConstrainedOptPack
211 
212 #endif // MATRIX_GEN_BANDED_H
AbstractLinAlgPack::size_type size_type
Matrix subclass for general (possibly singular) banded matrices.
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 &vs_rhs3, value_type beta) const
void initialize(size_type m=0, size_type n=0, size_type kl=0, size_type ku=0, DMatrixSlice *MB=NULL, const release_resource_ptr_t &MB_release_resource_ptr=NULL)
Initialize.
Abstract interface for releasing an object when it is not needed anymore {abstract}.
std::ostream * out
SparseVectorSlice< SparseElement< index_type, value_type > > SpVectorSlice
DenseLinAlgPack::VectorSliceTmpl< value_type > DVectorSlice
MatrixGenBanded(size_type m=0, size_type n=0, size_type kl=0, size_type ku=0, DMatrixSlice *MB=NULL, const release_resource_ptr_t &MB_release_resource_ptr=NULL)
Construct and Initialize.
void Vp_StMtV(DVectorSlice *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const DVectorSlice &vs_rhs2, value_type beta) const
AbstractLinAlgPack::value_type value_type
Teuchos::RCP< MemMngPack::ReleaseResource > release_resource_ptr_t
std::ostream & output(std::ostream &out) const
DenseLinAlgPack::DMatrixSlice DMatrixSlice
Transp
TRANS.