GQCP
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GQCP::ImplicitMatrixSlice< _Scalar > Class Template Reference

#include <ImplicitMatrixSlice.hpp>

Collaboration diagram for GQCP::ImplicitMatrixSlice< _Scalar >:
Collaboration graph

Public Types

using Scalar = _Scalar
 

Public Member Functions

 ImplicitMatrixSlice (const std::map< size_t, size_t > &rows_implicit_to_dense, const std::map< size_t, size_t > &cols_implicit_to_dense, const MatrixX< Scalar > &M)
 
 ImplicitMatrixSlice (const std::map< size_t, size_t > &rows_implicit_to_dense, const std::map< size_t, size_t > &cols_implicit_to_dense)
 
 ImplicitMatrixSlice ()
 
Scalar operator() (const size_t row, const size_t col) const
 
Scalaroperator() (const size_t row, const size_t col)
 
const MatrixX< Scalar > & asMatrix () const
 
VectorX< ScalarasVector () const
 
const std::map< size_t, size_t > & columnIndexMap () const
 
size_t denseIndexOfColumn (const size_t col) const
 
size_t denseIndexOfRow (const size_t row) const
 
const std::map< size_t, size_t > & rowIndexMap () const
 

Static Public Member Functions

static ImplicitMatrixSlice< ScalarFromBlockRanges (const size_t row_start, const size_t row_end, const size_t col_start, const size_t col_end, const MatrixX< Scalar > &M)
 
static ImplicitMatrixSlice< ScalarFromIndices (const std::vector< size_t > &row_indices, const std::vector< size_t > &col_indices, const MatrixX< Scalar > &M)
 
static ImplicitMatrixSlice< ScalarZeroFromBlockRanges (const size_t row_start, const size_t row_end, const size_t col_start, const size_t col_end)
 
static ImplicitMatrixSlice< ScalarZeroFromIndices (const std::vector< size_t > &row_indices, const std::vector< size_t > &col_indices)
 

Detailed Description

template<typename _Scalar>
class GQCP::ImplicitMatrixSlice< _Scalar >

A slice of a matrix that only exists implicitly.

If the full matrix is unnecessary to know, and only a certain slice of the matrix is of interest, this class implements operator() that can be used with the row and column indices of the full matrix.

Template Parameters
_Scalarthe scalar representation of one element of the encapsulating matrix

Member Typedef Documentation

◆ Scalar

template<typename _Scalar >
using GQCP::ImplicitMatrixSlice< _Scalar >::Scalar = _Scalar

Constructor & Destructor Documentation

◆ ImplicitMatrixSlice() [1/3]

template<typename _Scalar >
GQCP::ImplicitMatrixSlice< _Scalar >::ImplicitMatrixSlice ( const std::map< size_t, size_t > &  rows_implicit_to_dense,
const std::map< size_t, size_t > &  cols_implicit_to_dense,
const MatrixX< Scalar > &  M 
)
inline

Initialize an ImplicitMatrixSlice's members.

Parameters
rows_implicit_to_densemaps the row indices of the implicit matrix to the row indices of the dense representation of the slice
cols_implicit_to_densemaps the column indices of the implicit matrix to the column indices of the dense representation of the slice
Mthe dense representation of the slice

◆ ImplicitMatrixSlice() [2/3]

template<typename _Scalar >
GQCP::ImplicitMatrixSlice< _Scalar >::ImplicitMatrixSlice ( const std::map< size_t, size_t > &  rows_implicit_to_dense,
const std::map< size_t, size_t > &  cols_implicit_to_dense 
)
inline

Initialize an ImplicitMatrixSlice's members, with a zero matrix for the dense representation of the slice.

Parameters
rows_implicit_to_densemaps the row indices of the implicit matrix to the row indices of the dense representation of the slice
cols_implicit_to_densemaps the column indices of the implicit matrix to the column indices of the dense representation of the slice

◆ ImplicitMatrixSlice() [3/3]

template<typename _Scalar >
GQCP::ImplicitMatrixSlice< _Scalar >::ImplicitMatrixSlice ( )
inline

A default constructor setting everything to zero.

Member Function Documentation

◆ asMatrix()

template<typename _Scalar >
const MatrixX< Scalar > & GQCP::ImplicitMatrixSlice< _Scalar >::asMatrix ( ) const
inline
Returns
this as a matrix

◆ asVector()

template<typename _Scalar >
VectorX< Scalar > GQCP::ImplicitMatrixSlice< _Scalar >::asVector ( ) const
inline
Returns
this as a (column-major) vector

◆ columnIndexMap()

template<typename _Scalar >
const std::map< size_t, size_t > & GQCP::ImplicitMatrixSlice< _Scalar >::columnIndexMap ( ) const
inline
Returns
the map between the column indices of the implicit matrix and the column indices of the dense representation of the slice

◆ denseIndexOfColumn()

template<typename _Scalar >
size_t GQCP::ImplicitMatrixSlice< _Scalar >::denseIndexOfColumn ( const size_t  col) const
inline

Convert an implicit column index to the column index in the dense representation of this slice.

Parameters
colthe column number in the implicit encapsulating matrix
Returns
the column index the dense representation of this slice.

◆ denseIndexOfRow()

template<typename _Scalar >
size_t GQCP::ImplicitMatrixSlice< _Scalar >::denseIndexOfRow ( const size_t  row) const
inline

Convert an implicit row index to the row index in the dense representation of this slice.

Parameters
rowthe row number in the implicit encapsulating matrix
Returns
the row index the dense representation of this slice.

◆ FromBlockRanges()

template<typename _Scalar >
static ImplicitMatrixSlice< Scalar > GQCP::ImplicitMatrixSlice< _Scalar >::FromBlockRanges ( const size_t  row_start,
const size_t  row_end,
const size_t  col_start,
const size_t  col_end,
const MatrixX< Scalar > &  M 
)
inlinestatic

Construct an ImplicitMatrixSlice from a dense matrix block and corresponding index ranges.

Parameters
row_startthe 0-based row index of the implicit matrix at which the block starts
row_endthe 0-based row index of the implicit matrix at which the block ends (not included)
col_startthe 0-based column index of the implicit matrix at which the block starts
col_endthe 0-based column index of the implicit matrix at which the block ends (not included)
Mthe dense representation of the block
Returns
an implicit matrix slice

◆ FromIndices()

template<typename _Scalar >
static ImplicitMatrixSlice< Scalar > GQCP::ImplicitMatrixSlice< _Scalar >::FromIndices ( const std::vector< size_t > &  row_indices,
const std::vector< size_t > &  col_indices,
const MatrixX< Scalar > &  M 
)
inlinestatic

Create an implicit matrix slice through a dense representation of the slice.

Parameters
row_indicesthe row indices (in order) of the implicit matrix that the row indices of the dense representation of the slice correspond to
col_indicesthe column indices (in order) of the implicit matrix that the column indices of the dense representation of the slice correspond to
Mthe dense representation of the slice
Returns
an implicit matrix slice

◆ operator()() [1/2]

template<typename _Scalar >
Scalar & GQCP::ImplicitMatrixSlice< _Scalar >::operator() ( const size_t  row,
const size_t  col 
)
inline

Access an element of this implicit matrix slice.

Parameters
rowthe row number in the implicit encapsulating matrix
colthe column number in the implicit encapsulating matrix
Returns
a writable element of the implicit encapsulating matrix

◆ operator()() [2/2]

template<typename _Scalar >
Scalar GQCP::ImplicitMatrixSlice< _Scalar >::operator() ( const size_t  row,
const size_t  col 
) const
inline

Access an element of this implicit matrix slice.

Parameters
rowthe row number in the implicit encapsulating matrix
colthe column number in the implicit encapsulating matrix
Returns
a read-only element of the implicit encapsulating matrix

◆ rowIndexMap()

template<typename _Scalar >
const std::map< size_t, size_t > & GQCP::ImplicitMatrixSlice< _Scalar >::rowIndexMap ( ) const
inline
Returns
the map between the row indices of the implicit matrix and the row indices of the dense representation of the slice

◆ ZeroFromBlockRanges()

template<typename _Scalar >
static ImplicitMatrixSlice< Scalar > GQCP::ImplicitMatrixSlice< _Scalar >::ZeroFromBlockRanges ( const size_t  row_start,
const size_t  row_end,
const size_t  col_start,
const size_t  col_end 
)
inlinestatic

Construct a zero ImplicitMatrixSlice with given block ranges.

Parameters
row_startthe 0-based row index of the implicit matrix at which the block starts
row_endthe 0-based row index of the implicit matrix at which the block ends (not included)
col_startthe 0-based column index of the implicit matrix at which the block starts
col_endthe 0-based column index of the implicit matrix at which the block ends (not included)
Mthe dense representation of the block
Returns
a zero implicit matrix slice

◆ ZeroFromIndices()

template<typename _Scalar >
static ImplicitMatrixSlice< Scalar > GQCP::ImplicitMatrixSlice< _Scalar >::ZeroFromIndices ( const std::vector< size_t > &  row_indices,
const std::vector< size_t > &  col_indices 
)
inlinestatic

Create a zero-initialized implicit matrix slice from given allowed row and column indices.

Parameters
row_indicesthe row indices (in order) of the implicit matrix that the row indices of the dense representation of the slice correspond to
col_indicesthe column indices (in order) of the implicit matrix that the column indices of the dense representation of the slice correspond to
Returns
an implicit matrix slice

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