LocARNA-1.9.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | Protected Member Functions | Protected Attributes
LocARNA::OMatrix< elem_t > Class Template Reference

Simple matrix class with offset. More...

#include <matrices.hh>

Inheritance diagram for LocARNA::OMatrix< elem_t >:
LocARNA::Matrix< elem_t >

List of all members.

Public Member Functions

 OMatrix ()
void resize (size_t xdim, size_t ydim, size_t xoff=0, size_t yoff=0)
const elem_toperator() (size_t i, size_t j) const
elem_toperator() (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

Detailed Description

template<class elem_t>
class LocARNA::OMatrix< elem_t >

Simple matrix class with offset.


Constructor & Destructor Documentation

template<class elem_t >
LocARNA::OMatrix< elem_t >::OMatrix ( ) [inline]

Construct as 0x0-matrix

Returns:

Member Function Documentation

template<class elem_t >
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

Parameters:
ifirst index
jsecond index
Returns:
index in vector
Note:
this method is used for all internal access to the vector mat_
template<class elem_t >
const elem_t LocARNA::OMatrix< elem_t >::get ( size_t  i,
size_t  j 
) const [inline]

Read access to matrix element

Parameters:
i
j
Returns:
entry (i,j)
Note:
: redefine since we don't want to use polymorphism
template<class elem_t >
const elem_t& LocARNA::OMatrix< elem_t >::operator() ( size_t  i,
size_t  j 
) const [inline]

Read access to matrix element

Parameters:
i
j
Returns:
entry (i,j)
Note:
: redefine since we don't want to use polymorphism
template<class elem_t >
elem_t& LocARNA::OMatrix< elem_t >::operator() ( size_t  i,
size_t  j 
) [inline]

Read/write access to matrix element

Parameters:
i
j
Returns:
reference to entry (i,j)
Note:
: redefine since we don't want to use polymorphism
template<class elem_t >
void LocARNA::OMatrix< elem_t >::resize ( size_t  xdim,
size_t  ydim,
size_t  xoff = 0,
size_t  yoff = 0 
) [inline]

Resize matrix

Parameters:
xdimnew first dimension
ydimnew second dimension
xoffnew offset in first dimension
yoffnew offset in second dimension
template<class elem_t >
void LocARNA::OMatrix< elem_t >::set ( size_t  i,
size_t  j,
const elem_t x 
) [inline]

Write access to matrix element

Parameters:
i
j
xelement value
Note:
: redefine since we don't want to use polymorphism

The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends