AbstractLinAlgPack: C++ Interfaces For Vectors, Matrices And Related Linear Algebra Objects Version of the Day
Classes
AbstractLinAlgPack::MatrixSparseCOORSerial Class Reference

Coordinate matrix subclass. More...

#include <AbstractLinAlgPack_MatrixSparseCOORSerial.hpp>

Inheritance diagram for AbstractLinAlgPack::MatrixSparseCOORSerial:
Inheritance graph
[legend]

List of all members.

Classes

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

Public types

typedef Teuchos::RCP
< MemMngPack::ReleaseResource > 
release_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_type * val ()
 
const value_type * val () const
 
index_type * row_i ()
 
const index_type * row_i () const
 
index_type * col_j ()
 
const index_type * col_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
 

Detailed Description

Coordinate matrix subclass.

ToDo: Finish documentation!

Definition at line 57 of file AbstractLinAlgPack_MatrixSparseCOORSerial.hpp.


Member Typedef Documentation


Constructor & Destructor Documentation

AbstractLinAlgPack::MatrixSparseCOORSerial::MatrixSparseCOORSerial ( )

Let this allocate its own memory.

Definition at line 76 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:

  • max_nz > 0 (throw std::invalid_argument)
  • val != NULL (throw std::invalid_argument)
  • row_i != NULL (throw std::invalid_argument)
  • col_j != NULL (throw std::invalid_argument)
  • rows >= 0 (throw std::invalid_argument)
  • [rows > 0] cols > 0 (throw std::invalid_argument)
  • [rows > 0] 0 <= nz <= max_nz (throw std::invalid_argument)
  • [nz > 0] 1 <= row_i[k] <= rows, for k = 0...nz-1 (throw std::invalid_argument)
  • [nz > 0] 1 <= col_j[k] <= cols, for k = 0...nz-1 (throw std::invalid_argument)

Postconditions:

Definition at line 87 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

void AbstractLinAlgPack::MatrixSparseCOORSerial::set_uninitialized ( )

Release all owned memory and make uninitialized.

Postconditions:

  • On the next call to this->reinitialize(rows,cols,max_nz) this will allocate its own memory.

Definition at line 131 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

value_type * AbstractLinAlgPack::MatrixSparseCOORSerial::val ( ) [inline]
const value_type * AbstractLinAlgPack::MatrixSparseCOORSerial::val ( ) const [inline]
index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::row_i ( ) [inline]
const index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::row_i ( ) const [inline]
index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::col_j ( ) [inline]
const index_type * AbstractLinAlgPack::MatrixSparseCOORSerial::col_j ( ) const [inline]
const MatrixSparseCOORSerial::release_resource_ptr_t & AbstractLinAlgPack::MatrixSparseCOORSerial::release_resource ( ) const [inline]
size_type AbstractLinAlgPack::MatrixSparseCOORSerial::rows ( ) const [virtual]

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 148 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

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

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 153 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

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

Reimplemented from AbstractLinAlgPack::MatrixBase.

Definition at line 158 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

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

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 175 of file AbstractLinAlgPack_MatrixSparseCOORSerial.cpp.

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

Reimplemented from AbstractLinAlgPack::MatrixOp.

Definition at line 197 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]
void AbstractLinAlgPack::MatrixSparseCOORSerial::reinitialize ( size_type  rows,
size_type  cols,
size_type  max_nz,
EAssumeElementUniqueness  element_uniqueness 
) [virtual]
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 286 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]
void AbstractLinAlgPack::MatrixSparseCOORSerial::commit_load_nonzeros_buffers ( size_type  nz_commit,
value_type **  val,
index_type **  row_i,
index_type **  col_j 
) [virtual]
void AbstractLinAlgPack::MatrixSparseCOORSerial::finish_construction ( bool  test_setup) [virtual]
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]
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]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends