Psi4
Public Member Functions | Protected Attributes | Private Member Functions | List of all members
psi::View Class Reference

Provides a view to a region of the matrix. More...

#include <view.h>

Public Member Functions

virtual ~View ()
 
 View (int nirrep, int *rows, int *cols)
 
 View (int nirrep, int *rows, int *cols, int *row_offsets, int *col_offsets)
 
 View (SharedMatrix matrix, const Dimension &rows, const Dimension &cols)
 
 View (SharedMatrix matrix, const Dimension &rows, const Dimension &cols, const Dimension &row_offsets, const Dimension &col_offsets)
 
SharedMatrix operator() ()
 
SharedMatrix view (SharedMatrix matrix)
 

Protected Attributes

SharedMatrix matrix_
 Matrix we are viewing. More...
 
int nirrep_
 Number of irreps. More...
 
int * row_offset_per_irrep_
 Starting offsets in matrix_;. More...
 
int * col_offset_per_irrep_
 
int * rows_per_irrep_
 Number of rows we are viewing. More...
 
int * cols_per_irrep_
 

Private Member Functions

 View ()
 
 View (const View &)
 

Detailed Description

Provides a view to a region of the matrix.

Constructor & Destructor Documentation

psi::View::View ( )
private
psi::View::View ( const View )
private
psi::View::~View ( )
virtual
psi::View::View ( int  nirrep,
int *  rows,
int *  cols 
)

Constructor, assumes offsets for each irrep is 0

Parameters
nirrepNumber of irreps
rowsHow many rows per irrep are we interested in
colsHow many cols per irrep are we interested in
psi::View::View ( int  nirrep,
int *  rows,
int *  cols,
int *  row_offsets,
int *  col_offsets 
)

Constructor, user provides offsets and dimensions.

Parameters
nirrepNumber of irreps
rowsHow many rows per irrep
colsHow many cols per irrep
row_offsetsRow offset per irrep
col_offsetsColumn offset per irrep
psi::View::View ( SharedMatrix  matrix,
const Dimension rows,
const Dimension cols 
)

Constructor, user provides a Matrix to view and desired row count

Parameters
matrixMatrix we want to view, View obtains nirrep from it
rowsHow many rows per irrep
colsHow many cols per irrep
psi::View::View ( SharedMatrix  matrix,
const Dimension rows,
const Dimension cols,
const Dimension row_offsets,
const Dimension col_offsets 
)

Constructor, user provides a Matrix to view and desired row count

Parameters
matrixMatrix we want to view, View obtains nirrep from it
rowsHow many rows per irrep
colsHow many cols per irrep
row_offsetsRow offset per irrep
col_offsetsColumn offset per irrep

Member Function Documentation

SharedMatrix psi::View::operator() ( )

Operator () overload. Creates a new Matrix that only contains the view.

Returns
New Matrix containing the view.
SharedMatrix psi::View::view ( SharedMatrix  matrix)

Set the Matrix that we should be viewing.

Parameters
matrixMatrix to view.
Returns
The old Matrix we were viewing.

Member Data Documentation

int* psi::View::col_offset_per_irrep_
protected
int* psi::View::cols_per_irrep_
protected
SharedMatrix psi::View::matrix_
protected

Matrix we are viewing.

int psi::View::nirrep_
protected

Number of irreps.

int* psi::View::row_offset_per_irrep_
protected

Starting offsets in matrix_;.

int* psi::View::rows_per_irrep_
protected

Number of rows we are viewing.


The documentation for this class was generated from the following files: