14.2.1 Class BaseExpression¶
- mosek.fusion.BaseExpression¶
Base class for most expressions
- Members:
BaseExpression.Eval – Evaluate the expression and push the result onto the work stack.
BaseExpression.GetDim – Return the d’th dimension in the expression.
BaseExpression.GetModel – Get the associated model.
BaseExpression.GetND – Return the number of dimensions in the expression.
BaseExpression.GetShape – Get the shape of the expression.
BaseExpression.GetSize – Return the total number of elements in the expression (the product of the dimensions).
BaseExpression.Index – Get a single element in the expression.
BaseExpression.Pick – Pick a number of elements from the expression.
BaseExpression.Slice – Get a slice of the expression.
BaseExpression.ToString – Return a string representation of the expression object.
- Implemented by:
- BaseExpression.Eval¶
void Eval(WorkStack rs, WorkStack ws, WorkStack xs)
Evaluate the expression and push the result onto the
rs
work stack.
- BaseExpression.GetDim¶
int GetDim(int d)
Return the d’th dimension in the expression.
- Parameters:
d
(int
)- Return:
(
int
)
- BaseExpression.GetND¶
int GetND()
Return the number of dimensions in the expression.
- Return:
(
int
)
- BaseExpression.GetShape¶
int[] GetShape()
Get the shape of the expression.
- Return:
(
int
[])
- BaseExpression.GetSize¶
long GetSize()
Return the total number of elements in the expression (the product of the dimensions).
- Return:
(
long
)
- BaseExpression.Index¶
Expression Index(int i) Expression Index(int[] indexes)
Get a single element in the expression.
- Parameters:
i
(int
) – Index of the element to pick.indexes
(int
[]) – Multi-dimensional index of the element to pick.
- Return:
- BaseExpression.Pick¶
Expression Pick(int[] indexes) Expression Pick(int[,] indexrows)
Picks a number of elements from the expression and returns them as a one-dimensional expression.
- Parameters:
indexes
(int
[]) – Indexes of the elements to pickindexrows
(int
[,]) – Indexes of the elements to pick. Each row defines a separate multi-dimensional index.
- Return:
- BaseExpression.Slice¶
Expression Slice(int first, int last) Expression Slice(int[] firsta, int[] lasta)
Get a slice of the expression.
- Parameters:
first
(int
) – Index of the first element in the slice.last
(int
) – Index of the last element in the slice plus one.firsta
(int
[]) – Multi-dimensional index of the first element in the slice.lasta
(int
[]) – Multi-dimensional index of the element after the end of the slice.
- Return:
- BaseExpression.ToString¶
string ToString()
Return a string representation of the expression object.
- Return:
(
string
)