1 #include <Sequence/VariantMatrixViews.hpp> 6 template <
typename T,
typename VM>
8 row_view_wrapper(VM& m,
const std::size_t row)
12 throw std::out_of_range(
"row index out of range");
14 return T(m.data.data() + row * m.nsam, m.nsam);
16 template <
typename T,
typename VM>
18 col_view_wrapper(VM& m,
const std::size_t col)
22 throw std::out_of_range(
"column index out of range");
24 return T(m.data.data() + col, m.nsam * m.nsites, m.nsam);
34 return row_view_wrapper<ConstRowView>(m, row);
40 return row_view_wrapper<RowView>(m, row);
46 return row_view_wrapper<ConstRowView>(m, row);
52 return row_view_wrapper<ConstRowView>(m, row);
58 return col_view_wrapper<ColView>(m, col);
63 return col_view_wrapper<ConstColView>(m, col);
68 return col_view_wrapper<ConstColView>(m, col);
73 return col_view_wrapper<ConstColView>(m, col);
Implementation details for Sequence::RowView and Sequence::ConstRowView.
internal::row_view_< const std::int8_t * > ConstRowView
Const view of a VariantMatrix row (a variable site)
The namespace in which this library resides.
ConstRowView get_RowView(const VariantMatrix &m, const std::size_t row)
Return a ConstRowView from VariantMatrix m at row row. std::out_of_range is thrown if row is out of r...
ConstRowView get_ConstRowView(const VariantMatrix &m, const std::size_t row)
Return a ConstRowView from VariantMatrix m at row row. std::out_of_range is thrown if row is out of r...
Matrix representation of variation data.
ColView get_ColView(VariantMatrix &m, const std::size_t col)
Return a ColView from VariantMatrix m at col col. std::out_of_range is thcoln if col is out of range...
ConstColView get_ConstColView(VariantMatrix &m, const std::size_t col)
Return a ConstColView from VariantMatrix m at col col. std::out_of_range is thcoln if col is out of r...
Implementation details for Sequence::ColView and Sequence::ConstColView.