Generated on Wed Jan 4 17:49:23 2006 for Gecode by doxygen 1.4.6

Gecode::MiniModel::Matrix< A > Class Template Reference
[Matrix interface for arrays]

#include <minimodel.hh>

List of all members.


Detailed Description

template<class A>
class Gecode::MiniModel::Matrix< A >

Matrix-interface for arrays.

This class allows for wrapping some array and accessing it as a matrix.

Note:
This is a light-weight wrapper, and is not intended for storing variables directly instead of in an array.

Definition at line 643 of file minimodel.hh.

Public Types

typedef ArrayTraits< A
>::value_type 
value_type
 The type of elements of this array.
typedef ArrayTraits< A
>::args_type 
args_type
 The type of the Args-array type for value_type values.

Public Member Functions

 Matrix (A a, unsigned int w, unsigned int h)
 Basic constructor.
 Matrix (A a, unsigned int n)
 Basic constructor.
unsigned int const width (void)
 Return the width of the matrix.
unsigned int const height (void)
 Return the height of the matrix.
args_type const get_array (void)
 Return an Args-array of the contents of the matrix.
value_typeoperator() (unsigned int c, unsigned int r)
 Access element (c, r) of the matrix.
Slice slice (unsigned int fc, unsigned int tc, unsigned int fr, unsigned int tr)
 Access slice of the matrix.
args_type row (int r)
 Access row r.
args_type col (int c)
 Access column c.

Classes

class  Slice
 A slice of a matrix. More...


Member Typedef Documentation

template<class A>
typedef ArrayTraits<A>::value_type Gecode::MiniModel::Matrix< A >::value_type
 

The type of elements of this array.

Definition at line 646 of file minimodel.hh.

template<class A>
typedef ArrayTraits<A>::args_type Gecode::MiniModel::Matrix< A >::args_type
 

The type of the Args-array type for value_type values.

Definition at line 648 of file minimodel.hh.


Constructor & Destructor Documentation

template<class A>
Gecode::MiniModel::Matrix< A >::Matrix a,
unsigned int  w,
unsigned int  h
[inline]
 

Basic constructor.

Constructs a Matrix from the array a, using w and h as the width and height of the matrix.

Exceptions:
MiniModel::ArgumentSizeMismatch Raised if the parameters w and h doesn't match the size of the array a.

Definition at line 57 of file matrix.icc.

template<class A>
Gecode::MiniModel::Matrix< A >::Matrix a,
unsigned int  n
[inline]
 

Basic constructor.

Constructs a square Matrix from the array a, using n as the length of the sides.

Exceptions:
MiniModel::ArgumentSizeMismatch Raised if the parameter n doesn't match the size of the array a.

Definition at line 66 of file matrix.icc.


Member Function Documentation

template<class A>
unsigned int const Gecode::MiniModel::Matrix< A >::width void   )  [inline]
 

Return the width of the matrix.

Definition at line 75 of file matrix.icc.

template<class A>
unsigned int const Gecode::MiniModel::Matrix< A >::height void   )  [inline]
 

Return the height of the matrix.

Definition at line 78 of file matrix.icc.

template<class A>
Matrix< A >::args_type const Gecode::MiniModel::Matrix< A >::get_array void   )  [inline]
 

Return an Args-array of the contents of the matrix.

Definition at line 81 of file matrix.icc.

template<class A>
Matrix< A >::value_type & Gecode::MiniModel::Matrix< A >::operator() unsigned int  c,
unsigned int  r
[inline]
 

Access element (c, r) of the matrix.

Exceptions:
MiniModel::ArgumentOutOfRange Raised if c or r are out of range.

Definition at line 87 of file matrix.icc.

template<class A>
Matrix< A >::Slice Gecode::MiniModel::Matrix< A >::slice unsigned int  fc,
unsigned int  tc,
unsigned int  fr,
unsigned int  tr
[inline]
 

Access slice of the matrix.

This function allows accessing a slice of the matrix, located at columns $[fc,tc)$ and rows $[fr,tr)$. The result of this function is an object that can be converted into either a Matrix<args_type> or into args_type.

For further information, see Slice.

Definition at line 96 of file matrix.icc.

template<class A>
Matrix< A >::args_type Gecode::MiniModel::Matrix< A >::row int  r  )  [inline]
 

Access row r.

Definition at line 103 of file matrix.icc.

template<class A>
Matrix< A >::args_type Gecode::MiniModel::Matrix< A >::col int  c  )  [inline]
 

Access column c.

Definition at line 109 of file matrix.icc.


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