MLinExpr.AddConstant()
Add constant to each expression in MLinExpr object.
Synopsis
void AddConstant(double constant)
Arguments
constant
: the value of the constant.
MLinExpr.AddConstant()
Add constants to each expression in MLinExpr object.
Synopsis
void AddConstant(NdArray<double> constants)
Arguments
constants
: N-dimension NdArray object.
MLinExpr.AddExpr()
Add a linear expression to each expression in MLinExpr object.
Synopsis
void AddExpr(Expr expr, double mult)
Arguments
expr
: linear expression object.
mult
: the multiplier of linear expression, default value is 1.0.
MLinExpr.AddMExpr()
Add MExpression to each expression in MLinExpr object.
Synopsis
void AddMExpr(MExpression expr, double mult)
Arguments
expr
: MExpression object.
mult
: the multiplier of MExpression, default value is 1.0.
MLinExpr.AddMLinExpr()
Add linear expressions to MLinExpr object.
Synopsis
void AddMLinExpr(MLinExpr exprs, double mult)
Arguments
exprs
: N-dimension MLinExpr object.
mult
: the same multiplier for added linear expressions, default value is 1.0.
MLinExpr.AddTerm()
Add a linear term to MLinExpr object.
Synopsis
void AddTerm(Var var, double coeff)
Arguments
var
: variable of new term.
coeff
: coefficient of new term.
MLinExpr.AddTerms()
Add terms to expressions in MLinExpr object.
Synopsis
void AddTerms(MVar vars, NdArray<double> coeffs)
Arguments
vars
: N-dimension MVar object for added terms.
coeffs
: N-dimension NdArray object of coefficients for added terms.
MLinExpr.AddTerms()
Add terms to expressions in MLinExpr object.
Synopsis
void AddTerms(MVar vars, double mult)
Arguments
vars
: N-dimension MVar object for added terms.
mult
: the same coefficient for added terms, default value 1.0.
MLinExpr.Clear()
Clear MLinExpr object.
Synopsis
void Clear()
MLinExpr.Clone()
Clone MLinExpr object.
Synopsis
MLinExpr Clone()
Return
new MLinExpr object.
MLinExpr.Diagonal()
Get diagonals of MLinExpr object.
Synopsis
MLinExpr 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 MLinExpr.
axis2
: 2nd axis of MLinExpr.Return
(N-1)-dimensional diagonals.
MLinExpr.Expand()
Expand shape of MLinExpr object.
Synopsis
MLinExpr Expand(int axis)
Arguments
axis
: axis of MLinExpr.Return
MLinExpr object of (N+1)-dimensional shape.
MLinExpr.Flatten()
Flatten a MLinExpr object to a 1-dimensional shape.
Synopsis
MLinExpr Flatten()
Return
a MLinExpr object collapsed into one dimension.
MLinExpr.GetDim()
Get i-th dimension of MLinExpr object.
Synopsis
long GetDim(int i)
Arguments
i
: index of dimensionReturn
i-th dimension.
MLinExpr.GetItem()
Get expression of given index from MLinExpr object.
Synopsis
MExpression GetItem(long idx)
Arguments
idx
: index of expression.Return
MExpression object.
MLinExpr.GetItem()
Get sub-arrays of MLinExpr object, given view object.
Synopsis
MLinExpr GetItem(View view)
Arguments
view
: view of multi-dimensional array.Return
sub-arrays of MLinExpr object.
MLinExpr.GetND()
Get number of dimensions of MLinExpr object.
Synopsis
int GetND()
Return
number of dimensions.
MLinExpr.GetShape()
Get shape of MLinExpr object.
Synopsis
Shape GetShape()
Return
shape object.
MLinExpr.GetSize()
Get size of MLinExpr object.
Synopsis
long GetSize()
Return
number of linear expressions.
MLinExpr.HStack<T>()
Stack with other NdArray object along horizontal axis.
Synopsis
MLinExpr HStack<T>(NdArray<T> other)
Arguments
other
: a NdArray object.Return
the result MLinExpr object.
MLinExpr.HStack()
Stack with other MLinExpr object along horizontal axis.
Synopsis
MLinExpr HStack(MLinExpr other)
Arguments
other
: a MLinExpr object.Return
the result MLinExpr object.
MLinExpr.HStack()
Stack with other MVar object along horizontal axis.
Synopsis
MLinExpr HStack(MVar other)
Arguments
other
: a MVar object.Return
the result MLinExpr object.
MLinExpr.Pick()
Given a list of indexes, get linear expressions from MLinExpr object.
Synopsis
MLinExpr Pick(NdArray<int> indexes)
Arguments
indexes
: one or two dimensional indexes of elements. If two dimensional, each row is position of an element.Return
one-dimensional array of desired linear expressions.
MLinExpr.Repeat()
Repeat each element of MLinExpr along given axis.
Synopsis
MLinExpr Repeat(long repeats, int axis)
Arguments
repeats
: number of repetitions for each element.
axis
: axis of MLinExpr.Return
new MLinExpr object.
MLinExpr.RepeatBlock()
Repeat an MLinExpr a number of times along given axis.
Synopsis
MLinExpr RepeatBlock(long repeats, int axis)
Arguments
repeats
: number of repetitions.
axis
: axis of MLinExpr.Return
new MLinExpr object.
MLinExpr.Represent()
String representation of MLinExpr object.
Synopsis
string Represent(int maxlen)
Arguments
maxlen
: maximum buffer length for representations string.Return
string object.
MLinExpr.Reshape()
Reshape MLinExpr object to new shape.
Synopsis
MLinExpr Reshape(Shape shp)
Arguments
shp
: new shape of M-dimensions.Return
M-dimensional MLinExpr object.
MLinExpr.SetItem()
Set expression of given index to MLinExpr object.
Synopsis
void SetItem(long idx, MExpression expr)
Arguments
idx
: index of element.
expr
: MExpression object.
MLinExpr.Squeeze()
Remove axis of length 1 from shape of MLinExpr object.
Synopsis
MLinExpr Squeeze(int axis)
Arguments
axis
: axis of MLinExpr, where the length is 1.Return
MLinExpr object of (N-1)-dimensional shape.
MLinExpr.Stack<T>()
Stack with other NdArray object along given axis.
Synopsis
MLinExpr Stack<T>(NdArray<T> other, int axis)
Arguments
other
: a NdArray object.
axis
: an axis of MLinExpr.Return
the result MLinExpr object.
MLinExpr.Stack()
Stack with other MLinExpr object along given axis.
Synopsis
MLinExpr Stack(MLinExpr other, int axis)
Arguments
other
: a MLinExpr object.
axis
: an axis of MLinExpr.Return
the result MLinExpr object.
MLinExpr.Stack()
Stack with other MLinExpr object along given axis.
Synopsis
MLinExpr Stack(MVar other, int axis)
Arguments
other
: a MVar object.
axis
: an axis of MLinExpr.Return
the result MLinExpr object.
MLinExpr.SubConstant()
Substract constants from each expression in MLinExpr object.
Synopsis
void SubConstant(NdArray<double> constants)
Arguments
constants
: N-dimension NdArray object.
MLinExpr.Sum()
Sum of all expressions in MLinExpr object.
Synopsis
MLinExpr Sum()
Return
sum in zero dimension.
MLinExpr.Sum()
Sum of variables at given axis of MLinExpr object.
Synopsis
MLinExpr Sum(int axis)
Arguments
axis
: axis of MLinExpr.Return
MLinExpr object in (N-1)-dimension.
MLinExpr.Transpose()
Perform matrix transpose of MLinExpr object.
Synopsis
MLinExpr Transpose()
Return
transposed MLinExpr object.
MLinExpr.VStack<T>()
Stack with other NdArray object along vertical axis.
Synopsis
MLinExpr VStack<T>(NdArray<T> other)
Arguments
other
: a NdArray object.Return
the result MLinExpr object.
MLinExpr.VStack()
Stack with other MLinExpr object along vertical axis.
Synopsis
MLinExpr VStack(MLinExpr other)
Arguments
other
: a MLinExpr object.Return
the result MLinExpr object.
MLinExpr.VStack()
Stack with other MVar object along vertical axis.
Synopsis
MLinExpr VStack(MVar other)
Arguments
other
: a MVar object.Return
the result MLinExpr object.