MatrixData Class Template Reference

MatrixData Class. More...

Inheritance diagram for MatrixData:

Inheritance graph
[legend]
Collaboration diagram for MatrixData:

Collaboration graph
[legend]
List of all members.

STL compatibility

typedef T value_type
typedef T & reference
typedef const T & const_reference
typedef matrixdataIterator iterator
typedef const matrixdataIterator const_iterator
typedef size_t size_type
typedef ptrdiff_t difference_type
size_type max_size ()
bool empty ()
void clear ()
iterator begin ()
const_iterator begin () const
iterator end ()
const_iterator end () const

Constructors

 MatrixData (u_int rows, u_int cols)
 MatrixData (Vec &src, u_int rstart, u_int rend, u_int rows, u_int cols)
 ~MatrixData ()

Informations about MatrixData

u_int rows () const
u_int cols () const
u_int size () const
bool isView () const
bool operator== (const MatrixData< T, Vec > &b)
bool operator!= (const VectorData< T > &b)
void resize (u_int rows, u_int cols)

Accessing Operators

T & at (u_int row, u_int col)
const T & at (u_int row, u_int col) const
Vec & operator[] (u_int row)
const Vec & operator[] (u_int row) const
MatrixDataassign (const MatrixData &src)
void zeroing ()

Protected Member Functions

Vec & rawdata () const

Classes

class  matrixdataIterator

Detailed Description

template<class T, class Vec = VectorData<T>>
class nnfw::MatrixData< T, Vec >

Motivation
Create a MatrixData abstract type for storing data in dynamic and efficient way
Description
Warnings


Member Typedef Documentation

typedef T value_type

Value type

typedef T& reference

Reference type

typedef const T& const_reference

Const Reference type

typedef matrixdataIterator iterator

Iterator

typedef const matrixdataIterator const_iterator

Const Iterator

typedef size_t size_type

Size type

typedef ptrdiff_t difference_type

Difference pointer type


Constructor & Destructor Documentation

MatrixData ( u_int  rows,
u_int  cols 
) [inline]

Construct an empty matrix of dimension size

MatrixData ( Vec &  src,
u_int  rstart,
u_int  rend,
u_int  rows,
u_int  cols 
) [inline]

Construct a Matrix view from VectorData passed

Parameters:
src is the VectorData from which this method constructs a Matrix view. The VectorData must be the same as specified in template constructing ( class Vec template parameters )
The view represent the piece of src delimited by rstart and rend as a MatrixData with nrows and ncols. So, the follow assert must be accomplished: rend-rstart == nrows*ncols
Warnings:
When a VectorData vec is viewed through a MatrixData mat, then a resizing of vec can lead to some strange results; In fact, the automatic adjustment of mat after a vec resizing is a bit ambiguous because is not clear which dimensions sets. So, for diambiguous the mat view will be adjusted mantaining the same numbers of the rows and adding or removing columns trying to fit the new dimension of vec. If is not possibile this can lead to views that doesn't represent the whole vec.

~MatrixData (  )  [inline]

Destructor


Member Function Documentation

u_int rows (  )  const [inline]

Returns the numbers of Row

u_int cols (  )  const [inline]

Returns the numbers of Columns

u_int size (  )  const [inline]

Returns the total numbers of elements (Rows*Columns)

bool isView (  )  const [inline]

Return True if it is a MatrixData view

bool operator== ( const MatrixData< T, Vec > &  b  )  [inline]

Equal Operator

bool operator!= ( const VectorData< T > &  b  )  [inline]

Not-Equal Operator

void resize ( u_int  rows,
u_int  cols 
) [inline]

Resize the matrix

T& at ( u_int  row,
u_int  col 
) [inline]

Return a reference to element at position (row, col)

const T& at ( u_int  row,
u_int  col 
) const [inline]

Return a Const reference to element at position (row, col)

Vec& operator[] ( u_int  row  )  [inline]

Indexing operator
Boundary check activated only when DEBUG if defined

const Vec& operator[] ( u_int  row  )  const [inline]

Indexing operator (Const Version)
Boundary check activated only when DEBUG if defined

MatrixData& assign ( const MatrixData< T, Vec > &  src  )  [inline]

Assign elements

void zeroing (  )  [inline]

Set all values to zero

size_type max_size (  )  [inline]

Max size allowed

bool empty (  )  [inline]

Is Empty

void clear (  )  [inline]

Clear: reduce the dimension to zero-zero matrix

iterator begin (  )  [inline]

Iterator at initial position

const_iterator begin (  )  const [inline]

Iterator at initial position

iterator end (  )  [inline]

Iterator at past-end position

const_iterator end (  )  const [inline]

Iterator at past-end position

Vec& rawdata (  )  const [inline, protected]

Return the VectorData of the data


The documentation for this class was generated from the following file:
BerliOS Developer Logo Valid XHTML 1.0 Transitional Valid CSS!