44 #include "AbstractLinAlgPack_MatrixConvertToSparseEncap.hpp"
45 #include "AbstractLinAlgPack_MatrixExtractSparseElements.hpp"
46 #include "AbstractLinAlgPack_VectorSpace.hpp"
47 #include "DenseLinAlgPack_IVector.hpp"
48 #include "Teuchos_Assert.hpp"
50 namespace AbstractLinAlgPack {
69 ,
const value_type alpha
72 this->
initialize(mese,inv_row_perm,row_rng,inv_col_perm,col_rng,mese_trans,alpha);
82 ,
const value_type alpha
85 const size_type mese_rows = mese->rows(), mese_cols = mese->cols();
86 const Range1D row_rng = RangePack::full_range(row_rng_in,1,mese_rows);
87 const Range1D col_rng = RangePack::full_range(col_rng_in,1,mese_cols);
89 const char msg_head[] =
"MatrixConvertToSparseEncap::initialize(...): Error!";
105 ? mese_->space_cols().sub_space(row_rng_)
106 : mese_->space_rows().sub_space(col_rng_) );
108 ? mese_->space_rows().sub_space(col_rng_)
109 : mese_->space_cols().sub_space(row_rng_) );
114 namespace mmp = MemMngPack;
115 mese_ = Teuchos::null;
116 inv_row_perm_ = Teuchos::null;
118 inv_col_perm_ = Teuchos::null;
159 index_type dl = 0, du = 0;
168 switch(extract_region) {
170 dl = -(index_type)row_rng_.ubound() + (index_type)col_rng_.lbound();
171 du = +(index_type)col_rng_.ubound() - (index_type)row_rng_.lbound();
174 dl = -(index_type)row_rng_.lbound() + (index_type)col_rng_.lbound();
175 du = +(index_type)col_rng_.ubound() - (index_type)row_rng_.lbound();
178 dl = -(index_type)row_rng_.ubound() + (index_type)col_rng_.lbound();
179 du = +(index_type)col_rng_.lbound() - (index_type)row_rng_.lbound();
187 return mese_->count_nonzeros(
201 ,
const index_type len_Aval
203 ,
const index_type len_Aij
206 ,
const index_type row_offset
207 ,
const index_type col_offset
210 index_type dl = 0, du = 0;
211 switch(extract_region) {
213 dl = -(index_type)row_rng_.ubound() + (index_type)col_rng_.lbound();
214 du = +(index_type)col_rng_.ubound() - (index_type)row_rng_.lbound();
217 dl = -(index_type)row_rng_.lbound() + (index_type)col_rng_.lbound();
218 du = +(index_type)col_rng_.ubound() - (index_type)row_rng_.lbound();
221 dl = -(index_type)row_rng_.ubound() + (index_type)col_rng_.lbound();
222 du = +(index_type)col_rng_.lbound() - (index_type)row_rng_.lbound();
230 mese_->coor_extract_nonzeros(
Extract the nonzero elements from the full matrix.
const value_type alpha() const
const mese_ptr_t & mese() const
void set_uninitialized()
Set uninitialized.
const i_vector_ptr_t & inv_row_perm() const
const VectorSpace & space_rows() const
index_type num_nonzeros(EExtractRegion extract_region, EElementUniqueness element_uniqueness) const
const Range1D & row_rng() const
const i_vector_ptr_t & inv_col_perm() const
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
const BLAS_Cpp::Transp mese_trans() const
Abstract interface for objects that represent a space for mutable coordinate vectors.
void coor_extract_nonzeros(EExtractRegion extract_region, EElementUniqueness element_uniqueness, const index_type len_Aval, value_type Aval[], const index_type len_Aij, index_type Arow[], index_type Acol[], const index_type row_offset, const index_type col_offset) const
MatrixConvertToSparseEncap()
Construct to uninitialized.
Entries with duplicate row and column indexes are allowed with the understanding that the values are ...
Extract the nonzero elements from the lower triangular region including the diagonal.
static const Range1D Invalid
const VectorSpace & space_cols() const
const Range1D & col_rng() const
void initialize(const mese_ptr_t &mese, const i_vector_ptr_t &inv_row_perm, const Range1D &row_rng, const i_vector_ptr_t &inv_col_perm, const Range1D &col_rng, const BLAS_Cpp::Transp mese_trans, const value_type alpha=1.0)
Initialize a permuted view of a sparse matrix.
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)
Extract the nonzero elements from the upper triangular region including the diagonal.