Simple matrix class with offset. More...
#include <matrices.hh>
Public Member Functions | |
OMatrix () | |
void | resize (size_t xdim, size_t ydim, size_t xoff=0, size_t yoff=0) |
const elem_t & | operator() (size_t i, size_t j) const |
elem_t & | operator() (size_t i, size_t j) |
const elem_t | get (size_t i, size_t j) const |
void | set (size_t i, size_t j, const elem_t &x) |
Protected Member Functions | |
size_t | addr (size_t i, size_t j) const |
Computes address/index in 1D vector from 2D matrix indices. | |
Protected Attributes | |
size_t | off_ |
combined offset for vector access | |
size_t | xoff_ |
offset in first dimension | |
size_t | yoff_ |
offset in second dimension |
Simple matrix class with offset.
LocARNA::OMatrix< elem_t >::OMatrix | ( | ) | [inline] |
Construct as 0x0-matrix
size_t LocARNA::OMatrix< elem_t >::addr | ( | size_t | i, |
size_t | j | ||
) | const [inline, protected] |
Computes address/index in 1D vector from 2D matrix indices.
Shifts indices by offset
i | first index |
j | second index |
const elem_t LocARNA::OMatrix< elem_t >::get | ( | size_t | i, |
size_t | j | ||
) | const [inline] |
Read access to matrix element
i | |
j |
const elem_t& LocARNA::OMatrix< elem_t >::operator() | ( | size_t | i, |
size_t | j | ||
) | const [inline] |
Read access to matrix element
i | |
j |
elem_t& LocARNA::OMatrix< elem_t >::operator() | ( | size_t | i, |
size_t | j | ||
) | [inline] |
Read/write access to matrix element
i | |
j |
void LocARNA::OMatrix< elem_t >::resize | ( | size_t | xdim, |
size_t | ydim, | ||
size_t | xoff = 0 , |
||
size_t | yoff = 0 |
||
) | [inline] |
Resize matrix
xdim | new first dimension |
ydim | new second dimension |
xoff | new offset in first dimension |
yoff | new offset in second dimension |
void LocARNA::OMatrix< elem_t >::set | ( | size_t | i, |
size_t | j, | ||
const elem_t & | x | ||
) | [inline] |
Write access to matrix element
i | |
j | |
x | element value |