MVar::MVar()
Construct a MVar object with the given shape, filling with the given variable.
Synopsis
MVar(const Shape<N> &shp, const Var &var)Arguments
shp: shape of MVar.
var: Variable object.
MVar::MVar()
Construct a MVar object with the given shape, filling with an array of variables.
Synopsis
MVar(const Shape<N> &shp, const VarArray &vars)Arguments
shp: shape of MVar.
vars: an array of variables.
MVar::Clone()
Clone MVar object.
Synopsis
MVar Clone()Return
new MVar object.
MVar::Diagonal()
Get diagonals of MVar object.
Synopsis
MVar<N - 1> Diagonal(
int offset,
int axis1,
int axis2)Arguments
offset: offset of the diagonal from the main diagonal. Can be positive or negative.
axis1: 1st axis of MVar.
axis2: 2nd axis of MVar.Return
(N-1)-dimensional diagonals.
MVar::Expand()
Expand shape of MVar object.
Synopsis
MVar<N + 1> Expand(int axis)Arguments
axis: axis of MVar.Return
MVar object of (N+1)-dimensional shape.
MVar::Flatten()
Flatten a MVar object to a 1-dimensional shape.
Synopsis
MVar<1> Flatten()Return
a MVar object collapsed into one dimension.
MVar::Get()
Get values of information associated with variables in MVar object.
Synopsis
NdArray<double, N> Get(const char *szInfo)Arguments
szInfo: name of information.Return
multi-dimensional array of information of variables.
MVar::GetBasis()
Get basis of variables in MVar object.
Synopsis
NdArray<int, N> GetBasis()Return
multi-dimensional array of basis of variables.
MVar::GetDim()
Get i-th dimension of MVar object.
Synopsis
size_t GetDim(int i)Arguments
i: index of dimensionReturn
i-th dimension.
MVar::GetIdx()
Get indexes of variables in MVar object.
Synopsis
NdArray<int, N> GetIdx()Return
multi-dimensional array of indexes of variables.
MVar::GetLowerIIS()
Get IIS status of lower bound of variables in MVar object.
Synopsis
NdArray<int, N> GetLowerIIS()Return
multi-dimensional array of IIS status of lower bounds of variables.
MVar::GetND()
Get number of dimensions of MVar object.
Synopsis
int GetND()Return
number of dimensions.
MVar::GetShape()
Get shape of MVar object.
Synopsis
Shape<N> GetShape()Return
shape object.
MVar::GetSize()
Get size of MVar object.
Synopsis
size_t GetSize()Return
number of vars.
MVar::GetType()
Get types of variables in MVar object.
Synopsis
NdArray<char, N> GetType()Return
multi-dimensional array of types of variables.
MVar::GetUpperIIS()
Get IIS status of upper bound of variables in MVar object.
Synopsis
NdArray<int, N> GetUpperIIS()Return
multi-dimensional array of IIS status of upper bounds of variables.
MVar::Item()
Get variable of given index from MVar object.
Synopsis
Var &Item(size_t idx)Arguments
idx: index of var.Return
Var object.
MVar::operator[]()
Get variable of given index from MVar object.
Synopsis
Var &operator[](size_t idx)Arguments
idx: index of var.Return
Var object.
MVar::operator[]()
Get sub-arrays of MVar object, given view object.
Synopsis
MVar operator[](const View &view)Arguments
view: view of multi-dimensional array.Return
sub-arrays of MVar object.
MVar::Pick()
Given a list of indexes, get variables from MVar object.
Synopsis
MVar<1> Pick(const NdArray<int, 1> &indexes)Arguments
indexes: indexes of elements.Return
one-dimensional array of desired variables.
MVar::Pick()
Given a list of indexes, get variables from MVar object.
Synopsis
MVar<1> Pick(const NdArray<int, 2> &idxrows)Arguments
idxrows: indexes in format of 2-dimensional array, where each row is position of element.Return
one-dimensional array of desired variables.
MVar::Repeat()
Repeat each element of MVar along given axis.
Synopsis
MVar<N> Repeat(size_t repeats, int axis)Arguments
repeats: number of repetitions for each element.
axis: axis of MVar.Return
new MVar object.
MVar::RepeatBlock()
Repeat an MVar a number of times along given axis.
Synopsis
MVar<N> RepeatBlock(size_t repeats, int axis)Arguments
repeats: number of repetitions.
axis: axis of MVar.Return
new MVar object.
MVar::Represent()
String representation of MVar object.
Synopsis
std::string Represent(size_t maxlen)Arguments
maxlen: max length of representation.Return
string object.
MVar::Reshape()
Reshape MVar object to new shape.
Synopsis
template <int M> MVar<M> Reshape(const Shape<M> &shape)Arguments
shape: new shape of M-dimensions.Return
M-dimensional MVar object.
MVar::Set()
Set values of information associated with variables in MVar object.
Synopsis
void Set(const char *szInfo, double val)Arguments
szInfo: name of information.
val: value of information.
MVar::Set()
Set values of information associated with variables in MVar object.
Synopsis
void Set(const char *szInfo, const NdArray<double, N> &vals)Arguments
szInfo: name of information.
vals: multi-dimensional array of values of information.
MVar::SetItem()
Set variable of given index to MVar object.
Synopsis
void SetItem(size_t idx, const Var &var)Arguments
idx: index of element.
var: Var object.
MVar::Squeeze()
Remove axis of length 1 from shape of MVar object.
Synopsis
MVar<N - 1> Squeeze(int axis)Arguments
axis: axis of MVar, where the length is 1.Return
MVar object of (N-1)-dimensional shape.
MVar::Stack()
Stack with other MVar object along given axis.
Synopsis
MVar<N> Stack(const MVar<N> &other, int axis)Arguments
other: a MVar object.
axis: an axis of MVar.Return
the result MVar object.
MVar::Sum()
Sum of all variables in MVar object.
Synopsis
MLinExpr<0> Sum()Return
sum in zero dimension.
MVar::Sum()
Sum of variables at given axis of MVar object.
Synopsis
MLinExpr<N - 1> Sum(int axis)Arguments
axis: axis of MVar.Return
MLinExpr object in (N-1)-dimension.
MVar::Transpose()
Perform matrix transpose of MVar object.
Synopsis
MVar<N> Transpose()Return
transposed MVar object.