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 — TypeComplete_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 — TypeType_calculus_treeRepresent the different types that a expression can be :
constantlinearquadraticcubicmorewhich means non-linear, non-quadratic and non-cubic.
ExpressionTreeForge.Type_expr_tree — TypeType_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 — TypeType_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 — Methodcast_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 — Methodcomplete_tree = complete_tree(expression_tree::Type_expr_tree)Create a complete_tree::Complete_expr_tree from expression_tree.
ExpressionTreeForge.concave_type — Methodconcave = concave_type()Return the value concave from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.constant_type — Methodconstant = constant_type()Return the value constant from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.convex_type — Methodconvex = convex_type()Return the value convex from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.create_bounds_tree — Methodbound_tree = create_bounds_tree(tree)Return a convexity tree shaped as tree, where each node has an undefined bounds.
ExpressionTreeForge.create_convex_tree — Methodconvex_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 — Methodevaluate_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 — Methodevaluate_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 — Methodseparated_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 — MethodUi = 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 — Methodconvexity_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 — Methodindices = 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 — Methodexpr = 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 — Methodeval_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 — Methodtype = 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 — Methodgradient = 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 — Methodgradient = 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 — Methodhess = 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 — Methodbool = is_concave(status::Convexity_type)
bool = is_concave(convexity::Convexity_wrapper)Check if convexity or status is equal to concave.
ExpressionTreeForge.is_constant — Methodbool = is_constant(status::Convexity_type)
bool = is_constant(convexity::Convexity_wrapper)Check if convexity or status is equal to constant.
ExpressionTreeForge.is_constant — Methodbool = is_constant(type::Type_calculus_tree)Check if type values constant from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_convex — Methodbool = is_convex(status::Convexity_type)
bool = is_convex(convexity::Convexity_wrapper)Check if convexity or status is equal to convex.
ExpressionTreeForge.is_cubic — Methodbool = is_cubic(type::Type_calculus_tree)Check if type values cubic from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_linear — Methodbool = is_linear(status::Convexity_type)
bool = is_linear(convexity::Convexity_wrapper)Check if convexity or status is equal to linear.
ExpressionTreeForge.is_linear — Methodbool = is_linear(type::Type_calculus_tree)Check if type values linear from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_more — Methodbool = is_more(type::Type_calculus_tree)Check if type values more from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_not_treated — Methodbool = 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 — Methodbool = is_quadratic(type::Type_calculus_tree)Check if type values quadratic from the enumerative type Type_calculus_tree.
ExpressionTreeForge.is_treated — Methodbool = 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 — Methodbool = is_unknown(status::Convexity_type)
bool = is_unknown(convexity::Convexity_wrapper)Check if convexity or status is equal to unknown.
ExpressionTreeForge.linear_type — Methodlinear = linear_type()Return the value linear from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.non_linear_JuMP_model_evaluator — Methodevaluator = 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! — Methodnormalize_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 — Methodprint_tree(tree::AbstractTree)Print a tree as long as it satisfies the interface M_interface_tree.
ExpressionTreeForge.set_bounds! — Methodset_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! — Methodset_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 — Methodevaluator = 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 — Methodsummed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})Sum every trees.
ExpressionTreeForge.transform_to_Expr — Methodexpr = 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 — Methodexpr = 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 — Methodexpr = 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 — Methodexpr_tree = transform_to_expr_tree(expr::Expr)Transform expr into an expr_tree::Type_expr_tree.
ExpressionTreeForge.unknown_type — Methodunknown = unknown_type()Return the value unknown from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_abstract_expr_tree.AbstractExprTree — TypeSupertype of every expression tree.
ExpressionTreeForge.M_abstract_expr_tree.Bounds — TypeBounds{T <: Number}Structure representing the upper-bound and the lower-bound of a node.
ExpressionTreeForge.M_abstract_expr_tree.create_Expr — Methodexpr = 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 — Methodexpr = 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 — Methodexpr = 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 — Methodbound = create_empty_bounds(type::DataType)Create a Bounds structure of type.
ExpressionTreeForge.M_abstract_expr_tree.create_expr_tree — Methodexpr_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! — Methodset_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 — TypeType instantiated dynamically representeing that an argument is an expression tree.
ExpressionTreeForge.M_trait_expr_tree.Is_not_expr_tree — TypeType instantiated dynamically representeing that an argument is not an expression tree.
ExpressionTreeForge.M_trait_expr_tree.expr_tree_equal — Functionbool = 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 — Methodexpr_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 — Methodchildren = get_expr_children(tree::AbstractExprTree)Return the children from the root of tree.
ExpressionTreeForge.M_trait_expr_tree.get_expr_node — Methodnode = 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 — Methodminus_tree = inverse_expr_tree(tree::AbstractExprTree)Return minus_tree which apply a unary minus onto tree.
ExpressionTreeForge.M_trait_expr_tree.is_expr_tree — Methodverifier_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 — Methodsummed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})Sum every trees.
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr — Methodexpr = transform_to_Expr(expr_tree)Return expr::Expr from the expression tree expr_tree.
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr_JuMP — Methodexpr = 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 — Methodexpr_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 — Methodexpr_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 — Methodchildren = _get_expr_children(tree::AbstractExprTree)Return the children from the root of tree.
ExpressionTreeForge.M_interface_expr_tree._get_expr_node — Methodnode = _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 — Methodminus_tree = _inverse_expr_tree(tree::AbstractExprTree)Apply a unary minus on tree.
ExpressionTreeForge.M_interface_expr_tree._sum_expr_trees — Methodsummed_tree = _sum_expr_trees(trees::Vector{::AbstractExprTree})Sum every trees.
ExpressionTreeForge.M_interface_expr_tree._transform_to_expr_tree — Methodexpr_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 — TypeVariable_counterAssociate the index of the symbol variable to their integer index.
ExpressionTreeForge.M_implementation_expr_tree.Type_expr_tree — TypeType_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 — TypeComplete_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 — TypeComplete_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 — Methodgradient_forward(expr_tree, x)Evaluate the gradient of the function represented by `expr_tree at the point x.
ExpressionTreeForge.M_evaluation_expr_tree.hessian — Methodhess = 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 — TypeBound_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 — Functionbound_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! — Methodset_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 — TypeConvexity_treeA tree where each node is a convexity status. Must be paired with an expression tree.
ExpressionTreeForge.M_convexity_detection.concave_type — Methodconcave = concave_type()Return the value concave from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.constant_type — Methodconstant = constant_type()Return the value constant from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.convex_type — Methodconvex = convex_type()Return the value convex from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.create_convex_tree — Methodconvex_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 — Methodconvexity_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 — Methodlinear = linear_type()Return the value linear from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_convexity_detection.set_convexity! — Methodset_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 — Methodunknown = unknown_type()Return the value unknown from the enumerative type M_implementation_convexity_type.Convexity_type.
ExpressionTreeForge.M_algo_expr_tree.N_to_Ni — Methoddic = 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 — Methodcast_type_of_constant(expr_tree, type::DataType)Cast to type the constants of expr_tree.
ExpressionTreeForge.M_algo_expr_tree.extract_element_functions — Methodseparated_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 — MethodUi = 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 — Methodindices = 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 — Methodtype = 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 — Methodevaluator = 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! — Methodnormalize_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 — Methodevaluator = 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 — TypeType instantiated dynamically representeing that an argument is an expression node.
ExpressionTreeForge.M_trait_expr_node.Type_not_expr_node — TypeType instantiated dynamically representeing that an argument is a not an expression node.
ExpressionTreeForge.M_trait_expr_node.cast_constant! — Methodbool = 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! — Methodchange_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 — Methodvalue = _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 — Methodtype = 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 — Methodindex = 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 — Methodbool = _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 — Methodbool = node_is_constant(node::Abstract_expr_node)Check if node is a constant.
ExpressionTreeForge.M_trait_expr_node.node_is_cos — Methodbool = node_is_cos(node::Abstract_expr_node)Check if node is a cos operator.
ExpressionTreeForge.M_trait_expr_node.node_is_minus — Methodbool = node_is_minus(node::Abstract_expr_node)Check if node is a - operator.
ExpressionTreeForge.M_trait_expr_node.node_is_operator — Methodbool = 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 — Methodbool = node_is_plus(node::Abstract_expr_node)Check if node is a + operator.
ExpressionTreeForge.M_trait_expr_node.node_is_power — Methodbool = node_is_power(node::Abstract_expr_node)Check if node is a ^ operator.
ExpressionTreeForge.M_trait_expr_node.node_is_sin — Methodbool = node_is_sin(node::Abstract_expr_node)Check if node is a sin operator.
ExpressionTreeForge.M_trait_expr_node.node_is_tan — Methodbool = node_is_tan(node::Abstract_expr_node)Check if node is a tan operator.
ExpressionTreeForge.M_trait_expr_node.node_is_times — Methodbool = _node_is_times(node::Abstract_expr_node)Check if node is a * operator.
ExpressionTreeForge.M_trait_expr_node.node_is_variable — Methodbool = _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 — Methodbool = 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 — Methodbool = 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 — Methodbool = _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! — Methodbool = _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 — Methodvalue = _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 — Methodtype = _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 — Methodindex = _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 — Methodbool = _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 — Methodbool = _node_is_constant(node::Abstract_expr_node)Check if node is a constant.
ExpressionTreeForge.M_interface_expr_node._node_is_cos — Methodbool = _node_is_cos(node::Abstract_expr_node)Check if node is a cos operator.
ExpressionTreeForge.M_interface_expr_node._node_is_minus — Methodbool = _node_is_minus(node::Abstract_expr_node)Check if node is a - operator.
ExpressionTreeForge.M_interface_expr_node._node_is_operator — Methodbool = _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 — Methodbool = _node_is_plus(node::Abstract_expr_node)Check if node is a + operator.
ExpressionTreeForge.M_interface_expr_node._node_is_power — Methodbool = _node_is_power(node::Abstract_expr_node)Check if node is a ^ operator.
ExpressionTreeForge.M_interface_expr_node._node_is_sin — Methodbool = _node_is_sin(node::Abstract_expr_node)Check if node is a sin operator.
ExpressionTreeForge.M_interface_expr_node._node_is_tan — Methodbool = _node_is_tan(node::Abstract_expr_node)Check if node is a tan operator.
ExpressionTreeForge.M_interface_expr_node._node_is_times — Methodbool = _node_is_times(node::Abstract_expr_node)Check if node is a * operator.
ExpressionTreeForge.M_interface_expr_node._node_is_variable — Methodbool = _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 — TypeSupertype of every node.
ExpressionTreeForge.M_abstract_expr_node.MyRef — TypeMyRef{Y <: Number}Sort of pointer. Contain the field:
valuewhich points to the desired structure.
ExpressionTreeForge.M_abstract_expr_node.create_new_vector_myRef — Functionvector_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 — Methodcreate_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 — Functionmy_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 — Functionvector_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! — Methodequalize_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 — Methodvalue = get_myRef(reference::MyRef{Y}) where {Y <: Number}Get the value of the reference.
ExpressionTreeForge.M_abstract_expr_node.new_ref — Methodmyref = 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! — Methodset_myRef!(reference::MyRef{Y}, value::Y) where {Y <: Number}Set the reference to value.
ExpressionTreeForge.M_trait_tree.Type_not_trait_tree — TypeType instantiated dynamically representeing that an argument is not a tree.
ExpressionTreeForge.M_trait_tree.Type_trait_tree — TypeType instantiated dynamically representeing that an argument is a tree.
ExpressionTreeForge.M_interface_tree._get_children — Methodchildren = _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 — Methodnode = _get_node(tree, trait_tree)Get the root node of tree, if trait_tree::Type_trait_tree.
ExpressionTreeForge.M_trait_tree.get_children — Methodchildren = get_children(tree)Get the children from the root node of tree.
ExpressionTreeForge.M_trait_tree.get_node — Methodnode = get_node(tree)Get the root node of tree.
ExpressionTreeForge.M_trait_tree.is_type_trait_tree — MethodType_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.
Base.show — Methodshow(tree::AbstractTree; deepth)
show(io::IO, tree::AbstractTree; deepth)Print tree in the Julia console with a suitable form.
ExpressionTreeForge.algo_tree.printer_tree — Functionprint_tree(tree::AbstractTree)Print a tree as long as it satisfies the interface M_interface_tree.
ExpressionTreeForge.M_interface_tree._get_children — Methodchildren = _get_children(tree)Get the children from the root node of tree.
ExpressionTreeForge.M_interface_tree._get_node — Methodnode = _get_node(tree)Get the root node of tree.
ExpressionTreeForge.M_implementation_tree.Type_node — TypeType_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 — Methodbool = 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 — TypeSupertype of every tree.
ExpressionTreeForge.M_abstract_tree.create_tree — Methodtree = 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 — TypeType instantiated dynamically that checks if an argument is not a Type_expr_basic
ExpressionTreeForge.M_trait_type_expr.Type_type_expr — TypeType instantiated dynamically that checks if an argument is a Type_expr_basic
ExpressionTreeForge.M_trait_type_expr.is_constant — Methodbool = _is_constant(type)Return true if type is a constant type.
ExpressionTreeForge.M_trait_type_expr.is_cubic — Methodbool = _is_cubic(type)Return true if type is a cubic type.
ExpressionTreeForge.M_trait_type_expr.is_linear — Methodbool = _is_linear(type)Return true if type is a linear type.
ExpressionTreeForge.M_trait_type_expr.is_more — Methodbool = _is_more(type)Return true if type is more non linear than a cubic.
ExpressionTreeForge.M_trait_type_expr.is_quadratic — Methodbool = _is_quadratic(type)Return true if type is a quadratic type.
ExpressionTreeForge.M_trait_type_expr.is_trait_type_expr — Methodtype = 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 — Methodresult_type = type_power(index, type)Return the type resulting of type to power index.
ExpressionTreeForge.M_trait_type_expr.type_product — Methodresult_type = type_product(type1, type2)Return the type resulting of a product between type1 and type2.
ExpressionTreeForge.M_interface_type_expr._is_constant — Methodbool = _is_constant(type)Return true if type is a constant type.
ExpressionTreeForge.M_interface_type_expr._is_cubic — Methodbool = _is_cubic(type)Return true if type is a cubic type.
ExpressionTreeForge.M_interface_type_expr._is_linear — Methodbool = _is_linear(type)Return true if type is a linear type.
ExpressionTreeForge.M_interface_type_expr._is_more — Methodbool = _is_more(type)Return true if type is more non linear than a cubic type.
ExpressionTreeForge.M_interface_type_expr._is_quadratic — Methodbool = _is_quadratic(type)Return true if type is a quadratic type.
ExpressionTreeForge.M_interface_type_expr._type_power — Methodresult_type = _type_power(index, type)Return the type resulting of type to power index.
ExpressionTreeForge.M_interface_type_expr._type_product — Methodresult_type = _type_product(type1, type2)Return the type resulting of a product between type1 and type2.
ExpressionTreeForge.M_implementation_type_expr.return_constant — Methodconstant = return_constant()Return constantype::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_cubic — Methodcubic = return_cubic()Return cubic::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_linear — Methodlinear = return_linear()Return linear::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_more — Methodmore = return_more()Return more::Type_expr_basic.
ExpressionTreeForge.M_implementation_type_expr.return_quadratic — Methodquadratic = return_quadratic()Return quadratic::Type_expr_basic.
ExpressionTreeForge.M_interface_type_expr._is_constant — Methodbool = _is_constant(type::Type_expr_basic)Check if type equals constant.
ExpressionTreeForge.M_interface_type_expr._is_cubic — Methodbool = _is_cubic(type::Type_expr_basic)Check if type equals cubic.
ExpressionTreeForge.M_interface_type_expr._is_linear — Methodbool = _is_linear(type::Type_expr_basic)Check if type equals linear.
ExpressionTreeForge.M_interface_type_expr._is_more — Methodbool = _is_more(type::Type_expr_basic)Check if type equals more.
ExpressionTreeForge.M_interface_type_expr._is_quadratic — Methodbool = _is_quadratic(type::Type_expr_basic)Check if type equals quadratic.
ExpressionTreeForge.M_interface_type_expr._type_power — Methodresult_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 — Methodresult_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 — TypeConvexity_typeType representing wether an expression is not_treated, constant, linear, convex, concave or unknown.
ExpressionTreeForge.M_implementation_convexity_type.Convexity_wrapper — TypeConvexity_wrapperWrapper around Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.concave_type — Methodconcave = concave_type()Return concave::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.concave_wrapper — Methodconcave_wrapper = concave_wrapper()Return a Convexity_wrapper wich values concave.
ExpressionTreeForge.M_implementation_convexity_type.constant_type — Methodconstant = constant_type()Return constant::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.constant_wrapper — Methodconstant_wrapper = constant_wrapper()Return a Convexity_wrapper wich values constant.
ExpressionTreeForge.M_implementation_convexity_type.convex_type — Methodconvex = convex_type()Return convex::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.convex_wrapper — Methodconvex_wrapper = convex_wrapper()Return a Convexity_wrapper wich values convex.
ExpressionTreeForge.M_implementation_convexity_type.get_convexity_wrapper — Methodconvexity_status = get_convexity_wrapper(convexity::Convexity_wrapper)Return the convexity status of convexity.
ExpressionTreeForge.M_implementation_convexity_type.init_conv_status — Methoduntreated_wrapper = init_conv_status()Return a Convexity_wrapper wich values not_treated.
ExpressionTreeForge.M_implementation_convexity_type.is_concave — Methodbool = 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 — Methodbool = 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 — Methodbool = 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 — Methodbool = 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 — Methodbool = 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 — Methodbool = 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 — Methodbool = 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 — Methodlinear = linear_type()Return linear::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.linear_wrapper — Methodlinear_wrapper = linear_wrapper()Return a Convexity_wrapper wich values linear.
ExpressionTreeForge.M_implementation_convexity_type.not_treated_type — Methodnot_treated = not_treated_type()Return not_treated::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.set_convexity_wrapper! — Methodset_convexity_wrapper!(convexity::Convexity_wrapper, t::Convexity_type)Set the convexity status of convexity to type.
ExpressionTreeForge.M_implementation_convexity_type.unknown_type — Methodunknown = unknown_type()Return unknown::Convexity_type.
ExpressionTreeForge.M_implementation_convexity_type.unknown_wrapper — Methodunknown_wrapper = unknown_wrapper()Return a Convexity_wrapper wich values unknown.