

Shp ( int) – Defines the shape of the expression. Val ( float) – A scalar value to be repeated in all entries of the expression. Size ( int) – Length of the vector to be constructed. Vals2 ( float) – An array initializing the expression. Vals1 ( float) – A vector initializing the expression. All expressions in the array must have the same shape.Įxpr.constTerm(float vals1) -> ExpressionĮxpr.constTerm(float vals2) -> ExpressionĮxpr.constTerm(int size, float val) -> ExpressionĮxpr.constTerm(int shp, float val) -> ExpressionĮxpr.constTerm(int shp, int sparsity, float vals1) -> ExpressionĮxpr.constTerm(int shp, int sparsity, float val) -> ExpressionĮxpr.constTerm(NDSparseArray nda) -> ExpressionĬreate an expression consisting of a constant vector of values. The list must contain at least one element.Įxps ( Expression) – A list of expressions. All variables in the array must have the same shape. N ( NDSparseArray) – An NDSparseArray object.

ParametersĪ1 ( float) – A one-dimensional array of constants.Ī2 ( float) – A two-dimensional array of constants. the scalar is added to all entries of the other argument. That matches the shape of the other argument, i.e. If one of the arguments is a single scalar, it is promoted to the shape The arguments must have the same shapes and the returned expression also has that shape. The following types of arguments are allowed:īy symmetry both add(A,B) and add(B,A) are available. Expr.add ¶Įxpr.add(Expression e1, Expression e2) -> ExpressionĮxpr.add(Expression e1, float a1) -> ExpressionĮxpr.add(Expression e1, float a2) -> ExpressionĮxpr.add(float a1, Expression e2) -> ExpressionĮxpr.add(float a2, Expression e2) -> ExpressionĮxpr.add(Expression e1, float c) -> ExpressionĮxpr.add(float c, Expression e2) -> ExpressionĮxpr.add(Expression e1, Matrix m) -> ExpressionĮxpr.add(Matrix m, Expression e2) -> ExpressionĮxpr.add(Expression e1, NDSparseArray n) -> ExpressionĮxpr.add(NDSparseArray n, Expression e2) -> ExpressionĮxpr.add(Expression exps) -> ExpressionĬomputes the sum of two or more expressions or variables. along the first dimension).Įxpr.zeros – Create an expression consisting of zeros. along the second dimension).Įxpr.mulDiag – Compute the diagonal of the product of two matrices.Įxpr.mulElm – Element-wise product of two items.Įxpr.neg – Change the sign of an expressionĮxpr.ones – Create an expression consisting of ones.Įxpr.outer – Return the outer-product of two vectors.Įxpr.repeat – Repeat an expression a number of times in the given dimension.Įxpr.reshape – Reshape the expression into a different shape with the same number of elements.Įxpr.stack – Stack a list of expressions in an arbitrary dimension.Įxpr.sub – Compute the difference of two expressions.Įxpr.sum – Sum the elements of an expression.Įxpr.transpose – Transpose a two-dimensional expression.Įxpr.vstack – Stack a list of expressions vertically (i.e. Static membersĮxpr.add – Compute the sum of expressions.Įxpr.condense – Flatten expression and remove all structural zeros.Įxpr.constTerm – Create an expression consisting of a constant vector of values.Įxpr.dot – Return a scalar expression object representing the dot-product of two items.Įxpr.flatten – Reshape the expression into a vector.Įxpr.hstack – Stack a list of expressions horizontally (i.e. \(A\) is a matrix on sparse form, \(x\) is a variable vector and \(b\) is aĪdditionally, the class defines a set of static methods for constructing and manipulatingīaseExpression.getDim – Return the d’th dimension in the expression.īaseExpression.getND – Return the number of dimensions in the expression.īaseExpression.getShape – Get the shape of the expression.īaseExpression.getSize – Return the total number of elements in the expression (the product of the dimensions).īaseExpression.index – Get a single element in the expression.īaseExpression.pick – Pick a number of elements from the expression.īaseExpression.slice – Get a slice of the expression.īaseExpression.toString – Return a string representation of the expression object.Įxpr.eval – Evaluate the expression and push the result onto the work stack.

It represents an expression of the form \(Ax+b\), where
