Gecode::MiniModel::Matrix< A > Class Template Reference
[Matrix interface for arrays]
#include <minimodel.hh>
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 837 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 | width (void) const |
Return the width of the matrix. | |
unsigned int | height (void) const |
Return the height of the matrix. | |
args_type const | get_array (void) |
Return an Args-array of the contents of the matrix. | |
value_type & | operator() (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
|
The type of elements of this array.
Definition at line 840 of file minimodel.hh. |
|
The type of the Args-array type for value_type values.
Definition at line 842 of file minimodel.hh. |
Constructor & Destructor Documentation
|
Basic constructor. Constructs a Matrix from the array a, using w and h as the width and height of the matrix. The elements in the wrapped array a are accessed in row-major order.
Definition at line 62 of file matrix.icc. |
|
Basic constructor. Constructs a square Matrix from the array a, using n as the length of the sides. The elements in the wrapped array a are accessed in row-major order.
Definition at line 70 of file matrix.icc. |
Member Function Documentation
|
Return the width of the matrix.
Definition at line 78 of file matrix.icc. |
|
Return the height of the matrix.
Definition at line 81 of file matrix.icc. |
|
Return an Args-array of the contents of the matrix.
Definition at line 84 of file matrix.icc. |
|
Access element (c, r) of the matrix.
Definition at line 90 of file matrix.icc. |
|
Access slice of the matrix.
This function allows accessing a slice of the matrix, located at columns For further information, see Slice. Definition at line 99 of file matrix.icc. |
|
Access row r.
Definition at line 106 of file matrix.icc. |
|
Access column c.
Definition at line 112 of file matrix.icc. |
The documentation for this class was generated from the following files:
- gecode/minimodel.hh (Revision: 3579)
- gecode/minimodel/matrix.icc (Revision: 3513)