AbstractLinAlgPack_MatrixConvertToSparseEncap.hpp

00001 // @HEADER
00002 // ***********************************************************************
00003 // 
00004 // Moocho: Multi-functional Object-Oriented arCHitecture for Optimization
00005 //                  Copyright (2003) Sandia Corporation
00006 // 
00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
00008 // license for use of this work by or on behalf of the U.S. Government.
00009 // 
00010 // This library is free software; you can redistribute it and/or modify
00011 // it under the terms of the GNU Lesser General Public License as
00012 // published by the Free Software Foundation; either version 2.1 of the
00013 // License, or (at your option) any later version.
00014 //  
00015 // This library is distributed in the hope that it will be useful, but
00016 // WITHOUT ANY WARRANTY; without even the implied warranty of
00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018 // Lesser General Public License for more details.
00019 //  
00020 // You should have received a copy of the GNU Lesser General Public
00021 // License along with this library; if not, write to the Free Software
00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00023 // USA
00024 // Questions? Contact Roscoe A. Bartlett (rabartl@sandia.gov) 
00025 // 
00026 // ***********************************************************************
00027 // @HEADER
00028 
00029 #ifndef MATRIX_CONVERT_TO_SPARSE_ENCAP_H
00030 #define MATRIX_CONVERT_TO_SPARSE_ENCAP_H
00031 
00032 #include "AbstractLinAlgPack_MatrixConvertToSparse.hpp"
00033 #include "Teuchos_RefCountPtr.hpp"
00034 
00035 namespace AbstractLinAlgPack {
00036 
00041 class MatrixConvertToSparseEncap
00042   : virtual public MatrixConvertToSparse
00043 {
00044 public:
00045 
00048 
00050   typedef Teuchos::RefCountPtr<const MatrixExtractSparseElements>  mese_ptr_t;
00052   typedef Teuchos::RefCountPtr<const IVector>                      i_vector_ptr_t;
00053 
00055 
00058 
00061   MatrixConvertToSparseEncap();
00062 
00065   MatrixConvertToSparseEncap(
00066     const mese_ptr_t           &mese
00067     ,const i_vector_ptr_t      &inv_row_perm
00068     ,const Range1D             &row_rng
00069     ,const i_vector_ptr_t      &inv_col_perm
00070     ,const Range1D             &col_rng
00071     ,const BLAS_Cpp::Transp    mese_trans
00072     ,const value_type          alpha = 1.0
00073     );
00074 
00081   void initialize(
00082     const mese_ptr_t           &mese
00083     ,const i_vector_ptr_t      &inv_row_perm
00084     ,const Range1D             &row_rng
00085     ,const i_vector_ptr_t      &inv_col_perm
00086     ,const Range1D             &col_rng
00087     ,const BLAS_Cpp::Transp    mese_trans
00088     ,const value_type          alpha = 1.0
00089     );
00090 
00095   void set_uninitialized();
00096 
00098 
00101 
00103   const mese_ptr_t& mese() const;
00105   const i_vector_ptr_t& inv_row_perm() const;
00107   const Range1D& row_rng() const;
00109   const i_vector_ptr_t& inv_col_perm() const;
00111   const Range1D& col_rng() const;
00113   const BLAS_Cpp::Transp mese_trans() const;
00115   const value_type alpha() const;
00116 
00118 
00121 
00123   const VectorSpace& space_cols() const;
00125   const VectorSpace& space_rows() const;
00127   size_type rows() const;
00129   size_type cols() const;
00131   size_type nz() const;
00132 
00134 
00137 
00139   index_type num_nonzeros(
00140     EExtractRegion        extract_region
00141     ,EElementUniqueness   element_uniqueness
00142     ) const;
00143 
00145   void coor_extract_nonzeros(
00146     EExtractRegion                extract_region
00147     ,EElementUniqueness           element_uniqueness
00148     ,const index_type             len_Aval
00149     ,value_type                   Aval[]
00150     ,const index_type             len_Aij
00151     ,index_type                   Arow[]
00152     ,index_type                   Acol[]
00153     ,const index_type             row_offset
00154     ,const index_type             col_offset
00155     ) const;
00156 
00158 
00159 private:
00160 
00161   typedef Teuchos::RefCountPtr<const VectorSpace> space_ptr_t;  
00162 
00163 #ifdef DOXYGEN_COMPILE
00164   const MatrixExtractSparseElements    *mese;
00165   const DenseLinAlgPack::IVector            *inv_row_perm;
00166   Range1D                              row_rng;
00167   const DenseLinAlgPack::IVector            *inv_col_perm;
00168   Range1D                              col_rng;
00169 #else
00170   mese_ptr_t          mese_;
00171   BLAS_Cpp::Transp    mese_trans_;
00172   value_type          alpha_;
00173   Range1D             row_rng_;
00174   Range1D             col_rng_;
00175   i_vector_ptr_t      inv_row_perm_;
00176   i_vector_ptr_t      inv_col_perm_;
00177   size_type           nz_full_;
00178   space_ptr_t         space_cols_;
00179   space_ptr_t         space_rows_;
00180 #endif
00181 
00182 };  // end class MatrixConvertToSparseEncap
00183 
00184 // /////////////////////////////////////////////
00185 // Inline members
00186 
00187 // Access
00188 
00189 inline
00190 const MatrixConvertToSparseEncap::mese_ptr_t&
00191 MatrixConvertToSparseEncap::mese() const
00192 {
00193   return mese_;
00194 }
00195 
00196 inline
00197 const MatrixConvertToSparseEncap::i_vector_ptr_t&
00198 MatrixConvertToSparseEncap::inv_row_perm() const
00199 {
00200   return inv_row_perm_;
00201 }
00202 
00203 inline
00204 const Range1D& MatrixConvertToSparseEncap::row_rng() const
00205 {
00206   return row_rng_;
00207 }
00208 
00209 inline
00210 const MatrixConvertToSparseEncap::i_vector_ptr_t&
00211 MatrixConvertToSparseEncap::inv_col_perm() const
00212 {
00213   return inv_col_perm_;
00214 }
00215 
00216 inline
00217 const Range1D& MatrixConvertToSparseEncap::col_rng() const
00218 {
00219   return col_rng_;
00220 }
00221 
00222 inline
00223 const BLAS_Cpp::Transp
00224 MatrixConvertToSparseEncap::mese_trans() const
00225 {
00226   return mese_trans_;
00227 }
00228 
00229 inline
00230 const value_type MatrixConvertToSparseEncap::alpha() const
00231 {
00232   return alpha_;
00233 }
00234   
00235 } // end namespace AbstractLinAlgPack 
00236 
00237 #endif  // MATRIX_CONVERT_TO_SPARSE_ENCAP_H

Generated on Thu Sep 18 12:33:51 2008 for AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects by doxygen 1.3.9.1