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 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_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 646 of file minimodel.hh. |
|
|||||
|
The type of the Args-array type for value_type values.
Definition at line 648 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.
Definition at line 57 of file matrix.icc. |
|
||||||||||||||||
|
Basic constructor. Constructs a square Matrix from the array a, using n as the length of the sides.
Definition at line 66 of file matrix.icc. |
Member Function Documentation
|
||||||||||
|
Return the width of the matrix.
Definition at line 75 of file matrix.icc. |
|
||||||||||
|
Return the height of the matrix.
Definition at line 78 of file matrix.icc. |
|
||||||||||
|
Return an Args-array of the contents of the matrix.
Definition at line 81 of file matrix.icc. |
|
||||||||||||||||
|
Access element (c, r) of the matrix.
Definition at line 87 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 96 of file matrix.icc. |
|
||||||||||
|
Access row r.
Definition at line 103 of file matrix.icc. |
|
||||||||||
|
Access column c.
Definition at line 109 of file matrix.icc. |
The documentation for this class was generated from the following files:

and rows
. The result of this function is an object that can be converted into either a Matrix<args_type> or into args_type.