MeshLib Documentation
Loading...
Searching...
No Matches
MR::Matrix< T > Struct Template Reference

#include <MRMatrix.h>

+ Inheritance diagram for MR::Matrix< T >:

Public Types

using ValueType = T
 

Public Member Functions

constexpr Matrix () noexcept=default
 
 Matrix (size_t numRows, size_t numCols)
 
constexpr T & operator() (size_t row, size_t col) noexcept
 main access method
 
constexpr T & operator() (size_t i) noexcept
 
constexpr const T & operator() (size_t row, size_t col) const noexcept
 
constexpr const T & operator() (size_t i) const noexcept
 
constexpr Matrix getSubMatrix (size_t startRow, size_t nRow, size_t startCol, size_t nCol)
 
constexpr Matrix transposed () const
 computes transposed matrix
 
void fill (T val)
 
void clear ()
 
size_t getRowsNum () const
 
size_t getColsNum () const
 
const std::vector< T > & data () const
 
- Public Member Functions inherited from MR::RectIndexer
constexpr RectIndexer () noexcept=default
 
 RectIndexer (const Vector2i &dims)
 
void resize (const Vector2i &dims)
 
const Vector2i & dims () const
 
size_t size () const
 
Vector2i toPos (PixelId id) const
 
Vector2i toPos (size_t id) const
 
PixelId toPixelId (const Vector2i &pos) const
 
size_t toIndex (const Vector2i &pos) const
 
bool areNeigbors (PixelId v0, PixelId v1) const
 returns true if v1 is within at most 4 neighbors of v0
 
bool areNeigbors (const Vector2i &pos0, const Vector2i &pos1) const
 
PixelId getNeighbor (PixelId v, OutEdge2 toNei) const
 returns id of v's neighbor specified by the edge
 
MRMESH_API PixelId getNeighbor (PixelId v, const Vector2i &pos, OutEdge2 toNei) const
 

Additional Inherited Members

- Protected Attributes inherited from MR::RectIndexer
Vector2i dims_
 
size_t size_ = 0
 = dims_.x * dims_.y
 

Detailed Description

template<typename T>
struct MR::Matrix< T >

Row-major matrix with T values

Member Typedef Documentation

◆ ValueType

template<typename T >
using MR::Matrix< T >::ValueType = T

Constructor & Destructor Documentation

◆ Matrix() [1/2]

template<typename T >
MR::Matrix< T >::Matrix ( )
constexprdefaultnoexcept

◆ Matrix() [2/2]

template<typename T >
MR::Matrix< T >::Matrix ( size_t numRows,
size_t numCols )
inline

Member Function Documentation

◆ clear()

template<typename T >
void MR::Matrix< T >::clear ( )
inline

◆ data()

template<typename T >
const std::vector< T > & MR::Matrix< T >::data ( ) const
inline

◆ fill()

template<typename T >
void MR::Matrix< T >::fill ( T val)
inline

◆ getColsNum()

template<typename T >
size_t MR::Matrix< T >::getColsNum ( ) const
inline

◆ getRowsNum()

template<typename T >
size_t MR::Matrix< T >::getRowsNum ( ) const
inline

◆ getSubMatrix()

template<typename T >
Matrix MR::Matrix< T >::getSubMatrix ( size_t startRow,
size_t nRow,
size_t startCol,
size_t nCol )
inlineconstexpr

◆ operator()() [1/4]

template<typename T >
const T & MR::Matrix< T >::operator() ( size_t i) const
inlineconstexprnoexcept

◆ operator()() [2/4]

template<typename T >
T & MR::Matrix< T >::operator() ( size_t i)
inlineconstexprnoexcept

◆ operator()() [3/4]

template<typename T >
const T & MR::Matrix< T >::operator() ( size_t row,
size_t col ) const
inlineconstexprnoexcept

◆ operator()() [4/4]

template<typename T >
T & MR::Matrix< T >::operator() ( size_t row,
size_t col )
inlineconstexprnoexcept

main access method

◆ transposed()

template<typename T >
Matrix MR::Matrix< T >::transposed ( ) const
inlineconstexpr

computes transposed matrix


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