Matrix-interface for arrays. More...
#include <minimodel.hh>
Public Types | |
typedef ArrayTraits< A >::ValueType | ValueType |
The type of elements of this array. More... | |
typedef ArrayTraits< A >::ArgsType | ArgsType |
The type of the Args-array type for ValueType values. More... | |
Public Member Functions | |
Matrix (A a, int w, int h) | |
Basic constructor. More... | |
Matrix (A a, int n) | |
Basic constructor. More... | |
int | width (void) const |
Return the width of the matrix. More... | |
int | height (void) const |
Return the height of the matrix. More... | |
ArgsType const | get_array (void) const |
Return an Args-array of the contents of the matrix. More... | |
ValueType & | operator() (int c, int r) |
Access element (c, r) of the matrix. More... | |
const ValueType & | operator() (int c, int r) const |
Access element (c, r) of the matrix. More... | |
Slice< A > | slice (int fc, int tc, int fr, int tr) const |
Access slice of the matrix. More... | |
Slice< A > | row (int r) const |
Access row r. More... | |
Slice< A > | col (int c) const |
Access column c. More... | |
Related Functions | |
(Note that these are not member functions.) | |
template<class Char , class Traits , class A > | |
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const Matrix< A > &m) |
template<class Char , class Traits , class A > | |
std::basic_ostream< Char, Traits > & | operator<< (std::basic_ostream< Char, Traits > &os, const Slice< A > &s) |
void | element (Home home, const Matrix< IntArgs > &m, IntVar x, IntVar y, IntVar z, IntConLevel icl=ICL_DEF) |
Element constraint for matrix. More... | |
void | element (Home home, const Matrix< IntArgs > &m, IntVar x, IntVar y, BoolVar z, IntConLevel icl=ICL_DEF) |
Element constraint for matrix. More... | |
void | element (Home home, const Matrix< IntVarArgs > &m, IntVar x, IntVar y, IntVar z, IntConLevel icl=ICL_DEF) |
Element constraint for matrix. More... | |
void | element (Home home, const Matrix< BoolVarArgs > &m, IntVar x, IntVar y, BoolVar z, IntConLevel icl=ICL_DEF) |
Element constraint for matrix. More... | |
void | element (Home home, const Matrix< IntSetArgs > &m, IntVar x, IntVar y, SetVar z) |
Element constraint for matrix. More... | |
void | element (Home home, const Matrix< SetVarArgs > &m, IntVar x, IntVar y, SetVar z) |
Element constraint for matrix. More... | |
template<class A > | |
SymmetryHandle | rows_interchange (const Matrix< A > &m) |
Interchangeable rows symmetry specification. More... | |
template<class A > | |
SymmetryHandle | columns_interchange (const Matrix< A > &m) |
Interchangeable columns symmetry specification. More... | |
template<class A > | |
SymmetryHandle | rows_reflect (const Matrix< A > &m) |
Reflect rows symmetry specification. More... | |
template<class A > | |
SymmetryHandle | columns_reflect (const Matrix< A > &m) |
Reflect columns symmetry specification. More... | |
template<class A > | |
SymmetryHandle | diagonal_reflect (const Matrix< A > &m) |
Reflect around main diagonal symmetry specification. More... | |
Matrix-interface for arrays.
This class allows for wrapping some array and accessing it as a matrix.
Definition at line 1924 of file minimodel.hh.
typedef ArrayTraits<A>::ValueType Gecode::Matrix< A >::ValueType |
The type of elements of this array.
Definition at line 2001 of file minimodel.hh.
typedef ArrayTraits<A>::ArgsType Gecode::Matrix< A >::ArgsType |
The type of the Args-array type for ValueType values.
Definition at line 2003 of file minimodel.hh.
|
inline |
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.
MiniModel::ArgumentSizeMismatch | Raised if the parameters w and h doesn't match the size of the array a. |
Definition at line 131 of file matrix.hpp.
|
inline |
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.
MiniModel::ArgumentSizeMismatch | Raised if the parameter n doesn't match the size of the array a. |
Definition at line 139 of file matrix.hpp.
|
inline |
Return the width of the matrix.
Definition at line 147 of file matrix.hpp.
|
inline |
Return the height of the matrix.
Definition at line 150 of file matrix.hpp.
|
inline |
Return an Args-array of the contents of the matrix.
Definition at line 153 of file matrix.hpp.
|
inline |
Access element (c, r) of the matrix.
MiniModel::ArgumentOutOfRange | Raised if c or r are out of range. |
Definition at line 159 of file matrix.hpp.
|
inline |
Access element (c, r) of the matrix.
MiniModel::ArgumentOutOfRange | Raised if c or r are out of range. |
Definition at line 167 of file matrix.hpp.
|
inline |
Access slice of the matrix.
This function allows accessing a slice of the matrix, located at columns and rows
. The result of this function is an object that can be converted into either a Matrix<ArgsType> or into ArgsType.
For further information, see Slice.
Definition at line 175 of file matrix.hpp.
|
inline |
Access row r.
Definition at line 181 of file matrix.hpp.
|
inline |
Access column c.
Definition at line 187 of file matrix.hpp.
|
related |
Print matrix m
Definition at line 193 of file matrix.hpp.
|
related |
Print slice s
Definition at line 207 of file matrix.hpp.
|
related |
Element constraint for matrix.
Here, x and y are the coordinates and z is the value at position m(x,y).
Definition at line 212 of file matrix.hpp.
|
related |
Element constraint for matrix.
Here, x and y are the coordinates and z is the value at position m(x,y).
Definition at line 217 of file matrix.hpp.
|
related |
Element constraint for matrix.
Here, x and y are the coordinates and z is the value at position m(x,y).
Definition at line 222 of file matrix.hpp.
|
related |
Element constraint for matrix.
Here, x and y are the coordinates and z is the value at position m(x,y).
Definition at line 227 of file matrix.hpp.
|
related |
Element constraint for matrix.
Here, x and y are the coordinates and z is the value at position m(x,y).
Definition at line 234 of file matrix.hpp.
|
related |
Element constraint for matrix.
Here, x and y are the coordinates and z is the value at position m(x,y).
Definition at line 239 of file matrix.hpp.
|
related |
|
related |
|
related |
|
related |
|
related |