A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MatrixCol< MT, T > Class Template Reference

#include <genesis/utils/containers/matrix/col.hpp>

Detailed Description

template<typename MT, typename T>
class genesis::utils::MatrixCol< MT, T >

View into a Matrix column.

Definition at line 60 of file col.hpp.

Public Member Functions

 MatrixCol (matrix_type &mat, size_t col)
 
 MatrixCol (MatrixCol const &)=default
 
 MatrixCol (MatrixCol &&)=default
 
 ~MatrixCol ()=default
 
self_typeassign (self_type const &other)
 Overwrite a column by the elements of another column. More...
 
value_typeat (size_t row) const
 Return the element at a given row of the Matrix column. More...
 
Iterator begin () const
 Return an iterator to the beginning of the row. More...
 
size_t col () const
 Get the column index that this object represents. More...
 
Iterator end () const
 Return an iterator to past-the-end of the row. More...
 
matrix_typematrix () const
 Get the underlying Matrix. More...
 
 operator std::vector< non_const_value_type > () const
 Get a copy of the column in form of a std::vector. More...
 
bool operator!= (self_type const &other) const
 Return whether the elements of two columns are not identical, using == for comparing elements. More...
 
MatrixColoperator= (MatrixCol const &)=default
 
MatrixColoperator= (MatrixCol &&)=default
 
self_typeoperator= (std::vector< T > const &vec)
 Overwrite a column by the elements of a std::vector. More...
 
bool operator== (self_type const &other) const
 Return whether the elements of two columns are identical, using == for comparing elements. More...
 
value_typeoperator[] (size_t row) const
 Return the element at a given row of the Matrix column. More...
 
size_t size () const
 Get the size of the column, that is, the number of rows of the Matrix. More...
 
std::vector< non_const_value_typeto_vector () const
 Explicit conversion to vector. More...
 

Public Types

using matrix_type = MT
 
using non_const_value_type = typename std::remove_const< T >::type
 
using self_type = MatrixCol< MT, T >
 
using value_type = T
 

Classes

class  Iterator
 Random access iterator into a Matrix column. More...
 

Constructor & Destructor Documentation

MatrixCol ( matrix_type mat,
size_t  col 
)
inline

Definition at line 78 of file col.hpp.

~MatrixCol ( )
default
MatrixCol ( MatrixCol< MT, T > const &  )
default
MatrixCol ( MatrixCol< MT, T > &&  )
default

Member Function Documentation

self_type& assign ( self_type const &  other)
inline

Overwrite a column by the elements of another column.

The sizes of both columns need to match each other. The given column can also be a column of the same Matrix.

Definition at line 378 of file col.hpp.

value_type& at ( size_t  row) const
inline

Return the element at a given row of the Matrix column.

Definition at line 293 of file col.hpp.

Iterator begin ( ) const
inline

Return an iterator to the beginning of the row.

Definition at line 277 of file col.hpp.

size_t col ( ) const
inline

Get the column index that this object represents.

Definition at line 317 of file col.hpp.

Iterator end ( ) const
inline

Return an iterator to past-the-end of the row.

Definition at line 285 of file col.hpp.

matrix_type& matrix ( ) const
inline

Get the underlying Matrix.

Definition at line 309 of file col.hpp.

operator std::vector< non_const_value_type > ( ) const
inline

Get a copy of the column in form of a std::vector.

Definition at line 337 of file col.hpp.

bool operator!= ( self_type const &  other) const
inline

Return whether the elements of two columns are not identical, using == for comparing elements.

Definition at line 419 of file col.hpp.

MatrixCol& operator= ( MatrixCol< MT, T > const &  )
default
MatrixCol& operator= ( MatrixCol< MT, T > &&  )
default
self_type& operator= ( std::vector< T > const &  vec)
inline

Overwrite a column by the elements of a std::vector.

The size of the vector needs to match the number of rows of the Matrix.

Definition at line 359 of file col.hpp.

bool operator== ( self_type const &  other) const
inline

Return whether the elements of two columns are identical, using == for comparing elements.

Definition at line 399 of file col.hpp.

value_type& operator[] ( size_t  row) const
inline

Return the element at a given row of the Matrix column.

Definition at line 301 of file col.hpp.

size_t size ( ) const
inline

Get the size of the column, that is, the number of rows of the Matrix.

Definition at line 325 of file col.hpp.

std::vector<non_const_value_type> to_vector ( ) const
inline

Explicit conversion to vector.

Definition at line 345 of file col.hpp.

Member Typedef Documentation

using matrix_type = MT

Definition at line 69 of file col.hpp.

using non_const_value_type = typename std::remove_const<T>::type

Definition at line 72 of file col.hpp.

using self_type = MatrixCol<MT, T>

Definition at line 68 of file col.hpp.

using value_type = T

Definition at line 70 of file col.hpp.


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