mptensor  v0.3.0
Parallel Library for Tensor Network Methods
mptensor::lapack::Matrix< C > Class Template Reference

Non-distributed matrix using LAPACK. More...

#include <matrix_lapack.hpp>

Public Types

typedef C value_type
 
typedef int comm_type
 

Public Member Functions

 Matrix ()
 Default constructor. More...
 
 Matrix (const comm_type &comm_dummy)
 Constructor. More...
 
 Matrix (size_t n_row, size_t n_col)
 Constructor. More...
 
 Matrix (const comm_type &comm_dummy, size_t n_row, size_t n_col)
 Constructor. More...
 
void init (size_t n_row, size_t n_col)
 
const comm_typeget_comm () const
 Always returns 0. More...
 
int get_comm_size () const
 Always returns 1. More...
 
int get_comm_rank () const
 Always returns 0. More...
 
void print_info (std::ostream &) const
 
const C & operator[] (size_t i) const
 
C & operator[] (size_t i)
 
const C * head () const
 
C * head ()
 
size_t local_size () const
 
void global_index (size_t i, size_t &g_row, size_t &g_col) const
 
bool local_index (size_t g_row, size_t g_col, size_t &i) const
 
void local_position (size_t g_row, size_t g_col, int &comm_rank, size_t &lindex) const
 Convert a global index to an index of local storage. More...
 
size_t local_row_size () const
 
size_t local_col_size () const
 
size_t local_row_index (size_t lindex) const
 
size_t local_col_index (size_t lindex) const
 
size_t global_row_index (size_t lindex_row) const
 
size_t global_col_index (size_t lindex_col) const
 
Matrixoperator+= (const Matrix &rhs)
 
Matrixoperator-= (const Matrix &rhs)
 
Matrixoperator*= (C rhs)
 
Matrixoperator/= (C rhs)
 
template<typename UnaryOperation >
Matrixmap (UnaryOperation op)
 
std::vector< C > flatten ()
 
void barrier () const
 
allreduce_sum (C value) const
 
template<typename D >
void bcast (D *buffer, int count, int root) const
 
void prep_local_to_global () const
 Do nothing. More...
 
void prep_global_to_local () const
 Do nothing. More...
 
int n_row () const
 
int n_col () const
 
const Matrix transpose ()
 
void save_index (const std::string &filename) const
 
template<typename UnaryOperation >
Matrix< C > & map (UnaryOperation op)
 
template<typename UnaryOperation >
Matrix< C > & map (UnaryOperation op)
 

Static Public Attributes

constexpr static size_t matrix_type_tag = MATRIX_TYPE_TAG_LAPACK
 
constexpr static char * matrix_type_name = (char*)"LAPACK"
 

Detailed Description

template<typename C>
class mptensor::lapack::Matrix< C >

Non-distributed matrix using LAPACK.

Note
The matrix is stored in column-major order.

Member Typedef Documentation

◆ comm_type

template<typename C >
typedef int mptensor::lapack::Matrix< C >::comm_type

◆ value_type

template<typename C >
typedef C mptensor::lapack::Matrix< C >::value_type

Constructor & Destructor Documentation

◆ Matrix() [1/4]

template<typename C >
mptensor::lapack::Matrix< C >::Matrix

Default constructor.

The size of matrix is set to 0 times 0.

◆ Matrix() [2/4]

template<typename C >
mptensor::lapack::Matrix< C >::Matrix ( const comm_type comm_dummy)
explicit

Constructor.

Parameters
comm_dummyDummy argument. It is always ignored.

◆ Matrix() [3/4]

template<typename C >
mptensor::lapack::Matrix< C >::Matrix ( size_t  n_row,
size_t  n_col 
)

Constructor.

Parameters
n_rowThe number of rows.
n_colThe number of columns.

◆ Matrix() [4/4]

template<typename C >
mptensor::lapack::Matrix< C >::Matrix ( const comm_type comm_dummy,
size_t  n_row,
size_t  n_col 
)

Constructor.

Parameters
comm_dummyDummy argument. It is always ignored.
n_rowThe number of rows.
n_colThe number of columns.

Member Function Documentation

◆ allreduce_sum()

template<typename C >
C mptensor::lapack::Matrix< C >::allreduce_sum ( value) const
inline

◆ barrier()

template<typename C >
void mptensor::lapack::Matrix< C >::barrier
inline

◆ bcast()

template<typename C >
template<typename D >
void mptensor::lapack::Matrix< C >::bcast ( D *  buffer,
int  count,
int  root 
) const
inline

◆ flatten()

template<typename C >
std::vector< C > mptensor::lapack::Matrix< C >::flatten
inline

◆ get_comm()

template<typename C >
const Matrix< C >::comm_type & mptensor::lapack::Matrix< C >::get_comm
inline

Always returns 0.

◆ get_comm_rank()

template<typename C >
int mptensor::lapack::Matrix< C >::get_comm_rank
inline

Always returns 0.

◆ get_comm_size()

template<typename C >
int mptensor::lapack::Matrix< C >::get_comm_size
inline

Always returns 1.

◆ global_col_index()

template<typename C >
size_t mptensor::lapack::Matrix< C >::global_col_index ( size_t  lindex_col) const
inline

◆ global_index()

template<typename C >
void mptensor::lapack::Matrix< C >::global_index ( size_t  i,
size_t &  g_row,
size_t &  g_col 
) const
inline

◆ global_row_index()

template<typename C >
size_t mptensor::lapack::Matrix< C >::global_row_index ( size_t  lindex_row) const
inline

◆ head() [1/2]

template<typename C >
C * mptensor::lapack::Matrix< C >::head
inline

◆ head() [2/2]

template<typename C >
const C * mptensor::lapack::Matrix< C >::head
inline

◆ init()

template<typename C >
void mptensor::lapack::Matrix< C >::init ( size_t  n_row,
size_t  n_col 
)
inline

◆ local_col_index()

template<typename C >
size_t mptensor::lapack::Matrix< C >::local_col_index ( size_t  lindex) const
inline

◆ local_col_size()

template<typename C >
size_t mptensor::lapack::Matrix< C >::local_col_size
inline

◆ local_index()

template<typename C >
bool mptensor::lapack::Matrix< C >::local_index ( size_t  g_row,
size_t  g_col,
size_t &  i 
) const
inline

◆ local_position()

template<typename C >
void mptensor::lapack::Matrix< C >::local_position ( size_t  g_row,
size_t  g_col,
int &  comm_rank,
size_t &  lindex 
) const
inline

Convert a global index to an index of local storage.

Parameters
[in]g_rowGlobal index of a row.
[in]g_colGlobal index of a column.
[out]comm_rankAlways set to 0.
[out]lindexIndex of local storage.

◆ local_row_index()

template<typename C >
size_t mptensor::lapack::Matrix< C >::local_row_index ( size_t  lindex) const
inline

◆ local_row_size()

template<typename C >
size_t mptensor::lapack::Matrix< C >::local_row_size
inline

◆ local_size()

template<typename C >
size_t mptensor::lapack::Matrix< C >::local_size
inline

◆ map() [1/3]

template<typename C >
template<typename UnaryOperation >
Matrix& mptensor::lapack::Matrix< C >::map ( UnaryOperation  op)

◆ map() [2/3]

template<typename C >
template<typename UnaryOperation >
Matrix<C>& mptensor::lapack::Matrix< C >::map ( UnaryOperation  op)

◆ map() [3/3]

template<typename C >
template<typename UnaryOperation >
Matrix<C>& mptensor::lapack::Matrix< C >::map ( UnaryOperation  op)

◆ n_col()

template<typename C >
int mptensor::lapack::Matrix< C >::n_col
inline

◆ n_row()

template<typename C >
int mptensor::lapack::Matrix< C >::n_row
inline

◆ operator*=()

template<typename C >
Matrix< C > & mptensor::lapack::Matrix< C >::operator*= ( rhs)
inline

◆ operator+=()

template<typename C >
Matrix< C > & mptensor::lapack::Matrix< C >::operator+= ( const Matrix< C > &  rhs)
inline

◆ operator-=()

template<typename C >
Matrix< C > & mptensor::lapack::Matrix< C >::operator-= ( const Matrix< C > &  rhs)
inline

◆ operator/=()

template<typename C >
Matrix< C > & mptensor::lapack::Matrix< C >::operator/= ( rhs)
inline

◆ operator[]() [1/2]

template<typename C >
C & mptensor::lapack::Matrix< C >::operator[] ( size_t  i)
inline

◆ operator[]() [2/2]

template<typename C >
const C & mptensor::lapack::Matrix< C >::operator[] ( size_t  i) const
inline

◆ prep_global_to_local()

template<typename C >
void mptensor::lapack::Matrix< C >::prep_global_to_local
inline

Do nothing.

◆ prep_local_to_global()

template<typename C >
void mptensor::lapack::Matrix< C >::prep_local_to_global
inline

Do nothing.

◆ print_info()

template<typename C >
void mptensor::lapack::Matrix< C >::print_info ( std::ostream &  out) const
inline

◆ save_index()

template<typename C >
void mptensor::lapack::Matrix< C >::save_index ( const std::string &  filename) const

◆ transpose()

template<typename C >
const Matrix< C > mptensor::lapack::Matrix< C >::transpose

Member Data Documentation

◆ matrix_type_name

template<typename C >
constexpr static char* mptensor::lapack::Matrix< C >::matrix_type_name = (char*)"LAPACK"
staticconstexpr

◆ matrix_type_tag

template<typename C >
constexpr static size_t mptensor::lapack::Matrix< C >::matrix_type_tag = MATRIX_TYPE_TAG_LAPACK
staticconstexpr

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