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

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

Detailed Description

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

View into a Matrix row.

Definition at line 60 of file row.hpp.

Public Member Functions

 MatrixRow (matrix_type &mat, size_t row)
 
 MatrixRow (MatrixRow const &)=default
 
 MatrixRow (MatrixRow &&)=default
 
 ~MatrixRow ()=default
 
self_typeassign (self_type const &other)
 Overwrite a row by the elements of another row. More...
 
value_typeat (size_t column) const
 Return the element at a given column of the Matrix row. More...
 
Iterator begin () const
 Return an iterator to the beginning of the row. 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 row in form of a std::vector. More...
 
bool operator!= (self_type const &other) const
 Return whether the elements of two rows are identical, using == for comparing elements. More...
 
MatrixRowoperator= (MatrixRow const &)=default
 
MatrixRowoperator= (MatrixRow &&)=default
 
self_typeoperator= (std::vector< T > const &vec)
 Overwrite a row by the elements of a std::vector. More...
 
bool operator== (self_type const &other) const
 Return whether the elements of two rows are identical, using == for comparing elements. More...
 
value_typeoperator[] (size_t column) const
 Return the element at a given column of the Matrix row. More...
 
size_t row () const
 Get the row index that this object represents. More...
 
size_t size () const
 Get the size of the row, that is, the number of columns 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 = MatrixRow< MT, T >
 
using value_type = T
 

Classes

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

Constructor & Destructor Documentation

MatrixRow ( matrix_type mat,
size_t  row 
)
inline

Definition at line 78 of file row.hpp.

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

Member Function Documentation

self_type& assign ( self_type const &  other)
inline

Overwrite a row by the elements of another row.

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

Definition at line 378 of file row.hpp.

value_type& at ( size_t  column) const
inline

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

Definition at line 293 of file row.hpp.

Iterator begin ( ) const
inline

Return an iterator to the beginning of the row.

Definition at line 277 of file row.hpp.

Iterator end ( ) const
inline

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

Definition at line 285 of file row.hpp.

matrix_type& matrix ( ) const
inline

Get the underlying Matrix.

Definition at line 309 of file row.hpp.

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

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

Definition at line 337 of file row.hpp.

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

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

Definition at line 419 of file row.hpp.

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

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

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

Definition at line 359 of file row.hpp.

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

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

Definition at line 399 of file row.hpp.

value_type& operator[] ( size_t  column) const
inline

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

Definition at line 301 of file row.hpp.

size_t row ( ) const
inline

Get the row index that this object represents.

Definition at line 317 of file row.hpp.

size_t size ( ) const
inline

Get the size of the row, that is, the number of columns of the Matrix.

Definition at line 325 of file row.hpp.

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

Explicit conversion to vector.

Definition at line 345 of file row.hpp.

Member Typedef Documentation

using matrix_type = MT

Definition at line 69 of file row.hpp.

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

Definition at line 72 of file row.hpp.

using self_type = MatrixRow<MT, T>

Definition at line 68 of file row.hpp.

using value_type = T

Definition at line 70 of file row.hpp.


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