AbstractLinAlgPack::MatrixSparseCOORSerial Class Reference

Coordinate matrix subclass. More...

#include <AbstractLinAlgPack_MatrixSparseCOORSerial.hpp>

Inheritance diagram for AbstractLinAlgPack::MatrixSparseCOORSerial:

[legend]
List of all members.

Public types

typedef Teuchos::RCP< MemMngPack::ReleaseResourcerelease_resource_ptr_t
 

Constructors / initializers

 MatrixSparseCOORSerial ()
 Let this allocate its own memory.
void set_buffers (size_type max_nz, value_type *val, index_type *row_i, index_type *col_j, const release_resource_ptr_t &release_resource, size_type rows=0, size_type cols=0, size_type nz=0, bool check_input=false)
 Give memory to use to store nonzero elements.
void set_uninitialized ()
 Release all owned memory and make uninitialized.

Access

value_typeval ()
 
const value_typeval () const
 
index_typerow_i ()
 
const index_typerow_i () const
 
index_typecol_j ()
 
const index_typecol_j () const
 
const release_resource_ptr_trelease_resource () const
 

Overridden from MatrixBase

size_type rows () const
 
size_type cols () const
 
size_type nz () const
 

Overridden from MatrixOp

const VectorSpacespace_cols () const
 
const VectorSpacespace_rows () const
 
MatrixOpoperator= (const MatrixOp &M)
 
std::ostream & output (std::ostream &out) const
 
void Vp_StMtV (VectorMutable *vs_lhs, value_type alpha, BLAS_Cpp::Transp trans_rhs1, const Vector &v_rhs2, value_type beta) const
 

Overridden from MatrixLoadSparseElements

void reinitialize (size_type rows, size_type cols, size_type max_nz, EAssumeElementUniqueness element_uniqueness)
 
void reset_to_load_values ()
 Reinitialize internal counter to load new nonzero values.
void get_load_nonzeros_buffers (size_type max_nz_load, value_type **val, index_type **row_i, index_type **col_j)
 
void commit_load_nonzeros_buffers (size_type nz_commit, value_type **val, index_type **row_i, index_type **col_j)
 
void finish_construction (bool test_setup)
 

Overridden from MatrixExtractSparseElements

index_type count_nonzeros (EElementUniqueness element_uniqueness, const index_type inv_row_perm[], const index_type inv_col_perm[], const Range1D &row_rng, const Range1D &col_rng, index_type dl, index_type du) const
 
void coor_extract_nonzeros (EElementUniqueness element_uniqueness, const index_type inv_row_perm[], const index_type inv_col_perm[], const Range1D &row_rng, const Range1D &col_rng, index_type dl, index_type du, value_type alpha, 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
 

Private Member Functions

void make_storage_unique ()

Private Attributes

size_type rows_
size_type cols_
size_type max_nz_
EAssumeElementUniqueness element_uniqueness_
size_type nz_
value_typeval_
index_typerow_i_
index_typecol_j_
release_resource_ptr_t release_resource_
bool self_allocate_
VectorSpaceSerial space_cols_
VectorSpaceSerial space_rows_
size_type max_nz_load_
bool reload_val_only_
size_type reload_val_only_nz_last_

Static Private Attributes

static release_resource_ptr_t release_resource_null_ = Teuchos::null

Classes

class  ReleaseValRowColArrays
 Subclass to delete dynamically allocated memory with delete[]. More...

Detailed Description

Coordinate matrix subclass.

ToDo: Finish documentation!

Definition at line 44 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.


Member Typedef Documentation

typedef Teuchos::RCP< MemMngPack::ReleaseResource> AbstractLinAlgPack::MatrixSparseCOORSerial::release_resource_ptr_t

Definition at line 56 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.


Constructor & Destructor Documentation

AbstractLinAlgPack::MatrixSparseCOORSerial::MatrixSparseCOORSerial (  ) 

Let this allocate its own memory.

Definition at line 63 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.


Member Function Documentation

void AbstractLinAlgPack::MatrixSparseCOORSerial::set_buffers ( size_type  max_nz,
value_type val,
index_type row_i,
index_type col_j,
const release_resource_ptr_t release_resource,
size_type  rows = 0,
size_type  cols = 0,
size_type  nz = 0,
bool  check_input = false 
)

Give memory to use to store nonzero elements.

Parameters:
max_nz [in] Size of the buffers val[], row_i[] and col_j[]. It is allowed for max_nz == 0 in which case this matrix will not have any nonzero elements (i.e. the zero matrix).
val [in] Buffer to store the nonzero entry values. On input val[k], for k = 0...nz-1 must be set to valid nonzero entry values if rows > 0 && nz > 0.
row_i [in] Buffer to store the nonzero entry row indexes. On input row_i[k], for k = 0...nz-1 must be set to valid nonzero entry row indexes if rows > 0 && nz > 0.
col_j [in] Buffer to store the nonzero entry row indexes. On input col_j[k], for k = 0...nz-1 must be set to valid nonzero entry row indexes if rows > 0 && nz > 0.
release_resource [in] Smart pointer to a MemMngPack::ReleaseResouce object that will deallocate the memory for the buffers val[], row_i[] and col_j[] when this is finished with them. It is allowed for release_resource.get() == NULL in which case the client will be responsible to free this memory. The client can use the subclass ReleaseValRowColArrays to allow this to delete memory created with new[] by setting release_resource = Teuchos::rcp( new ReleaseValRowColArrays(val,row_i,col_j) ) where val, row_i and col_j where allocated with new[]. The release_resource object represents the sharing of the data val[], row_i[] and col_j[].
rows [in] Number of rows in the matrix. Default = 0 for fully uninitialized.
cols [in] Number of columns in the matrix. Ignored if rows == 0.
nz [in] Number of nonzero elements in val[], row_i[] and col_j[] already set. Setting a value of nz > 0 allows the client to setup a matrix object with nonzero elements ready to go. Ignored if rows == 0.
check_input [in] If true and rows > 0 && nz > 0 then the row and colunmn indexes in row_i[] and col_j[] will be checked! The defualt is false.
Preconditions:

Postconditions:

Definition at line 74 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::set_uninitialized (  ) 

Release all owned memory and make uninitialized.

Postconditions:

Definition at line 118 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

value_type * AbstractLinAlgPack::MatrixSparseCOORSerial::val (  )  [inline]

Definition at line 336 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

const value_type * AbstractLinAlgPack::MatrixSparseCOORSerial::val (  )  const [inline]

Definition at line 343 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::row_i (  )  [inline]

Definition at line 349 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

const index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::row_i (  )  const [inline]

Definition at line 356 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::col_j (  )  [inline]

Definition at line 362 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

const index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::col_j (  )  const [inline]

Definition at line 369 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

const MatrixSparseCOORSerial::release_resource_ptr_t & AbstractLinAlgPack::MatrixSparseCOORSerial::release_resource (  )  const [inline]

Definition at line 376 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::rows (  )  const [virtual]

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 135 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::cols (  )  const [virtual]

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 140 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::nz (  )  const [virtual]

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 145 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

const VectorSpace & AbstractLinAlgPack::MatrixSparseCOORSerial::space_cols (  )  const [virtual]

Implements AbstractLinAlgPack::MatrixBase.

Definition at line 152 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

const VectorSpace & AbstractLinAlgPack::MatrixSparseCOORSerial::space_rows (  )  const [virtual]

Implements AbstractLinAlgPack::MatrixBase.

Definition at line 157 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

MatrixOp & AbstractLinAlgPack::MatrixSparseCOORSerial::operator= ( const MatrixOp M  )  [virtual]

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 162 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

std::ostream & AbstractLinAlgPack::MatrixSparseCOORSerial::output ( std::ostream &  out  )  const [virtual]

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 184 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::Vp_StMtV ( VectorMutable vs_lhs,
value_type  alpha,
BLAS_Cpp::Transp  trans_rhs1,
const Vector v_rhs2,
value_type  beta 
) const [virtual]

Implements AbstractLinAlgPack::MatrixOp.

Definition at line 211 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::reinitialize ( size_type  rows,
size_type  cols,
size_type  max_nz,
EAssumeElementUniqueness  element_uniqueness 
)

Definition at line 229 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::reset_to_load_values (  )  [virtual]

Reinitialize internal counter to load new nonzero values.

The row and column index arrays are preserved from the last setup and here the client only wants to set the nonzero values for the same matrix structure.

ToDo: Finish documentation!

Implements AbstractLinAlgPack::MatrixLoadSparseElements.

Definition at line 273 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::get_load_nonzeros_buffers ( size_type  max_nz_load,
value_type **  val,
index_type **  row_i,
index_type **  col_j 
) [virtual]

Implements AbstractLinAlgPack::MatrixLoadSparseElements.

Definition at line 288 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::commit_load_nonzeros_buffers ( size_type  nz_commit,
value_type **  val,
index_type **  row_i,
index_type **  col_j 
) [virtual]

Implements AbstractLinAlgPack::MatrixLoadSparseElements.

Definition at line 324 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::finish_construction ( bool  test_setup  )  [virtual]

Implements AbstractLinAlgPack::MatrixLoadSparseElements.

Definition at line 356 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

index_type AbstractLinAlgPack::MatrixSparseCOORSerial::count_nonzeros ( EElementUniqueness  element_uniqueness,
const index_type  inv_row_perm[],
const index_type  inv_col_perm[],
const Range1D row_rng,
const Range1D col_rng,
index_type  dl,
index_type  du 
) const [virtual]

Implements AbstractLinAlgPack::MatrixExtractSparseElements.

Definition at line 396 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::coor_extract_nonzeros ( EElementUniqueness  element_uniqueness,
const index_type  inv_row_perm[],
const index_type  inv_col_perm[],
const Range1D row_rng,
const Range1D col_rng,
index_type  dl,
index_type  du,
value_type  alpha,
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 [virtual]

Implements AbstractLinAlgPack::MatrixExtractSparseElements.

Definition at line 482 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::make_storage_unique (  )  [private]

Definition at line 627 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.


Member Data Documentation

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::rows_ [private]

Definition at line 303 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::cols_ [private]

Definition at line 304 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::max_nz_ [private]

Definition at line 305 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

EAssumeElementUniqueness AbstractLinAlgPack::MatrixSparseCOORSerial::element_uniqueness_ [private]

Definition at line 306 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::nz_ [private]

Definition at line 307 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

value_type* AbstractLinAlgPack::MatrixSparseCOORSerial::val_ [private]

Definition at line 308 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

index_type* AbstractLinAlgPack::MatrixSparseCOORSerial::row_i_ [private]

Definition at line 309 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

index_type* AbstractLinAlgPack::MatrixSparseCOORSerial::col_j_ [private]

Definition at line 310 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

release_resource_ptr_t AbstractLinAlgPack::MatrixSparseCOORSerial::release_resource_ [private]

Definition at line 311 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

bool AbstractLinAlgPack::MatrixSparseCOORSerial::self_allocate_ [private]

Definition at line 313 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

VectorSpaceSerial AbstractLinAlgPack::MatrixSparseCOORSerial::space_cols_ [private]

Definition at line 315 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

VectorSpaceSerial AbstractLinAlgPack::MatrixSparseCOORSerial::space_rows_ [private]

Definition at line 316 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::max_nz_load_ [private]

Definition at line 318 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

bool AbstractLinAlgPack::MatrixSparseCOORSerial::reload_val_only_ [private]

Definition at line 319 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

size_type AbstractLinAlgPack::MatrixSparseCOORSerial::reload_val_only_nz_last_ [private]

Definition at line 320 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.

MatrixSparseCOORSerial::release_resource_ptr_t AbstractLinAlgPack::MatrixSparseCOORSerial::release_resource_null_ = Teuchos::null [static, private]

Definition at line 328 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.


The documentation for this class was generated from the following files:
Generated on Tue Oct 20 12:54:06 2009 for MOOCHO (Single Doxygen Collection) by doxygen 1.4.7