A toolkit for working with phylogenetic data.
v0.24.0
Matrix< T > Class Template Reference

#include <genesis/placement/function/emd.hpp>

Detailed Description

template<typename T>
class genesis::utils::Matrix< T >

Definition at line 53 of file placement/function/emd.hpp.

Public Member Functions

 Matrix ()
 
 Matrix (size_t rows, size_t cols)
 
 Matrix (size_t rows, size_t cols, T init)
 
 Matrix (size_t rows, size_t cols, std::vector< T > const &data)
 
 Matrix (size_t rows, size_t cols, std::vector< T > &&data)
 
 Matrix (size_t rows, size_t cols, std::initializer_list< T > const &init_list)
 
 Matrix (Matrix const &)=default
 
 Matrix (Matrix &&)=default
 
 ~Matrix ()=default
 
T & at (const size_t row, const size_t col)
 
T const & at (const size_t row, const size_t col) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
MatrixCol< self_type, value_typecol (size_t col)
 
MatrixCol< const self_type, const value_typecol (size_t col) const
 
size_t cols () const
 
container_type const & data () const
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
bool operator!= (Matrix< T > const &other) const
 
T & operator() (const size_t row, const size_t col)
 
T const & operator() (const size_t row, const size_t col) const
 
Matrixoperator= (Matrix const &)=default
 
Matrixoperator= (Matrix &&)=default
 
bool operator== (Matrix< T > const &other) const
 
MatrixRow< self_type, value_typerow (size_t row)
 
MatrixRow< const self_type, const value_typerow (size_t row) const
 
size_t rows () const
 
size_t size () const
 
void swap (Matrix &other)
 

Public Types

using const_iterator = typename container_type::const_iterator
 
using container_type = std::vector< T >
 
using iterator = typename container_type::iterator
 
using self_type = Matrix< T >
 
using value_type = T
 

Friends

void swap (Matrix &lhs, Matrix &rhs)
 

Constructor & Destructor Documentation

◆ Matrix() [1/8]

Matrix ( )
inline

Definition at line 68 of file containers/matrix.hpp.

◆ Matrix() [2/8]

Matrix ( size_t  rows,
size_t  cols 
)
inline

Definition at line 74 of file containers/matrix.hpp.

◆ Matrix() [3/8]

Matrix ( size_t  rows,
size_t  cols,
init 
)
inline

Definition at line 80 of file containers/matrix.hpp.

◆ Matrix() [4/8]

Matrix ( size_t  rows,
size_t  cols,
std::vector< T > const &  data 
)
inline

Definition at line 86 of file containers/matrix.hpp.

◆ Matrix() [5/8]

Matrix ( size_t  rows,
size_t  cols,
std::vector< T > &&  data 
)
inline

Definition at line 101 of file containers/matrix.hpp.

◆ Matrix() [6/8]

Matrix ( size_t  rows,
size_t  cols,
std::initializer_list< T > const &  init_list 
)
inline

Definition at line 116 of file containers/matrix.hpp.

◆ ~Matrix()

~Matrix ( )
default

◆ Matrix() [7/8]

Matrix ( Matrix< T > const &  )
default

◆ Matrix() [8/8]

Matrix ( Matrix< T > &&  )
default

Member Function Documentation

◆ at() [1/2]

T& at ( const size_t  row,
const size_t  col 
)
inline

Definition at line 191 of file containers/matrix.hpp.

◆ at() [2/2]

T const& at ( const size_t  row,
const size_t  col 
) const
inline

Definition at line 199 of file containers/matrix.hpp.

◆ begin() [1/2]

iterator begin ( )
inline

Definition at line 261 of file containers/matrix.hpp.

◆ begin() [2/2]

const_iterator begin ( ) const
inline

Definition at line 271 of file containers/matrix.hpp.

◆ cbegin()

const_iterator cbegin ( ) const
inline

Definition at line 281 of file containers/matrix.hpp.

◆ cend()

const_iterator cend ( ) const
inline

Definition at line 286 of file containers/matrix.hpp.

◆ col() [1/2]

MatrixCol<self_type, value_type> col ( size_t  col)
inline

Definition at line 239 of file containers/matrix.hpp.

◆ col() [2/2]

MatrixCol<const self_type, const value_type> col ( size_t  col) const
inline

Definition at line 248 of file containers/matrix.hpp.

◆ cols()

size_t cols ( ) const
inline

Definition at line 167 of file containers/matrix.hpp.

◆ data()

container_type const& data ( ) const
inline

Definition at line 182 of file containers/matrix.hpp.

◆ empty()

bool empty ( ) const
inline

Definition at line 177 of file containers/matrix.hpp.

◆ end() [1/2]

iterator end ( )
inline

Definition at line 266 of file containers/matrix.hpp.

◆ end() [2/2]

const_iterator end ( ) const
inline

Definition at line 276 of file containers/matrix.hpp.

◆ operator!=()

bool operator!= ( Matrix< T > const &  other) const
inline

Definition at line 302 of file containers/matrix.hpp.

◆ operator()() [1/2]

T& operator() ( const size_t  row,
const size_t  col 
)
inline

Definition at line 207 of file containers/matrix.hpp.

◆ operator()() [2/2]

T const& operator() ( const size_t  row,
const size_t  col 
) const
inline

Definition at line 212 of file containers/matrix.hpp.

◆ operator=() [1/2]

Matrix& operator= ( Matrix< T > const &  )
default

◆ operator=() [2/2]

Matrix& operator= ( Matrix< T > &&  )
default

◆ operator==()

bool operator== ( Matrix< T > const &  other) const
inline

Definition at line 295 of file containers/matrix.hpp.

◆ row() [1/2]

MatrixRow<self_type, value_type> row ( size_t  row)
inline

Definition at line 221 of file containers/matrix.hpp.

◆ row() [2/2]

MatrixRow<const self_type, const value_type> row ( size_t  row) const
inline

Definition at line 230 of file containers/matrix.hpp.

◆ rows()

size_t rows ( ) const
inline

Definition at line 162 of file containers/matrix.hpp.

◆ size()

size_t size ( ) const
inline

Definition at line 172 of file containers/matrix.hpp.

◆ swap()

void swap ( Matrix< T > &  other)
inline

Definition at line 145 of file containers/matrix.hpp.

Friends And Related Function Documentation

◆ swap

void swap ( Matrix< T > &  lhs,
Matrix< T > &  rhs 
)
friend

Definition at line 153 of file containers/matrix.hpp.

Member Typedef Documentation

◆ const_iterator

using const_iterator = typename container_type::const_iterator

Definition at line 62 of file containers/matrix.hpp.

◆ container_type

using container_type = std::vector<T>

Definition at line 60 of file containers/matrix.hpp.

◆ iterator

using iterator = typename container_type::iterator

Definition at line 61 of file containers/matrix.hpp.

◆ self_type

using self_type = Matrix<T>

Definition at line 57 of file containers/matrix.hpp.

◆ value_type

using value_type = T

Definition at line 58 of file containers/matrix.hpp.


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