Scopira  20080306
scopira::tool::basic_matrix< T > Class Template Reference

#include <array.h>

Inheritance diagram for scopira::tool::basic_matrix< T >:
scopira::tool::basic_array< T >

Public Member Functions

 basic_matrix (void)
 
 basic_matrix (size_t w, size_t h)
 
void resize (size_t w, size_t h)
 
size_t width (void) const
 
size_t height (void) const
 
void set (size_t x, size_t y, const T &v)
 
const T & get (size_t x, size_t y) const
 
T & get (size_t x, size_t y)
 
const T & operator() (size_t x, size_t y) const
 
T & operator() (size_t x, size_t y)
 
- Public Member Functions inherited from scopira::tool::basic_array< T >
 basic_array (void)
 
 basic_array (size_t len)
 
 basic_array (const basic_array &rhs)
 
 ~basic_array ()
 Destructor.
 
void resize (size_t newlen)
 
void array_swap (basic_array< T > &other)
 
T * array (void)
 
const T * array (void) const
 
T * c_array (void)
 
const T * c_array (void) const
 
iterator begin (void)
 
iterator end (void)
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
basic_arrayoperator= (const basic_array &rhs)
 
void clear (void)
 
void clear_zero (void)
 
size_t size (void) const
 
bool empty (void) const
 
void set (size_t idx, const T &v)
 
const T & get (size_t idx) const
 
T & get (size_t idx)
 
const T & operator[] (size_t idx) const
 
T & operator[] (size_t idx)
 

Protected Member Functions

void resize (size_t newlen)
 

Protected Attributes

size_t dm_w
 
size_t dm_h
 
- Protected Attributes inherited from scopira::tool::basic_array< T >
T * dm_ary
 
size_t dm_len
 

Additional Inherited Members

- Public Types inherited from scopira::tool::basic_array< T >
typedef T data_type
 
typedef T * iterator
 
typedef const T * const_iterator
 

Detailed Description

template<class T>
class scopira::tool::basic_matrix< T >

A basic_matrix adds 2 dimentional (matrix) like operations to basic_array.

Author
Aleksander Demko

Constructor & Destructor Documentation

◆ basic_matrix() [1/2]

template<class T >
scopira::tool::basic_matrix< T >::basic_matrix ( void  )
inline

Makes a 0 by 0 matrix.

Author
Aleksander Demko

◆ basic_matrix() [2/2]

template<class T >
scopira::tool::basic_matrix< T >::basic_matrix ( size_t  w,
size_t  h 
)
inline

Makes a w by h matrix.

Author
Aleksander Demko

Member Function Documentation

◆ get() [1/2]

template<class T >
const T& scopira::tool::basic_matrix< T >::get ( size_t  x,
size_t  y 
) const
inline

Individual element setter

Author
Aleksander Demko

◆ get() [2/2]

template<class T >
T& scopira::tool::basic_matrix< T >::get ( size_t  x,
size_t  y 
)
inline

Individual element setter

Author
Aleksander Demko

◆ height()

template<class T >
size_t scopira::tool::basic_matrix< T >::height ( void  ) const
inline

Returns the height of the matrix.

Author
Aleksander Demko

◆ operator()() [1/2]

template<class T >
const T& scopira::tool::basic_matrix< T >::operator() ( size_t  x,
size_t  y 
) const
inline

Nice reference access

Author
Aleksander Demko

◆ operator()() [2/2]

template<class T >
T& scopira::tool::basic_matrix< T >::operator() ( size_t  x,
size_t  y 
)
inline

Nice reference access

Author
Aleksander Demko

◆ resize()

template<class T >
void scopira::tool::basic_matrix< T >::resize ( size_t  w,
size_t  h 
)
inline

Resizes the matrix to the new, given dimensions. Please see basic_array::resize for what happens to the data.

Author
Aleksander Demko

◆ set()

template<class T >
void scopira::tool::basic_matrix< T >::set ( size_t  x,
size_t  y,
const T &  v 
)
inline

Individual element setter

Author
Aleksander Demko

◆ width()

template<class T >
size_t scopira::tool::basic_matrix< T >::width ( void  ) const
inline

Returns the width of the matrix.

Author
Aleksander Demko

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