Reference
Contents
Index
ExpressionTreeForge.Complete_expr_treeExpressionTreeForge.M_abstract_expr_node.Abstract_expr_nodeExpressionTreeForge.M_abstract_expr_node.MyRefExpressionTreeForge.M_abstract_expr_tree.AbstractExprTreeExpressionTreeForge.M_abstract_expr_tree.BoundsExpressionTreeForge.M_abstract_tree.AbstractTreeExpressionTreeForge.M_bound_propagations.Bound_treeExpressionTreeForge.M_convexity_detection.Convexity_treeExpressionTreeForge.M_implementation_complete_expr_tree.Complete_expr_treeExpressionTreeForge.M_implementation_complete_expr_tree.Complete_nodeExpressionTreeForge.M_implementation_convexity_type.Convexity_typeExpressionTreeForge.M_implementation_convexity_type.Convexity_wrapperExpressionTreeForge.M_implementation_expr_tree.Type_expr_treeExpressionTreeForge.M_implementation_expr_tree_Expr.Variable_counterExpressionTreeForge.M_implementation_tree.Type_nodeExpressionTreeForge.M_trait_expr_node.Type_expr_nodeExpressionTreeForge.M_trait_expr_node.Type_not_expr_nodeExpressionTreeForge.M_trait_expr_tree.Is_expr_treeExpressionTreeForge.M_trait_expr_tree.Is_not_expr_treeExpressionTreeForge.M_trait_tree.Type_not_trait_treeExpressionTreeForge.M_trait_tree.Type_trait_treeExpressionTreeForge.M_trait_type_expr.Type_not_type_exprExpressionTreeForge.M_trait_type_expr.Type_type_exprExpressionTreeForge.Type_calculus_treeExpressionTreeForge.Type_expr_treeExpressionTreeForge.Type_nodeBase.showExpressionTreeForge.M_abstract_expr_node.create_new_vector_myRefExpressionTreeForge.M_abstract_expr_node.create_node_exprExpressionTreeForge.M_abstract_expr_node.create_undef_array_myRefExpressionTreeForge.M_abstract_expr_node.create_vector_of_vector_myRefExpressionTreeForge.M_abstract_expr_node.equalize_vec_vec_myRef!ExpressionTreeForge.M_abstract_expr_node.get_myRefExpressionTreeForge.M_abstract_expr_node.new_refExpressionTreeForge.M_abstract_expr_node.set_myRef!ExpressionTreeForge.M_abstract_expr_tree.create_ExprExpressionTreeForge.M_abstract_expr_tree.create_Expr2ExpressionTreeForge.M_abstract_expr_tree.create_Expr_JuMPExpressionTreeForge.M_abstract_expr_tree.create_empty_boundsExpressionTreeForge.M_abstract_expr_tree.create_expr_treeExpressionTreeForge.M_abstract_expr_tree.get_boundsExpressionTreeForge.M_abstract_expr_tree.set_bound!ExpressionTreeForge.M_abstract_tree.create_treeExpressionTreeForge.M_algo_expr_tree.N_to_NiExpressionTreeForge.M_algo_expr_tree.cast_type_of_constantExpressionTreeForge.M_algo_expr_tree.extract_element_functionsExpressionTreeForge.M_algo_expr_tree.get_UiExpressionTreeForge.M_algo_expr_tree.get_elemental_variablesExpressionTreeForge.M_algo_expr_tree.get_type_treeExpressionTreeForge.M_algo_expr_tree.non_linear_JuMP_model_evaluatorExpressionTreeForge.M_algo_expr_tree.normalize_indices!ExpressionTreeForge.M_algo_expr_tree.sparse_jacobian_JuMP_modelExpressionTreeForge.M_bound_propagations.create_bounds_treeExpressionTreeForge.M_bound_propagations.get_boundsExpressionTreeForge.M_bound_propagations.set_bounds!ExpressionTreeForge.M_convexity_detection.concave_typeExpressionTreeForge.M_convexity_detection.constant_typeExpressionTreeForge.M_convexity_detection.convex_typeExpressionTreeForge.M_convexity_detection.create_convex_treeExpressionTreeForge.M_convexity_detection.get_convexity_statusExpressionTreeForge.M_convexity_detection.linear_typeExpressionTreeForge.M_convexity_detection.set_convexity!ExpressionTreeForge.M_convexity_detection.unknown_typeExpressionTreeForge.M_evaluation_expr_tree.gradient_forwardExpressionTreeForge.M_evaluation_expr_tree.hessianExpressionTreeForge.M_implementation_convexity_type.concave_typeExpressionTreeForge.M_implementation_convexity_type.concave_wrapperExpressionTreeForge.M_implementation_convexity_type.constant_typeExpressionTreeForge.M_implementation_convexity_type.constant_wrapperExpressionTreeForge.M_implementation_convexity_type.convex_typeExpressionTreeForge.M_implementation_convexity_type.convex_wrapperExpressionTreeForge.M_implementation_convexity_type.get_convexity_wrapperExpressionTreeForge.M_implementation_convexity_type.init_conv_statusExpressionTreeForge.M_implementation_convexity_type.is_concaveExpressionTreeForge.M_implementation_convexity_type.is_constantExpressionTreeForge.M_implementation_convexity_type.is_convexExpressionTreeForge.M_implementation_convexity_type.is_linearExpressionTreeForge.M_implementation_convexity_type.is_not_treatedExpressionTreeForge.M_implementation_convexity_type.is_treatedExpressionTreeForge.M_implementation_convexity_type.is_unknownExpressionTreeForge.M_implementation_convexity_type.linear_typeExpressionTreeForge.M_implementation_convexity_type.linear_wrapperExpressionTreeForge.M_implementation_convexity_type.not_treated_typeExpressionTreeForge.M_implementation_convexity_type.set_convexity_wrapper!ExpressionTreeForge.M_implementation_convexity_type.unknown_typeExpressionTreeForge.M_implementation_convexity_type.unknown_wrapperExpressionTreeForge.M_implementation_tree.equal_treeExpressionTreeForge.M_implementation_type_expr.return_constantExpressionTreeForge.M_implementation_type_expr.return_cubicExpressionTreeForge.M_implementation_type_expr.return_linearExpressionTreeForge.M_implementation_type_expr.return_moreExpressionTreeForge.M_implementation_type_expr.return_quadraticExpressionTreeForge.M_interface_expr_node._cast_constant!ExpressionTreeForge.M_interface_expr_node._change_from_N_to_Ni!ExpressionTreeForge.M_interface_expr_node._evaluate_nodeExpressionTreeForge.M_interface_expr_node._evaluate_node!ExpressionTreeForge.M_interface_expr_node._get_type_nodeExpressionTreeForge.M_interface_expr_node._get_var_indexExpressionTreeForge.M_interface_expr_node._node_boundExpressionTreeForge.M_interface_expr_node._node_convexityExpressionTreeForge.M_interface_expr_node._node_is_constantExpressionTreeForge.M_interface_expr_node._node_is_cosExpressionTreeForge.M_interface_expr_node._node_is_minusExpressionTreeForge.M_interface_expr_node._node_is_operatorExpressionTreeForge.M_interface_expr_node._node_is_plusExpressionTreeForge.M_interface_expr_node._node_is_powerExpressionTreeForge.M_interface_expr_node._node_is_sinExpressionTreeForge.M_interface_expr_node._node_is_tanExpressionTreeForge.M_interface_expr_node._node_is_timesExpressionTreeForge.M_interface_expr_node._node_is_variableExpressionTreeForge.M_interface_expr_node._node_to_ExprExpressionTreeForge.M_interface_expr_node._node_to_Expr2ExpressionTreeForge.M_interface_expr_node._node_to_Expr_JuMPExpressionTreeForge.M_interface_expr_tree._expr_tree_to_createExpressionTreeForge.M_interface_expr_tree._get_expr_childrenExpressionTreeForge.M_interface_expr_tree._get_expr_nodeExpressionTreeForge.M_interface_expr_tree._get_real_nodeExpressionTreeForge.M_interface_expr_tree._inverse_expr_treeExpressionTreeForge.M_interface_expr_tree._sum_expr_treesExpressionTreeForge.M_interface_expr_tree._transform_to_expr_treeExpressionTreeForge.M_interface_tree._get_childrenExpressionTreeForge.M_interface_tree._get_childrenExpressionTreeForge.M_interface_tree._get_nodeExpressionTreeForge.M_interface_tree._get_nodeExpressionTreeForge.M_interface_type_expr._is_constantExpressionTreeForge.M_interface_type_expr._is_constantExpressionTreeForge.M_interface_type_expr._is_cubicExpressionTreeForge.M_interface_type_expr._is_cubicExpressionTreeForge.M_interface_type_expr._is_linearExpressionTreeForge.M_interface_type_expr._is_linearExpressionTreeForge.M_interface_type_expr._is_moreExpressionTreeForge.M_interface_type_expr._is_moreExpressionTreeForge.M_interface_type_expr._is_quadraticExpressionTreeForge.M_interface_type_expr._is_quadraticExpressionTreeForge.M_interface_type_expr._type_powerExpressionTreeForge.M_interface_type_expr._type_powerExpressionTreeForge.M_interface_type_expr._type_productExpressionTreeForge.M_interface_type_expr._type_productExpressionTreeForge.M_trait_expr_node.cast_constant!ExpressionTreeForge.M_trait_expr_node.change_from_N_to_Ni!ExpressionTreeForge.M_trait_expr_node.evaluate_nodeExpressionTreeForge.M_trait_expr_node.get_type_nodeExpressionTreeForge.M_trait_expr_node.get_var_indexExpressionTreeForge.M_trait_expr_node.node_boundExpressionTreeForge.M_trait_expr_node.node_convexityExpressionTreeForge.M_trait_expr_node.node_is_constantExpressionTreeForge.M_trait_expr_node.node_is_cosExpressionTreeForge.M_trait_expr_node.node_is_minusExpressionTreeForge.M_trait_expr_node.node_is_operatorExpressionTreeForge.M_trait_expr_node.node_is_plusExpressionTreeForge.M_trait_expr_node.node_is_powerExpressionTreeForge.M_trait_expr_node.node_is_sinExpressionTreeForge.M_trait_expr_node.node_is_tanExpressionTreeForge.M_trait_expr_node.node_is_timesExpressionTreeForge.M_trait_expr_node.node_is_variableExpressionTreeForge.M_trait_expr_node.node_to_ExprExpressionTreeForge.M_trait_expr_node.node_to_Expr2ExpressionTreeForge.M_trait_expr_node.node_to_Expr_JuMPExpressionTreeForge.M_trait_expr_tree.expr_tree_equalExpressionTreeForge.M_trait_expr_tree.expr_tree_to_createExpressionTreeForge.M_trait_expr_tree.get_expr_childrenExpressionTreeForge.M_trait_expr_tree.get_expr_nodeExpressionTreeForge.M_trait_expr_tree.get_real_nodeExpressionTreeForge.M_trait_expr_tree.inverse_expr_treeExpressionTreeForge.M_trait_expr_tree.is_expr_treeExpressionTreeForge.M_trait_expr_tree.sum_expr_treesExpressionTreeForge.M_trait_expr_tree.transform_to_ExprExpressionTreeForge.M_trait_expr_tree.transform_to_Expr_JuMPExpressionTreeForge.M_trait_expr_tree.transform_to_expr_treeExpressionTreeForge.M_trait_tree.get_childrenExpressionTreeForge.M_trait_tree.get_nodeExpressionTreeForge.M_trait_tree.is_type_trait_treeExpressionTreeForge.M_trait_type_expr.is_constantExpressionTreeForge.M_trait_type_expr.is_cubicExpressionTreeForge.M_trait_type_expr.is_linearExpressionTreeForge.M_trait_type_expr.is_moreExpressionTreeForge.M_trait_type_expr.is_quadraticExpressionTreeForge.M_trait_type_expr.is_trait_type_exprExpressionTreeForge.M_trait_type_expr.type_powerExpressionTreeForge.M_trait_type_expr.type_productExpressionTreeForge.algo_tree.printer_treeExpressionTreeForge.cast_type_of_constantExpressionTreeForge.complete_treeExpressionTreeForge.concave_typeExpressionTreeForge.constant_typeExpressionTreeForge.convex_typeExpressionTreeForge.create_bounds_treeExpressionTreeForge.create_convex_treeExpressionTreeForge.evaluate_expr_treeExpressionTreeForge.evaluate_expr_tree_multiple_pointsExpressionTreeForge.extract_element_functionsExpressionTreeForge.get_UiExpressionTreeForge.get_boundsExpressionTreeForge.get_convexity_statusExpressionTreeForge.get_elemental_variablesExpressionTreeForge.get_expression_treeExpressionTreeForge.get_function_of_evaluationExpressionTreeForge.get_type_treeExpressionTreeForge.gradient_forwardExpressionTreeForge.gradient_reverseExpressionTreeForge.hessianExpressionTreeForge.is_concaveExpressionTreeForge.is_constantExpressionTreeForge.is_constantExpressionTreeForge.is_convexExpressionTreeForge.is_cubicExpressionTreeForge.is_linearExpressionTreeForge.is_linearExpressionTreeForge.is_moreExpressionTreeForge.is_not_treatedExpressionTreeForge.is_quadraticExpressionTreeForge.is_treatedExpressionTreeForge.is_unknownExpressionTreeForge.linear_typeExpressionTreeForge.non_linear_JuMP_model_evaluatorExpressionTreeForge.normalize_indices!ExpressionTreeForge.print_treeExpressionTreeForge.set_bounds!ExpressionTreeForge.set_convexity!ExpressionTreeForge.sparse_jacobian_JuMP_modelExpressionTreeForge.sum_expr_treesExpressionTreeForge.transform_to_ExprExpressionTreeForge.transform_to_Expr_JuMPExpressionTreeForge.transform_to_Expr_juliaExpressionTreeForge.transform_to_expr_treeExpressionTreeForge.unknown_type
ExpressionTreeForge.Complete_expr_tree — Type
Complete_expr_tree{T} <: AbstractTreeImplementation of an expression tree. Complete_expr_tree is the same than Type_expr_tree with the additions in each node of a Bounds and Convexity_wrapper. A Complete_expr_tree has fields:
field::Complete_node{T}representing an operator, a constant or a variable alongide its bounds and its convexity status;children::Vector{Complete_expr_tree{T}}a vector of children, each of them being aComplete_expr_tree{T}.
ExpressionTreeForge.Type_calculus_tree — Type
Type_calculus_treeRepresent the different types that a expression can be :
constantlinearquadraticcubicmorewhich means non-linear, non-quadratic and non-cubic.
ExpressionTreeForge.Type_expr_tree — Type
Type_expr_tree{T} <: AbstractTreeBasic implementation of an expression tree. Every expression tree supported must be able to return Type_expr_tree with transform_to_expr_tree. A Type_expr_tree has fields:
field::Abstract_expr_noderepresenting an operator, a constant or a variable;children::Vector{Type_expr_tree{T}}a vector of children, each of them being aType_expr_tree{T}.
ExpressionTreeForge.Type_node — Type
Type_node{T} <: AbstractTreeBasic implementation of a tree. A Type_node has fields:
fieldgathering the informations about the current node;childrena vector of children, each of them being aType_node.
ExpressionTreeForge.cast_type_of_constant — Method
cast_type_of_constant(expr_tree, type::DataType)Cast to type the constants of expr_tree. expr_tree may be an Expr, a Type_expr_tree or a Complete_expr_tree.
ExpressionTreeForge.complete_tree — Method
complete_tree = complete_tree(expression_tree::Type_expr_tree)Create a complete_tree::Complete_expr_tree from expression_tree.
ExpressionTreeForge.concave_type — Method
concave = concave_type()Return the value concave from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.constant_type — Method
constant = constant_type()Return the value constant from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.convex_type — Method
convex = convex_type()Return the value convex from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.create_bounds_tree — Method
bound_tree = create_bounds_tree(tree)Return a convexity tree shaped as tree, where each node has an undefined bounds.
ExpressionTreeForge.create_convex_tree — Method
convex_tree = create_convex_tree(tree::Type_expr_tree)Return bounds' tree with the same shaped than tree, where each node has an undefined convexity status.
ExpressionTreeForge.evaluate_expr_tree — Method
evaluate_expr_tree(expr_tree::Type_expr_tree, x::AbstractVector)
evaluate_expr_tree(expr_tree::Complete_expr_tree, x::AbstractVector)Evaluate the expr_tree given the vector x.
Example:
julia> evaluate_expr_tree(:(x[1] + x[2]), ones(2))
2.ExpressionTreeForge.evaluate_expr_tree_multiple_points — Method
evaluate_expr_tree_multiple_points(expression_tree::Any, x::AbstractVector{AbstractVector}})
evaluate_expr_tree_multiple_points(expression_tree::Any)Evaluate the expression_tree for several points, represented as x.
ExpressionTreeForge.extract_element_functions — Method
separated_terms = extract_element_functions(expr_tree)Return the element functions of expr_tree as a vector of its subexpressions. expr_tree may be an Expr, a Type_expr_tree or a Complete_expr_tree.
Example:
julia> extract_element_functions(:(x[1] + x[2] + x[3]*x[4]))
3-element Vector{Expr}:
:(x[1])
:(x[2])
:(x[3] * x[4])ExpressionTreeForge.get_Ui — Method
Ui = get_Ui(indices::Vector{Int}, n::Int)Create a SparseMatrix Ui from indices computed by get_elemental_variables. Every index i (of indices) form a line of Ui corresponding to i-th Euclidian vector.
ExpressionTreeForge.get_bounds — Method
(inf_bound, sup_bound) = get_bounds(bound_tree::Bound_tree)Retrieve the bounds from the root of bound_tree (a given bounds' tree).
ExpressionTreeForge.get_convexity_status — Method
convexity_status = get_convexity_status(convexity_tree::M_convexity_detection.Convexity_tree)
convexity_status = get_convexity_status(complete_tree::Complete_expr_tree)Return the convexity status of either a convexity_tree or a complete_tree. The status can be:
constantlinearconvexconcaveunknown
ExpressionTreeForge.get_elemental_variables — Method
indices = get_elemental_variables(expr_tree)Return the indices of the variable appearing in expr_tree. This function is used to find the elemental variables from the expression tree of an element function. expr_tree may be an Expr, a Type_expr_tree or a Complete_expr_tree.
Example:
julia> get_elemental_variables(:(x[1] + x[3]) )
[1, 3]
julia> get_elemental_variables(:(x[1]^2 + x[6] + x[2]) )
[1, 6, 2]ExpressionTreeForge.get_expression_tree — Function
expr = get_expression_tree(monlp::MathOptNLPModel)
expr = get_expression_tree(adnlp::ADNLPModel)
expr = get_expression_tree(model::JuMP.Model)
expr = get_expression_tree(evaluator::MOI.Nonlinear.Evaluator)Return the objective function as a Type_expr_tree for: a MathOptNLPModel, a ADNLPModel, a JuMP.Model or a MOI.Nonlinear.Evaluator.
ExpressionTreeForge.get_function_of_evaluation — Method
eval_expression_tree = get_function_of_evaluation(expression_tree::Type_expr_tree)Return and evaluation function of expression_tree with better performance than the actual evaluate_expr_tree.
ExpressionTreeForge.get_type_tree — Method
type = get_type_tree(expr_tree)Return the type of expr_tree. It can either be: constant, linear, quadratic, cubic or more. expr_tree may be an Expr, a Type_expr_tree or a Complete_expr_tree.
Example:
julia> get_type_tree(:(5+4)) == constant
true
julia> get_type_tree(:(x[1])) == linear
true
julia> get_type_tree(:(x[1]* x[2])) == quadratic
trueExpressionTreeForge.gradient_forward — Method
gradient = gradient_forward(expr_tree, x)Evaluate the gradient of expr_tree at the point x with a forward automatic differentiation method.
Example:
julia> gradient_forward(:(x[1] + x[2]), rand(2))
[1.0 1.0]ExpressionTreeForge.gradient_reverse — Method
gradient = gradient_reverse(expr_tree, x)Evaluate the gradient of expr_tree at the point x with a reverse automatic differentiation method.
Example:
julia> gradient_reverse(:(x[1] + x[2]), rand(2))
[1.0 1.0]ExpressionTreeForge.hessian — Method
hess = hessian(expr_tree, x)Evaluate the Hessian of expr_tree at the point x with a forward automatic differentiation.
Example:
julia> hessian(:(x[1]^2 + x[2]), rand(2))
[2.0 0.0; 0.0 0.0]ExpressionTreeForge.is_concave — Method
bool = is_concave(status::Convexity_type)
bool = is_concave(convexity::Convexity_wrapper)Check if convexity or status is equal to concave.
ExpressionTreeForge.is_constant — Method
bool = is_constant(status::Convexity_type)
bool = is_constant(convexity::Convexity_wrapper)Check if convexity or status is equal to constant.
ExpressionTreeForge.is_constant — Method
bool = is_constant(type::Type_calculus_tree)Check if type values constant from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_convex — Method
bool = is_convex(status::Convexity_type)
bool = is_convex(convexity::Convexity_wrapper)Check if convexity or status is equal to convex.
ExpressionTreeForge.is_cubic — Method
bool = is_cubic(type::Type_calculus_tree)Check if type values cubic from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_linear — Method
bool = is_linear(status::Convexity_type)
bool = is_linear(convexity::Convexity_wrapper)Check if convexity or status is equal to linear.
ExpressionTreeForge.is_linear — Method
bool = is_linear(type::Type_calculus_tree)Check if type values linear from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_more — Method
bool = is_more(type::Type_calculus_tree)Check if type values more from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_not_treated — Method
bool = is_not_treated(status::Convexity_type)
bool = is_not_treated(convexity::Convexity_wrapper)Check if convexity or status is equal to not_treated.
ExpressionTreeForge.is_quadratic — Method
bool = is_quadratic(type::Type_calculus_tree)Check if type values quadratic from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_treated — Method
bool = is_treated(status::Convexity_type)
bool = is_treated(convexity::Convexity_wrapper)Check if convexity or status is equal to different of not_treated.
ExpressionTreeForge.is_unknown — Method
bool = is_unknown(status::Convexity_type)
bool = is_unknown(convexity::Convexity_wrapper)Check if convexity or status is equal to unknown.
ExpressionTreeForge.linear_type — Method
linear = linear_type()Return the value linear from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.non_linear_JuMP_model_evaluator — Method
evaluator = non_linear_JuMP_model_evaluator(expr_tree; variables::Vector{Int})Return a MathOptInterface.Nonlinear.Model and its initialized evaluator for any expr_tree supported. variables informs the indices of the variables appearing in expr_tree. If variables is not provided, it is determined automatically through sort!(get_elemental_variables(expr_tree)). Warning: variables must be sorted! Example:
expr_tree = :(x[1]^2 + x[3]^3)
variables = [1,3]
evaluator = non_linear_JuMP_model_evaluator(expr_tree; variables)Afterward, you may evaluate the function and the gradient from expr_tree with:
x = rand(2)
MOI.eval_objective(evaluator, x)
grad = similar(x)
MOI.eval_objective_gradient(evaluator, grad, x)Warning: The size of x depends on the number of variables of expr_tree and not from the highest variable's index.
ExpressionTreeForge.normalize_indices! — Method
normalize_indices!(expr_tree, vector_indices::Vector{Int})Change the indices of the variables from expr_tree to follow the order given by vector_indices. It is paired with get_elemental_variables to define the elemental element function expression tree. expr_tree may be an Expr, a Type_expr_tree or a Complete_expr_tree.
Example:
julia> normalize_indices!(:(x[4] + x[5]), [4,5])
:(x[1] + x[2])ExpressionTreeForge.print_tree — Method
print_tree(tree::AbstractTree)Print a tree as long as it satisfies the interface M_interface_tree.
ExpressionTreeForge.set_bounds! — Method
set_bounds!(tree::Type_expr_tree, bound_tree::Bound_tree)
set_bounds!(complete_tree::Complete_expr_tree)Set the bounds of bound_tree by walking tree and propagate the bounds' computation from the leaves to the root. As a Complete_expr_tree contains a precompiled bound_tree, it can be used alone.
ExpressionTreeForge.set_convexity! — Method
set_convexity!(tree::Type_expr_tree, convexity_tree::Convexity_tree, bound_tree::Bound_tree)
set_convexity!(complete_tree::Complete_expr_tree)Deduce from elementary rules the convexity status of tree nodes or complete_tree nodes. complete_tree stores a bounds tree and can run the convexity detection standalone whereas tree requires the bound_tree (see create_bounds_tree) and convexity_tree (see create_convex_tree).
ExpressionTreeForge.sparse_jacobian_JuMP_model — Method
evaluator = sparse_jacobian_JuMP_model(expr_trees)Return the evaluator of a MathOptInterface.Nonlinear.Model defined by expr_tree, as long as it is supported. The evaluator considers the objective function as the sum of expr_trees and a constraint for each expr_tree contained in expr_trees. If the expression trees in expr_trees depend on a subset of variables, the Jacobian of the constraints will be sparse.
ExpressionTreeForge.sum_expr_trees — Method
summed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})Sum every trees.
ExpressionTreeForge.transform_to_Expr — Method
expr = transform_to_Expr(expr_tree)Transform expr_tree into an Expr. expr_tree may be a Type_expr_tree or a Complete_expr_tree. Warning: This function return an Expr with variables as MathOptInterface.VariableIndex. In order to get an standard Expr use transform_to_Expr_julia.
ExpressionTreeForge.transform_to_Expr_JuMP — Method
expr = transform_to_Expr_JuMP(expr_tree)Transform expr_tree into an Expr. expr_tree may be a Type_expr_tree or a Complete_expr_tree.
ExpressionTreeForge.transform_to_Expr_julia — Method
expr = transform_to_Expr_julia(expr_tree)Transform expr_tree into an Expr. expr_tree may be a Type_expr_tree or a Complete_expr_tree.
ExpressionTreeForge.transform_to_expr_tree — Method
expr_tree = transform_to_expr_tree(expr::Expr)Transform expr into an expr_tree::Type_expr_tree.
ExpressionTreeForge.unknown_type — Method
unknown = unknown_type()Return the value unknown from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_abstract_expr_tree.AbstractExprTree — Type
Supertype of every expression tree.
ExpressionTreeForge.M_abstract_expr_tree.Bounds — Type
Bounds{T <: Number}Structure representing the upper-bound and the lower-bound of a node.
ExpressionTreeForge.M_abstract_expr_tree.create_Expr — Method
expr = create_expr_tree(tree)Create an Expr from tree. Several types of tree are supported. For now, it supports Expr and ModelingToolkit.Operation, as well as the internal expression trees defined. The variables of the Expr use MathOptInterface variables.
ExpressionTreeForge.M_abstract_expr_tree.create_Expr2 — Method
expr = create_expr_tree(tree)Create a Julia Expr from tree. Several types of tree are supported. For now, it supports Expr and ModelingToolkit.Operation, as well as the internal expression trees defined.
ExpressionTreeForge.M_abstract_expr_tree.create_Expr_JuMP — Method
expr = create_expr_tree(tree)Create an Expr from tree. Several types of tree are supported. For now, it supports Expr and ModelingToolkit.Operation, as well as the internal expression trees defined. The variables of the Expr use MathOptInterface.VariableIndex(i).
ExpressionTreeForge.M_abstract_expr_tree.create_empty_bounds — Method
bound = create_empty_bounds(type::DataType)Create a Bounds structure of type.
ExpressionTreeForge.M_abstract_expr_tree.create_expr_tree — Method
expr_tree = create_expr_tree(tree)Create an Type_expr_tree from tree. Several types of tree are supported. For now, it supports Expr and ModelingToolkit.Operation, as well as the internal expression trees defined.
ExpressionTreeForge.M_abstract_expr_tree.get_bounds — Method
(inf_bound, sup_bound) = get_bounds(bound::Bounds{T}) where {T <: Number}Retrieve both inf_bound and sup_bound from bound.
ExpressionTreeForge.M_abstract_expr_tree.set_bound! — Method
set_bound!(bound::Bounds{T}, inf_bound::T, sup_bound::T) where {T <: Number}Set bound to inf_bound and sup_bound.
ExpressionTreeForge.M_trait_expr_tree.Is_expr_tree — Type
Type instantiated dynamically representeing that an argument is an expression tree.
ExpressionTreeForge.M_trait_expr_tree.Is_not_expr_tree — Type
Type instantiated dynamically representeing that an argument is not an expression tree.
ExpressionTreeForge.M_trait_expr_tree.expr_tree_equal — Function
bool = expr_tree_equal(expr_tree1, expr_tree2, eq::Atomic{Bool} = Atomic{Bool}(true))Check if both expr_tree1 and expr_tree2 represent the same expression tree.
ExpressionTreeForge.M_trait_expr_tree.expr_tree_to_create — Method
expr_tree = expr_tree_to_create(tree1::AbstractExprTree, tree2::AbstractExprTree)Return expr_tree, a expression tree of the type from tree2 with the values of tree1. It is supported for few expression-tree structure.
ExpressionTreeForge.M_trait_expr_tree.get_expr_children — Method
children = get_expr_children(tree::AbstractExprTree)Return the children from the root of tree.
ExpressionTreeForge.M_trait_expr_tree.get_expr_node — Method
node = get_expr_node(tree::AbstractExprTree)Return the root node of tree.
ExpressionTreeForge.M_trait_expr_tree.get_real_node — Method
_get_real_node(tree::AbstractExprTree)Return the value of a leaf in a suitable format for particular algorithm.
ExpressionTreeForge.M_trait_expr_tree.inverse_expr_tree — Method
minus_tree = inverse_expr_tree(tree::AbstractExprTree)Return minus_tree which apply a unary minus onto tree.
ExpressionTreeForge.M_trait_expr_tree.is_expr_tree — Method
verifier_type = is_expr_tree(arg)Return Is_expr_tree if arg is considered as an implementation of an expression tree, it returns Is_not_expr_tree otherwise.
ExpressionTreeForge.M_trait_expr_tree.sum_expr_trees — Method
summed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})Sum every trees.
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr — Method
expr = transform_to_Expr(expr_tree)Return expr::Expr from the expression tree expr_tree.
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr_JuMP — Method
expr = transform_to_Expr_JuMP(expr_tree)Return expr::Expr from the expression tree expr_tree. The variable in expr are provided using MathOptInterface.VariableIndex.
ExpressionTreeForge.M_trait_expr_tree.transform_to_expr_tree — Method
expr_tree = _transform_to_expr_tree(tree::AbstractExprTree)Return expr_tree::Type_expr_tree from tree. Type_expr_tree is the internal expression tree structure.
ExpressionTreeForge.M_interface_expr_tree._expr_tree_to_create — Method
expr_tree = _expr_tree_to_create(tree1::AbstractExprTree, tree2::AbstractExprTree)Return expr_tree, a expression tree of the type from tree2 with the values of tree1. It is supported for few expression-tree structure.
ExpressionTreeForge.M_interface_expr_tree._get_expr_children — Method
children = _get_expr_children(tree::AbstractExprTree)Return the children from the root of tree.
ExpressionTreeForge.M_interface_expr_tree._get_expr_node — Method
node = _get_expr_node(tree::AbstractExprTree)Return the root node of tree.
ExpressionTreeForge.M_interface_expr_tree._get_real_node — Method
_get_real_node(tree::AbstractExprTree)Return the value of a leaf in a suitable format for particular algorithm.
ExpressionTreeForge.M_interface_expr_tree._inverse_expr_tree — Method
minus_tree = _inverse_expr_tree(tree::AbstractExprTree)Apply a unary minus on tree.
ExpressionTreeForge.M_interface_expr_tree._sum_expr_trees — Method
summed_tree = _sum_expr_trees(trees::Vector{::AbstractExprTree})Sum every trees.
ExpressionTreeForge.M_interface_expr_tree._transform_to_expr_tree — Method
expr_tree = _transform_to_expr_tree(tree::AbstractExprTree)Return expr_tree::Type_expr_tree from tree. Type_expr_tree is the internal expression tree structure.
ExpressionTreeForge.M_implementation_expr_tree_Expr.Variable_counter — Type
Variable_counterAssociate the index of the symbol variable to their integer index.
ExpressionTreeForge.M_implementation_expr_tree.Type_expr_tree — Type
Type_expr_tree{T} <: AbstractTreeBasic implementation of an expression tree. Every expression tree supported must be able to return Type_expr_tree with transform_to_expr_tree. A Type_expr_tree has fields:
field::Abstract_expr_noderepresenting an operator, a constant or a variable;children::Vector{Type_expr_tree{T}}a vector of children, each of them being aType_expr_tree{T}.
ExpressionTreeForge.M_implementation_complete_expr_tree.Complete_expr_tree — Type
Complete_expr_tree{T} <: AbstractTreeImplementation of an expression tree similar to Type_expr_tree. Complete_expr_tree considers a Complete_node which adds the Bounds and a Convexity_wrapper to each node. A Complete_expr_tree has fields:
field::Complete_node{T}representing an operator, a constant or a variable alongide its bounds and its convexity status;children::Vector{Complete_expr_tree{T}}a vector of children, each of them being aComplete_expr_tree{T}.
ExpressionTreeForge.M_implementation_complete_expr_tree.Complete_node — Type
Complete_node{T <: Number}Gather in a single structure:
op::M_abstract_expr_node.Abstract_expr_nodean arithmetic operator;bounds::M_abstract_expr_tree.Bounds{T}the bounds of this operator depending on its children;convexity_status::M_implementation_convexity_type.Convexity_wrapperthe convexity status of this operator depending on its children.
ExpressionTreeForge.M_evaluation_expr_tree.gradient_forward — Method
gradient_forward(expr_tree, x)Evaluate the gradient of the function represented by `expr_tree at the point x.
ExpressionTreeForge.M_evaluation_expr_tree.hessian — Method
hess = hessian(expr_tree, x)Compute the hessian matrix of the function represented by expr_tree at the point x.
ExpressionTreeForge.M_bound_propagations.Bound_tree — Type
Bound_treeA tree where each node is a pair (bound_inf, bound_sup). Must be paired with an expression tree.
ExpressionTreeForge.M_bound_propagations.create_bounds_tree — Function
bound_tree = create_bounds_tree(tree)Return a convexity tree shaped as tree, where each node has an undefined bounds.
ExpressionTreeForge.M_bound_propagations.get_bounds — Method
(inf_bound, sup_bound) = get_bounds(bound_tree::Bound_tree)Retrieve the bounds from the root of bound_tree (a given bounds' tree).
ExpressionTreeForge.M_bound_propagations.set_bounds! — Method
set_bounds!(tree, bound_tree::Bound_tree)
set_bounds!(complete_tree::Complete_expr_tree)Set the bounds of bound_tree by walking tree and by propagating the computations from the leaves to the root. A Complete_expr_tree contains a precompiled bound_tree, and then can be use alone.
ExpressionTreeForge.M_convexity_detection.Convexity_tree — Type
Convexity_treeA tree where each node is a convexity status. Must be paired with an expression tree.
ExpressionTreeForge.M_convexity_detection.concave_type — Method
concave = concave_type()Return the value concave from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.constant_type — Method
constant = constant_type()Return the value constant from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.convex_type — Method
convex = convex_type()Return the value convex from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.create_convex_tree — Method
convex_tree = create_convex_tree(tree::Type_node)Return bounds' tree with the same shaped than tree, where each node has an undefined convexity status.
ExpressionTreeForge.M_convexity_detection.get_convexity_status — Method
convexity_status = get_convexity_status(convexity_tree::M_convexity_detection.Convexity_tree)
convexity_status = get_convexity_status(complete_tree::M_implementation_complete_expr_tree.Complete_expr_tree)Return the convexity status of either a convexity_tree or a complete_tree. The status can be:
constantlinear- strictly
convex - strictly
concave unknown
ExpressionTreeForge.M_convexity_detection.linear_type — Method
linear = linear_type()Return the value linear from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.set_convexity! — Method
set_convexity!(tree, convexity_tree, bound_tree)
set_convexity!(complete_tree)Deduce from elementary rules the convexity status of tree nodes or complete_tree nodes. complete_tree stores a bounds tree and can run the convexity detection standalone whereas tree requires the bound_tree (see create_bounds_tree) and convexity_tree (see create_convex_tree).
ExpressionTreeForge.M_convexity_detection.unknown_type — Method
unknown = unknown_type()Return the value unknown from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_algo_expr_tree.N_to_Ni — Method
dic = N_to_Ni(elemental_var::Vector{Int}; initial_index=0)Return a dictionnary informing the index changes of an element expression tree. If element_var = [4,5] then dic == Dict([4=>initial_index+1, 5=>initial_index+2]).
ExpressionTreeForge.M_algo_expr_tree.cast_type_of_constant — Method
cast_type_of_constant(expr_tree, type::DataType)Cast to type the constants of expr_tree.
ExpressionTreeForge.M_algo_expr_tree.extract_element_functions — Method
separated_terms = extract_element_functions(expr_tree)Divide the expression tree as a terms of a sum if possible. It returns a vector where each component is a subexpression tree of expr_tree.
Example:
julia> extract_element_functions(:(x[1] + x[2] + x[3]*x[4] ) )
3-element Vector{Expr}:
:(x[1])
:(x[2])
:(x[3] * x[4])ExpressionTreeForge.M_algo_expr_tree.get_Ui — Method
Ui = get_Ui(indices::Vector{Int}, n::Int)Create a SparseMatrix Ui from indices computed by get_elemental_variables. Every index i (of indices) form a line of Ui corresponding to i-th Euclidian vector.
ExpressionTreeForge.M_algo_expr_tree.get_elemental_variables — Method
indices = get_elemental_variables(expr_tree)Return the indices of the variable appearing in expr_tree. This function finds the elemental variables from the expression tree of an element function.
Example:
julia> get_elemental_variables(:(x[1] + x[3]) )
[1, 3]
julia> get_elemental_variables(:(x[1]^2 + x[6] + x[2]) )
[1, 6, 2]ExpressionTreeForge.M_algo_expr_tree.get_type_tree — Method
type = get_type_tree(expr_tree)Return the type of expr_tree. It can either be: constant, linear, quadratic, cubic or more.
Example:
julia> get_type_tree(:(5+4)) == constant
true
julia> get_type_tree(:(x[1])) == linear
true
julia> get_type_tree(:(x[1]* x[2])) == quadratic
trueExpressionTreeForge.M_algo_expr_tree.non_linear_JuMP_model_evaluator — Method
evaluator = non_linear_JuMP_model_evaluator(expr_tree; variables::Vector{Int})Return the evaluator of a MOI.Nonlinear.Model defined by expr_tree, as long as it is supported. variables informs the indices of the variables appearing in expr_tree. If variables is not provided, it is determined automatically through sort!(get_elemental_variables(expr_tree)). Warning: variables must be sorted! Example:
expr_tree = :(x[1]^2 + x[3]^3)
variables = [1,3]
evaluator = non_linear_JuMP_model_evaluator(expr_tree; variables)Afterward, you may evaluate the function and the gradient from expr_tree with:
x = rand(2)
MOI.eval_objective(evaluator, x)
grad = similar(x)
MOI.eval_objective_gradient(evaluator, grad, x)Warning: The size of x depends on the number of variables of expr_tree and not from the highest variable's index.
ExpressionTreeForge.M_algo_expr_tree.normalize_indices! — Method
normalize_indices!(expr_tree, vector_indices; initial_index=0)Change the indices of the variables from expr_tree to follow the order given by vector_indices. It is paired with get_elemental_variables to define the elemental element function expression tree.
Example:
julia> normalize_indices!(:(x[4] + x[5]), [4,5]; initial_index::Int)
:(x[1+initial_index] + x[2+initial_index])ExpressionTreeForge.M_algo_expr_tree.sparse_jacobian_JuMP_model — Method
evaluator = sparse_jacobian_JuMP_model(expr_trees)Return the evaluator of a MOI.Nonlinear.Model defined by expr_tree, as long as it is supported. The evaluator considers the objective function as the sum of expr_trees and a constraint for each expr_tree contained in expr_trees. If the expression trees in expr_trees depend on a subset of variables, the Jacobian of the constraints will be sparse.
ExpressionTreeForge.M_trait_expr_node.Type_expr_node — Type
Type instantiated dynamically representeing that an argument is an expression node.
ExpressionTreeForge.M_trait_expr_node.Type_not_expr_node — Type
Type instantiated dynamically representeing that an argument is a not an expression node.
ExpressionTreeForge.M_trait_expr_node.cast_constant! — Method
bool = cast_constant!(node::Abstract_expr_node, type::Datatype)Rewrite the Numbers composing node as type.
ExpressionTreeForge.M_trait_expr_node.change_from_N_to_Ni! — Method
change_from_N_to_Ni!(node::Abstract_expr_node, dic_new_indices::Dict{Int, Int})Change the index of the variables following the index given by dic_new_indices.
ExpressionTreeForge.M_trait_expr_node.evaluate_node — Method
value = _evaluate_node(node::Abstract_expr_node, value_children::AbstractVector{T}) where T<:NumberEvaluate node depending on value_children.
ExpressionTreeForge.M_trait_expr_node.get_type_node — Method
type = get_type_node(node::Abstract_expr_node, children_types::AbstractVector{Type_expr_basic})Return the type of node given the type of its children children_types. The types avaible areconstant, linear, quadratic, cubic or more.
ExpressionTreeForge.M_trait_expr_node.get_var_index — Method
index = get_var_index(variable::Abstract_expr_node)Return the index of the variable.
ExpressionTreeForge.M_trait_expr_node.node_bound — Method
(lowerbound, upper_bound) = node_bound(node::Abstract_expr_node, children_bounds::AbstractVector{Tuple{T, T}}, type::DataType)Return the bounds of node given the children_bounds.
ExpressionTreeForge.M_trait_expr_node.node_convexity — Method
bool = _node_is_operator(node::Abstract_expr_node, children_convex_status::AbstractVector{M_implementation_convexity_type.Convexity_type})Return the convexity status of node given the children_convex_status.
ExpressionTreeForge.M_trait_expr_node.node_is_constant — Method
bool = node_is_constant(node::Abstract_expr_node)Check if node is a constant.
ExpressionTreeForge.M_trait_expr_node.node_is_cos — Method
bool = node_is_cos(node::Abstract_expr_node)Check if node is a cos operator.
ExpressionTreeForge.M_trait_expr_node.node_is_minus — Method
bool = node_is_minus(node::Abstract_expr_node)Check if node is a - operator.
ExpressionTreeForge.M_trait_expr_node.node_is_operator — Method
bool = node_is_operator(node::Abstract_expr_node)Check if node is an operator. It could be also a variable or a constant.
ExpressionTreeForge.M_trait_expr_node.node_is_plus — Method
bool = node_is_plus(node::Abstract_expr_node)Check if node is a + operator.
ExpressionTreeForge.M_trait_expr_node.node_is_power — Method
bool = node_is_power(node::Abstract_expr_node)Check if node is a ^ operator.
ExpressionTreeForge.M_trait_expr_node.node_is_sin — Method
bool = node_is_sin(node::Abstract_expr_node)Check if node is a sin operator.
ExpressionTreeForge.M_trait_expr_node.node_is_tan — Method
bool = node_is_tan(node::Abstract_expr_node)Check if node is a tan operator.
ExpressionTreeForge.M_trait_expr_node.node_is_times — Method
bool = _node_is_times(node::Abstract_expr_node)Check if node is a * operator.
ExpressionTreeForge.M_trait_expr_node.node_is_variable — Method
bool = _node_is_variable(node::Abstract_expr_node)Check if node is a variable. It could be also an operator or a constant.
ExpressionTreeForge.M_trait_expr_node.node_to_Expr — Method
bool = node_to_Expr(node::Abstract_expr_node)Return the information required to build later on a Julia Expr. An operator node returns the operator symbol (ex: + -> :+). A variable node returns a variable as a MathOptInterface variable. A constant node returns its value.
ExpressionTreeForge.M_trait_expr_node.node_to_Expr2 — Method
bool = node_to_Expr2(node::Abstract_expr_node)Return the information required to build later on a Julia Expr. An operator node returns the operator symbol (ex: + -> :+). A variable return a variable. A constant node returns its value.
ExpressionTreeForge.M_trait_expr_node.node_to_Expr_JuMP — Method
bool = _node_to_Expr_JuMP(node::Abstract_expr_node)Return the information required to build later on a Julia Expr. An operator node returns the operator symbol (ex: + -> :+). A variable parametrized with the index i returns a variable as a MathOptInterface.Variable(i). A constant node returns its value.
ExpressionTreeForge.M_interface_expr_node._cast_constant! — Method
bool = _cast_constant!(node::Abstract_expr_node, type::Datatype)Rewrite the Numbers composing node as type.
ExpressionTreeForge.M_interface_expr_node._change_from_N_to_Ni! — Method
_change_from_N_to_Ni!(node::Abstract_expr_node, dic_new_indices::Dict{Int, Int})Change the index of the variables following the index given by dic_new_indices. Must be implemented for leaf nodes.
ExpressionTreeForge.M_interface_expr_node._evaluate_node! — Method
_evaluate_node!(node::Abstract_expr_node, value_children::AbstractVector{T}, ref::MyRef{T}) where T<:NumberEvaluate node depending on value_children and store the result in ref.
ExpressionTreeForge.M_interface_expr_node._evaluate_node — Method
value = _evaluate_node(node::Abstract_expr_node, value_children::AbstractVector{T}) where T<:NumberEvaluate node depending on value_children.
ExpressionTreeForge.M_interface_expr_node._get_type_node — Method
type = _get_type_node(node::Abstract_expr_node, children_types::AbstractVector{Type_expr_basic})Return the type of node given the type of its children children_types. The types available are constant, linear, quadratic, cubic or more.
ExpressionTreeForge.M_interface_expr_node._get_var_index — Method
index = _get_var_index(variable::Abstract_expr_node)Return the index of the variable.
ExpressionTreeForge.M_interface_expr_node._node_bound — Method
(lowerbound, upper_bound) = _node_bound(node::Abstract_expr_node, children_bounds::AbstractVector{Tuple{T, T}}, type::DataType)Return the bounds of node given the children_bounds.
ExpressionTreeForge.M_interface_expr_node._node_convexity — Method
bool = _node_is_operator(node::Abstract_expr_node, children_convex_status::AbstractVector{M_implementation_convexity_type.Convexity_type})Return the convexity status of node given the children_convex_status.
ExpressionTreeForge.M_interface_expr_node._node_is_constant — Method
bool = _node_is_constant(node::Abstract_expr_node)Check if node is a constant.
ExpressionTreeForge.M_interface_expr_node._node_is_cos — Method
bool = _node_is_cos(node::Abstract_expr_node)Check if node is a cos operator.
ExpressionTreeForge.M_interface_expr_node._node_is_minus — Method
bool = _node_is_minus(node::Abstract_expr_node)Check if node is a - operator.
ExpressionTreeForge.M_interface_expr_node._node_is_operator — Method
bool = _node_is_operator(node::Abstract_expr_node)Check if node is an operator. It could be also a variable or a constant.
ExpressionTreeForge.M_interface_expr_node._node_is_plus — Method
bool = _node_is_plus(node::Abstract_expr_node)Check if node is a + operator.
ExpressionTreeForge.M_interface_expr_node._node_is_power — Method
bool = _node_is_power(node::Abstract_expr_node)Check if node is a ^ operator.
ExpressionTreeForge.M_interface_expr_node._node_is_sin — Method
bool = _node_is_sin(node::Abstract_expr_node)Check if node is a sin operator.
ExpressionTreeForge.M_interface_expr_node._node_is_tan — Method
bool = _node_is_tan(node::Abstract_expr_node)Check if node is a tan operator.
ExpressionTreeForge.M_interface_expr_node._node_is_times — Method
bool = _node_is_times(node::Abstract_expr_node)Check if node is a * operator.
ExpressionTreeForge.M_interface_expr_node._node_is_variable — Method
bool = _node_is_variable(node::Abstract_expr_node)Check if node is a variable. It could be also an operator or a constant.
ExpressionTreeForge.M_interface_expr_node._node_to_Expr — Method
[symbols] = _node_to_Expr(node::Abstract_expr_node)Return the information required to build later on a Julia Expr. An operator node returns the operator symbol (ex: + -> :+). A variable node returns a variable as a MathOptInterface variable. A constant node returns its value.
ExpressionTreeForge.M_interface_expr_node._node_to_Expr2 — Method
[symbols] = _node_to_Expr2(node::Abstract_expr_node)Return the information required to build later on a Julia Expr. An operator node returns the operator symbol (ex: + -> :+). A variable return a variable. A constant node returns its value.
ExpressionTreeForge.M_interface_expr_node._node_to_Expr_JuMP — Method
[symbols] = _node_to_Expr2(node::Abstract_expr_node)Return the information required to build later on a Julia Expr. An operator node returns the operator symbol (ex: + -> :+). A variable return a MathOptInterface.VariableIndex(). A constant node returns its value.
ExpressionTreeForge.M_abstract_expr_node.Abstract_expr_node — Type
Supertype of every node.
ExpressionTreeForge.M_abstract_expr_node.MyRef — Type
MyRef{Y <: Number}Sort of pointer. Contain the field:
valuewhich points to the desired structure.
ExpressionTreeForge.M_abstract_expr_node.create_new_vector_myRef — Function
vector_myref = create_new_vector_myRef(n::Int, type::DataType = Float64)Create a vector of n myRef{type} components.
ExpressionTreeForge.M_abstract_expr_node.create_node_expr — Method
create_node_expr(arg::UnionAll)Create a node from arg. See the different implementation in the src/node_expr_tree/impl_operators.jl.
ExpressionTreeForge.M_abstract_expr_node.create_undef_array_myRef — Function
my_ref_matrix = create_undef_array_myRef(n::Int, m::Int, type::DataType = Float64)Create a n×m array composed of myRef{type} components.
ExpressionTreeForge.M_abstract_expr_node.create_vector_of_vector_myRef — Function
vector_vector_myref = create_undef_array_myRef(l::Int, c::Int, type::DataType = Float64)Create a vector of size l, each component is a Vector{myRef{type}} of c components.
ExpressionTreeForge.M_abstract_expr_node.equalize_vec_vec_myRef! — Method
equalize_vec_vec_myRef!(a::Vector{Vector{MyRef{T}}}, b::Vector{Vector{MyRef{T}}}) where {T <: Number}Set the references of b to those of a.
ExpressionTreeForge.M_abstract_expr_node.get_myRef — Method
value = get_myRef(reference::MyRef{Y}) where {Y <: Number}Get the value of the reference.
ExpressionTreeForge.M_abstract_expr_node.new_ref — Method
myref = new_ref(value::Y) where {Y <: Number}
myref = new_ref(type::DataType)Create a new reference myRef from value or type.
ExpressionTreeForge.M_abstract_expr_node.set_myRef! — Method
set_myRef!(reference::MyRef{Y}, value::Y) where {Y <: Number}Set the reference to value.
ExpressionTreeForge.M_trait_tree.Type_not_trait_tree — Type
Type instantiated dynamically representeing that an argument is not a tree.
ExpressionTreeForge.M_trait_tree.Type_trait_tree — Type
Type instantiated dynamically representeing that an argument is a tree.
ExpressionTreeForge.M_interface_tree._get_children — Method
children = _get_children(tree, trait_tree)Get the children from the root node of tree, if trait_tree::Type_trait_tree.
ExpressionTreeForge.M_interface_tree._get_node — Method
node = _get_node(tree, trait_tree)Get the root node of tree, if trait_tree::Type_trait_tree.
ExpressionTreeForge.M_trait_tree.get_children — Method
children = get_children(tree)Get the children from the root node of tree.
ExpressionTreeForge.M_trait_tree.get_node — Method
node = get_node(tree)Get the root node of tree.
ExpressionTreeForge.M_trait_tree.is_type_trait_tree — Method
Type_trait_tree = is_type_trait_tree(a::AbstractTree)
Type_trait_tree = is_type_trait_tree(a::Expr)
Type_trait_tree = is_type_trait_tree(a::Number)
Type_not_trait_tree = is_type_trait_tree(a::Any)Return a Type_trait_tree only for AbstractTree, Expr or Number (a leaf of a tree). In the other cases it returns Type_not_trait_tree.
ExpressionTreeForge.algo_tree.printer_tree — Function
print_tree(tree::AbstractTree)Print a tree as long as it satisfies the interface M_interface_tree.
ExpressionTreeForge.M_interface_tree._get_children — Method
children = _get_children(tree)Get the children from the root node of tree.
ExpressionTreeForge.M_interface_tree._get_node — Method
node = _get_node(tree)Get the root node of tree.
ExpressionTreeForge.M_implementation_tree.Type_node — Type
Type_node{T} <: AbstractTreeBasic implementation of a tree. A Type_node has fields:
fieldgathering the informations about the current node;childrena vector of children, each of them being aType_node.
ExpressionTreeForge.M_implementation_tree.equal_tree — Method
bool = equal_tree(tree1::Type_node{T}, tree2::Type_node{T})Check recursively if every node from tree1 is the same for tree2.
ExpressionTreeForge.M_abstract_tree.AbstractTree — Type
Supertype of every tree.
ExpressionTreeForge.M_abstract_tree.create_tree — Method
tree = create_tree(field::T, children::Vector{Type_node{T}}) where {T}
tree = create_tree(field::T, children::Array{Any, 1}) where {T}
tree = create_tree(ex::Expr)Create a tree of type Type_node. field will be the root node with some children. create_tree can also translate an Expr to a Type_node.
ExpressionTreeForge.M_trait_type_expr.Type_not_type_expr — Type
Type instantiated dynamically that checks if an argument is not a Type_expr_basic
ExpressionTreeForge.M_trait_type_expr.Type_type_expr — Type
Type instantiated dynamically that checks if an argument is a Type_expr_basic
ExpressionTreeForge.M_trait_type_expr.is_constant — Method
bool = _is_constant(type)Return true if type is a constant type.
ExpressionTreeForge.M_trait_type_expr.is_cubic — Method
bool = _is_cubic(type)Return true if type is a cubic type.
ExpressionTreeForge.M_trait_type_expr.is_linear — Method
bool = _is_linear(type)Return true if type is a linear type.
ExpressionTreeForge.M_trait_type_expr.is_more — Method
bool = _is_more(type)Return true if type is more non linear than a cubic.
ExpressionTreeForge.M_trait_type_expr.is_quadratic — Method
bool = _is_quadratic(type)Return true if type is a quadratic type.
ExpressionTreeForge.M_trait_type_expr.is_trait_type_expr — Method
type = is_trait_type_expr(arg)Return type::Type_type_expr if arg is an Type_expr_basic otherwise is return type::Type_not_type_expr
ExpressionTreeForge.M_trait_type_expr.type_power — Method
result_type = type_power(index, type)Return the type resulting of type to power index.
ExpressionTreeForge.M_trait_type_expr.type_product — Method
result_type = type_product(type1, type2)Return the type resulting of a product between type1 and type2.
ExpressionTreeForge.M_interface_type_expr._is_constant — Method
bool = _is_constant(type)Return true if type is a constant type.
ExpressionTreeForge.M_interface_type_expr._is_cubic — Method
bool = _is_cubic(type)Return true if type is a cubic type.
ExpressionTreeForge.M_interface_type_expr._is_linear — Method
bool = _is_linear(type)Return true if type is a linear type.
ExpressionTreeForge.M_interface_type_expr._is_more — Method
bool = _is_more(type)Return true if type is more non linear than a cubic type.
ExpressionTreeForge.M_interface_type_expr._is_quadratic — Method
bool = _is_quadratic(type)Return true if type is a quadratic type.
ExpressionTreeForge.M_interface_type_expr._type_power — Method
result_type = _type_power(index, type)Return the type resulting of type to power index.
ExpressionTreeForge.M_interface_type_expr._type_product — Method
result_type = _type_product(type1, type2)Return the type resulting of a product between type1 and type2.
ExpressionTreeForge.M_implementation_type_expr.return_constant — Method
constant = return_constant()Return constantype::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_cubic — Method
cubic = return_cubic()Return cubic::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_linear — Method
linear = return_linear()Return linear::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_more — Method
more = return_more()Return more::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_quadratic — Method
quadratic = return_quadratic()Return quadratic::Type_expr_basic.
ExpressionTreeForge.M_interface_type_expr._is_constant — Method
bool = _is_constant(type::Type_expr_basic)Check if type equals constant.
ExpressionTreeForge.M_interface_type_expr._is_cubic — Method
bool = _is_cubic(type::Type_expr_basic)Check if type equals cubic.
ExpressionTreeForge.M_interface_type_expr._is_linear — Method
bool = _is_linear(type::Type_expr_basic)Check if type equals linear.
ExpressionTreeForge.M_interface_type_expr._is_more — Method
bool = _is_more(type::Type_expr_basic)Check if type equals more.
ExpressionTreeForge.M_interface_type_expr._is_quadratic — Method
bool = _is_quadratic(type::Type_expr_basic)Check if type equals quadratic.
ExpressionTreeForge.M_interface_type_expr._type_power — Method
result_type = _type_power(index_power::Number, b::Type_expr_basic)Return result_type::Type_expr_basic, resulting of b^(index_power).
ExpressionTreeForge.M_interface_type_expr._type_product — Method
result_type = _type_product(a::Type_expr_basic, b::Type_expr_basic)Return result_type::Type_expr_basic, the type resulting of the product a*b.
ExpressionTreeForge.M_implementation_convexity_type.Convexity_type — Type
Convexity_typeType representing wether an expression is not_treated, constant, linear, convex, concave or unknown.
ExpressionTreeForge.M_implementation_convexity_type.Convexity_wrapper — Type
Convexity_wrapperWrapper around Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.concave_type — Method
concave = concave_type()Return concave::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.concave_wrapper — Method
concave_wrapper = concave_wrapper()Return a Convexity_wrapper wich values concave.
ExpressionTreeForge.M_implementation_convexity_type.constant_type — Method
constant = constant_type()Return constant::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.constant_wrapper — Method
constant_wrapper = constant_wrapper()Return a Convexity_wrapper wich values constant.
ExpressionTreeForge.M_implementation_convexity_type.convex_type — Method
convex = convex_type()Return convex::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.convex_wrapper — Method
convex_wrapper = convex_wrapper()Return a Convexity_wrapper wich values convex.
ExpressionTreeForge.M_implementation_convexity_type.get_convexity_wrapper — Method
convexity_status = get_convexity_wrapper(convexity::Convexity_wrapper)Return the convexity status of convexity.
ExpressionTreeForge.M_implementation_convexity_type.init_conv_status — Method
untreated_wrapper = init_conv_status()Return a Convexity_wrapper wich values not_treated.
ExpressionTreeForge.M_implementation_convexity_type.is_concave — Method
bool = is_concave(status::Convexity_type)
bool = is_concave(convexity::Convexity_wrapper)Check if status or convexity.status equals concave.
ExpressionTreeForge.M_implementation_convexity_type.is_constant — Method
bool = is_constant(status::Convexity_type)
bool = is_constant(convexity::Convexity_wrapper)Check if status or convexity.status equals constant.
ExpressionTreeForge.M_implementation_convexity_type.is_convex — Method
bool = is_convex(status::Convexity_type)
bool = is_convex(convexity::Convexity_wrapper)Check if status or convexity.status equals convex.
ExpressionTreeForge.M_implementation_convexity_type.is_linear — Method
bool = is_linear(status::Convexity_type)
bool = is_linear(convexity::Convexity_wrapper)Check if status or convexity.status equals linear.
ExpressionTreeForge.M_implementation_convexity_type.is_not_treated — Method
bool = is_not_treated(status::Convexity_type)
bool = is_not_treated(convexity::Convexity_wrapper)Check if status or convexity.status equals not_treated.
ExpressionTreeForge.M_implementation_convexity_type.is_treated — Method
bool = is_treated(status::Convexity_type)
bool = is_treated(convexity::Convexity_wrapper)Check if status or convexity.status equals not_treated.
ExpressionTreeForge.M_implementation_convexity_type.is_unknown — Method
bool = is_unknown(status::Convexity_type)
bool = is_unknown(convexity::Convexity_wrapper)Check if status or convexity.status equals unknown.
ExpressionTreeForge.M_implementation_convexity_type.linear_type — Method
linear = linear_type()Return linear::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.linear_wrapper — Method
linear_wrapper = linear_wrapper()Return a Convexity_wrapper wich values linear.
ExpressionTreeForge.M_implementation_convexity_type.not_treated_type — Method
not_treated = not_treated_type()Return not_treated::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.set_convexity_wrapper! — Method
set_convexity_wrapper!(convexity::Convexity_wrapper, t::Convexity_type)Set the convexity status of convexity to type.
ExpressionTreeForge.M_implementation_convexity_type.unknown_type — Method
unknown = unknown_type()Return unknown::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.unknown_wrapper — Method
unknown_wrapper = unknown_wrapper()Return a Convexity_wrapper wich values unknown.