Reference
Contents
Index
ExpressionTreeForge.Complete_expr_tree
ExpressionTreeForge.M_abstract_expr_node.Abstract_expr_node
ExpressionTreeForge.M_abstract_expr_node.MyRef
ExpressionTreeForge.M_abstract_expr_tree.AbstractExprTree
ExpressionTreeForge.M_abstract_expr_tree.Bounds
ExpressionTreeForge.M_abstract_tree.AbstractTree
ExpressionTreeForge.M_bound_propagations.Bound_tree
ExpressionTreeForge.M_convexity_detection.Convexity_tree
ExpressionTreeForge.M_implementation_complete_expr_tree.Complete_expr_tree
ExpressionTreeForge.M_implementation_complete_expr_tree.Complete_node
ExpressionTreeForge.M_implementation_convexity_type.Convexity_type
ExpressionTreeForge.M_implementation_convexity_type.Convexity_wrapper
ExpressionTreeForge.M_implementation_expr_tree.Type_expr_tree
ExpressionTreeForge.M_implementation_expr_tree_Expr.Variable_counter
ExpressionTreeForge.M_implementation_tree.Type_node
ExpressionTreeForge.M_trait_expr_node.Type_expr_node
ExpressionTreeForge.M_trait_expr_node.Type_not_expr_node
ExpressionTreeForge.M_trait_expr_tree.Is_expr_tree
ExpressionTreeForge.M_trait_expr_tree.Is_not_expr_tree
ExpressionTreeForge.M_trait_tree.Type_not_trait_tree
ExpressionTreeForge.M_trait_tree.Type_trait_tree
ExpressionTreeForge.M_trait_type_expr.Type_not_type_expr
ExpressionTreeForge.M_trait_type_expr.Type_type_expr
ExpressionTreeForge.Type_calculus_tree
ExpressionTreeForge.Type_expr_tree
ExpressionTreeForge.Type_node
Base.show
ExpressionTreeForge.M_abstract_expr_node.create_new_vector_myRef
ExpressionTreeForge.M_abstract_expr_node.create_node_expr
ExpressionTreeForge.M_abstract_expr_node.create_undef_array_myRef
ExpressionTreeForge.M_abstract_expr_node.create_vector_of_vector_myRef
ExpressionTreeForge.M_abstract_expr_node.equalize_vec_vec_myRef!
ExpressionTreeForge.M_abstract_expr_node.get_myRef
ExpressionTreeForge.M_abstract_expr_node.new_ref
ExpressionTreeForge.M_abstract_expr_node.set_myRef!
ExpressionTreeForge.M_abstract_expr_tree.create_Expr
ExpressionTreeForge.M_abstract_expr_tree.create_Expr2
ExpressionTreeForge.M_abstract_expr_tree.create_Expr_JuMP
ExpressionTreeForge.M_abstract_expr_tree.create_empty_bounds
ExpressionTreeForge.M_abstract_expr_tree.create_expr_tree
ExpressionTreeForge.M_abstract_expr_tree.get_bounds
ExpressionTreeForge.M_abstract_expr_tree.set_bound!
ExpressionTreeForge.M_abstract_tree.create_tree
ExpressionTreeForge.M_algo_expr_tree.N_to_Ni
ExpressionTreeForge.M_algo_expr_tree.cast_type_of_constant
ExpressionTreeForge.M_algo_expr_tree.extract_element_functions
ExpressionTreeForge.M_algo_expr_tree.get_Ui
ExpressionTreeForge.M_algo_expr_tree.get_elemental_variables
ExpressionTreeForge.M_algo_expr_tree.get_type_tree
ExpressionTreeForge.M_algo_expr_tree.non_linear_JuMP_model_evaluator
ExpressionTreeForge.M_algo_expr_tree.normalize_indices!
ExpressionTreeForge.M_algo_expr_tree.sparse_jacobian_JuMP_model
ExpressionTreeForge.M_bound_propagations.create_bounds_tree
ExpressionTreeForge.M_bound_propagations.get_bounds
ExpressionTreeForge.M_bound_propagations.set_bounds!
ExpressionTreeForge.M_convexity_detection.concave_type
ExpressionTreeForge.M_convexity_detection.constant_type
ExpressionTreeForge.M_convexity_detection.convex_type
ExpressionTreeForge.M_convexity_detection.create_convex_tree
ExpressionTreeForge.M_convexity_detection.get_convexity_status
ExpressionTreeForge.M_convexity_detection.linear_type
ExpressionTreeForge.M_convexity_detection.set_convexity!
ExpressionTreeForge.M_convexity_detection.unknown_type
ExpressionTreeForge.M_evaluation_expr_tree.gradient_forward
ExpressionTreeForge.M_evaluation_expr_tree.hessian
ExpressionTreeForge.M_implementation_convexity_type.concave_type
ExpressionTreeForge.M_implementation_convexity_type.concave_wrapper
ExpressionTreeForge.M_implementation_convexity_type.constant_type
ExpressionTreeForge.M_implementation_convexity_type.constant_wrapper
ExpressionTreeForge.M_implementation_convexity_type.convex_type
ExpressionTreeForge.M_implementation_convexity_type.convex_wrapper
ExpressionTreeForge.M_implementation_convexity_type.get_convexity_wrapper
ExpressionTreeForge.M_implementation_convexity_type.init_conv_status
ExpressionTreeForge.M_implementation_convexity_type.is_concave
ExpressionTreeForge.M_implementation_convexity_type.is_constant
ExpressionTreeForge.M_implementation_convexity_type.is_convex
ExpressionTreeForge.M_implementation_convexity_type.is_linear
ExpressionTreeForge.M_implementation_convexity_type.is_not_treated
ExpressionTreeForge.M_implementation_convexity_type.is_treated
ExpressionTreeForge.M_implementation_convexity_type.is_unknown
ExpressionTreeForge.M_implementation_convexity_type.linear_type
ExpressionTreeForge.M_implementation_convexity_type.linear_wrapper
ExpressionTreeForge.M_implementation_convexity_type.not_treated_type
ExpressionTreeForge.M_implementation_convexity_type.set_convexity_wrapper!
ExpressionTreeForge.M_implementation_convexity_type.unknown_type
ExpressionTreeForge.M_implementation_convexity_type.unknown_wrapper
ExpressionTreeForge.M_implementation_tree.equal_tree
ExpressionTreeForge.M_implementation_type_expr.return_constant
ExpressionTreeForge.M_implementation_type_expr.return_cubic
ExpressionTreeForge.M_implementation_type_expr.return_linear
ExpressionTreeForge.M_implementation_type_expr.return_more
ExpressionTreeForge.M_implementation_type_expr.return_quadratic
ExpressionTreeForge.M_interface_expr_node._cast_constant!
ExpressionTreeForge.M_interface_expr_node._change_from_N_to_Ni!
ExpressionTreeForge.M_interface_expr_node._evaluate_node
ExpressionTreeForge.M_interface_expr_node._evaluate_node!
ExpressionTreeForge.M_interface_expr_node._get_type_node
ExpressionTreeForge.M_interface_expr_node._get_var_index
ExpressionTreeForge.M_interface_expr_node._node_bound
ExpressionTreeForge.M_interface_expr_node._node_convexity
ExpressionTreeForge.M_interface_expr_node._node_is_constant
ExpressionTreeForge.M_interface_expr_node._node_is_cos
ExpressionTreeForge.M_interface_expr_node._node_is_minus
ExpressionTreeForge.M_interface_expr_node._node_is_operator
ExpressionTreeForge.M_interface_expr_node._node_is_plus
ExpressionTreeForge.M_interface_expr_node._node_is_power
ExpressionTreeForge.M_interface_expr_node._node_is_sin
ExpressionTreeForge.M_interface_expr_node._node_is_tan
ExpressionTreeForge.M_interface_expr_node._node_is_times
ExpressionTreeForge.M_interface_expr_node._node_is_variable
ExpressionTreeForge.M_interface_expr_node._node_to_Expr
ExpressionTreeForge.M_interface_expr_node._node_to_Expr2
ExpressionTreeForge.M_interface_expr_node._node_to_Expr_JuMP
ExpressionTreeForge.M_interface_expr_tree._expr_tree_to_create
ExpressionTreeForge.M_interface_expr_tree._get_expr_children
ExpressionTreeForge.M_interface_expr_tree._get_expr_node
ExpressionTreeForge.M_interface_expr_tree._get_real_node
ExpressionTreeForge.M_interface_expr_tree._inverse_expr_tree
ExpressionTreeForge.M_interface_expr_tree._sum_expr_trees
ExpressionTreeForge.M_interface_expr_tree._transform_to_expr_tree
ExpressionTreeForge.M_interface_tree._get_children
ExpressionTreeForge.M_interface_tree._get_children
ExpressionTreeForge.M_interface_tree._get_node
ExpressionTreeForge.M_interface_tree._get_node
ExpressionTreeForge.M_interface_type_expr._is_constant
ExpressionTreeForge.M_interface_type_expr._is_constant
ExpressionTreeForge.M_interface_type_expr._is_cubic
ExpressionTreeForge.M_interface_type_expr._is_cubic
ExpressionTreeForge.M_interface_type_expr._is_linear
ExpressionTreeForge.M_interface_type_expr._is_linear
ExpressionTreeForge.M_interface_type_expr._is_more
ExpressionTreeForge.M_interface_type_expr._is_more
ExpressionTreeForge.M_interface_type_expr._is_quadratic
ExpressionTreeForge.M_interface_type_expr._is_quadratic
ExpressionTreeForge.M_interface_type_expr._type_power
ExpressionTreeForge.M_interface_type_expr._type_power
ExpressionTreeForge.M_interface_type_expr._type_product
ExpressionTreeForge.M_interface_type_expr._type_product
ExpressionTreeForge.M_trait_expr_node.cast_constant!
ExpressionTreeForge.M_trait_expr_node.change_from_N_to_Ni!
ExpressionTreeForge.M_trait_expr_node.evaluate_node
ExpressionTreeForge.M_trait_expr_node.get_type_node
ExpressionTreeForge.M_trait_expr_node.get_var_index
ExpressionTreeForge.M_trait_expr_node.node_bound
ExpressionTreeForge.M_trait_expr_node.node_convexity
ExpressionTreeForge.M_trait_expr_node.node_is_constant
ExpressionTreeForge.M_trait_expr_node.node_is_cos
ExpressionTreeForge.M_trait_expr_node.node_is_minus
ExpressionTreeForge.M_trait_expr_node.node_is_operator
ExpressionTreeForge.M_trait_expr_node.node_is_plus
ExpressionTreeForge.M_trait_expr_node.node_is_power
ExpressionTreeForge.M_trait_expr_node.node_is_sin
ExpressionTreeForge.M_trait_expr_node.node_is_tan
ExpressionTreeForge.M_trait_expr_node.node_is_times
ExpressionTreeForge.M_trait_expr_node.node_is_variable
ExpressionTreeForge.M_trait_expr_node.node_to_Expr
ExpressionTreeForge.M_trait_expr_node.node_to_Expr2
ExpressionTreeForge.M_trait_expr_node.node_to_Expr_JuMP
ExpressionTreeForge.M_trait_expr_tree.expr_tree_equal
ExpressionTreeForge.M_trait_expr_tree.expr_tree_to_create
ExpressionTreeForge.M_trait_expr_tree.get_expr_children
ExpressionTreeForge.M_trait_expr_tree.get_expr_node
ExpressionTreeForge.M_trait_expr_tree.get_real_node
ExpressionTreeForge.M_trait_expr_tree.inverse_expr_tree
ExpressionTreeForge.M_trait_expr_tree.is_expr_tree
ExpressionTreeForge.M_trait_expr_tree.sum_expr_trees
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr_JuMP
ExpressionTreeForge.M_trait_expr_tree.transform_to_expr_tree
ExpressionTreeForge.M_trait_tree.get_children
ExpressionTreeForge.M_trait_tree.get_node
ExpressionTreeForge.M_trait_tree.is_type_trait_tree
ExpressionTreeForge.M_trait_type_expr.is_constant
ExpressionTreeForge.M_trait_type_expr.is_cubic
ExpressionTreeForge.M_trait_type_expr.is_linear
ExpressionTreeForge.M_trait_type_expr.is_more
ExpressionTreeForge.M_trait_type_expr.is_quadratic
ExpressionTreeForge.M_trait_type_expr.is_trait_type_expr
ExpressionTreeForge.M_trait_type_expr.type_power
ExpressionTreeForge.M_trait_type_expr.type_product
ExpressionTreeForge.algo_tree.printer_tree
ExpressionTreeForge.cast_type_of_constant
ExpressionTreeForge.complete_tree
ExpressionTreeForge.concave_type
ExpressionTreeForge.constant_type
ExpressionTreeForge.convex_type
ExpressionTreeForge.create_bounds_tree
ExpressionTreeForge.create_convex_tree
ExpressionTreeForge.evaluate_expr_tree
ExpressionTreeForge.evaluate_expr_tree_multiple_points
ExpressionTreeForge.extract_element_functions
ExpressionTreeForge.get_Ui
ExpressionTreeForge.get_bounds
ExpressionTreeForge.get_convexity_status
ExpressionTreeForge.get_elemental_variables
ExpressionTreeForge.get_expression_tree
ExpressionTreeForge.get_function_of_evaluation
ExpressionTreeForge.get_type_tree
ExpressionTreeForge.gradient_forward
ExpressionTreeForge.gradient_reverse
ExpressionTreeForge.hessian
ExpressionTreeForge.is_concave
ExpressionTreeForge.is_constant
ExpressionTreeForge.is_constant
ExpressionTreeForge.is_convex
ExpressionTreeForge.is_cubic
ExpressionTreeForge.is_linear
ExpressionTreeForge.is_linear
ExpressionTreeForge.is_more
ExpressionTreeForge.is_not_treated
ExpressionTreeForge.is_quadratic
ExpressionTreeForge.is_treated
ExpressionTreeForge.is_unknown
ExpressionTreeForge.linear_type
ExpressionTreeForge.non_linear_JuMP_model_evaluator
ExpressionTreeForge.normalize_indices!
ExpressionTreeForge.print_tree
ExpressionTreeForge.set_bounds!
ExpressionTreeForge.set_convexity!
ExpressionTreeForge.sparse_jacobian_JuMP_model
ExpressionTreeForge.sum_expr_trees
ExpressionTreeForge.transform_to_Expr
ExpressionTreeForge.transform_to_Expr_JuMP
ExpressionTreeForge.transform_to_Expr_julia
ExpressionTreeForge.transform_to_expr_tree
ExpressionTreeForge.unknown_type
ExpressionTreeForge.Complete_expr_tree
— TypeComplete_expr_tree{T} <: AbstractTree
Implementation 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_tree
Represent the different types that a expression can be :
constant
linear
quadratic
cubic
more
which means non-linear, non-quadratic and non-cubic.
ExpressionTreeForge.Type_expr_tree
— TypeType_expr_tree{T} <: AbstractTree
Basic 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_node
representing 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} <: AbstractTree
Basic implementation of a tree. A Type_node has fields:
field
gathering the informations about the current node;children
a 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)
+Reference · ExpressionTreeForge.jl Reference
Contents
Index
ExpressionTreeForge.Complete_expr_tree
ExpressionTreeForge.M_abstract_expr_node.Abstract_expr_node
ExpressionTreeForge.M_abstract_expr_node.MyRef
ExpressionTreeForge.M_abstract_expr_tree.AbstractExprTree
ExpressionTreeForge.M_abstract_expr_tree.Bounds
ExpressionTreeForge.M_abstract_tree.AbstractTree
ExpressionTreeForge.M_bound_propagations.Bound_tree
ExpressionTreeForge.M_convexity_detection.Convexity_tree
ExpressionTreeForge.M_implementation_complete_expr_tree.Complete_expr_tree
ExpressionTreeForge.M_implementation_complete_expr_tree.Complete_node
ExpressionTreeForge.M_implementation_convexity_type.Convexity_type
ExpressionTreeForge.M_implementation_convexity_type.Convexity_wrapper
ExpressionTreeForge.M_implementation_expr_tree.Type_expr_tree
ExpressionTreeForge.M_implementation_expr_tree_Expr.Variable_counter
ExpressionTreeForge.M_implementation_tree.Type_node
ExpressionTreeForge.M_trait_expr_node.Type_expr_node
ExpressionTreeForge.M_trait_expr_node.Type_not_expr_node
ExpressionTreeForge.M_trait_expr_tree.Is_expr_tree
ExpressionTreeForge.M_trait_expr_tree.Is_not_expr_tree
ExpressionTreeForge.M_trait_tree.Type_not_trait_tree
ExpressionTreeForge.M_trait_tree.Type_trait_tree
ExpressionTreeForge.M_trait_type_expr.Type_not_type_expr
ExpressionTreeForge.M_trait_type_expr.Type_type_expr
ExpressionTreeForge.Type_calculus_tree
ExpressionTreeForge.Type_expr_tree
ExpressionTreeForge.Type_node
Base.show
ExpressionTreeForge.M_abstract_expr_node.create_new_vector_myRef
ExpressionTreeForge.M_abstract_expr_node.create_node_expr
ExpressionTreeForge.M_abstract_expr_node.create_undef_array_myRef
ExpressionTreeForge.M_abstract_expr_node.create_vector_of_vector_myRef
ExpressionTreeForge.M_abstract_expr_node.equalize_vec_vec_myRef!
ExpressionTreeForge.M_abstract_expr_node.get_myRef
ExpressionTreeForge.M_abstract_expr_node.new_ref
ExpressionTreeForge.M_abstract_expr_node.set_myRef!
ExpressionTreeForge.M_abstract_expr_tree.create_Expr
ExpressionTreeForge.M_abstract_expr_tree.create_Expr2
ExpressionTreeForge.M_abstract_expr_tree.create_Expr_JuMP
ExpressionTreeForge.M_abstract_expr_tree.create_empty_bounds
ExpressionTreeForge.M_abstract_expr_tree.create_expr_tree
ExpressionTreeForge.M_abstract_expr_tree.get_bounds
ExpressionTreeForge.M_abstract_expr_tree.set_bound!
ExpressionTreeForge.M_abstract_tree.create_tree
ExpressionTreeForge.M_algo_expr_tree.N_to_Ni
ExpressionTreeForge.M_algo_expr_tree.cast_type_of_constant
ExpressionTreeForge.M_algo_expr_tree.extract_element_functions
ExpressionTreeForge.M_algo_expr_tree.get_Ui
ExpressionTreeForge.M_algo_expr_tree.get_elemental_variables
ExpressionTreeForge.M_algo_expr_tree.get_type_tree
ExpressionTreeForge.M_algo_expr_tree.non_linear_JuMP_model_evaluator
ExpressionTreeForge.M_algo_expr_tree.normalize_indices!
ExpressionTreeForge.M_algo_expr_tree.sparse_jacobian_JuMP_model
ExpressionTreeForge.M_bound_propagations.create_bounds_tree
ExpressionTreeForge.M_bound_propagations.get_bounds
ExpressionTreeForge.M_bound_propagations.set_bounds!
ExpressionTreeForge.M_convexity_detection.concave_type
ExpressionTreeForge.M_convexity_detection.constant_type
ExpressionTreeForge.M_convexity_detection.convex_type
ExpressionTreeForge.M_convexity_detection.create_convex_tree
ExpressionTreeForge.M_convexity_detection.get_convexity_status
ExpressionTreeForge.M_convexity_detection.linear_type
ExpressionTreeForge.M_convexity_detection.set_convexity!
ExpressionTreeForge.M_convexity_detection.unknown_type
ExpressionTreeForge.M_evaluation_expr_tree.gradient_forward
ExpressionTreeForge.M_evaluation_expr_tree.hessian
ExpressionTreeForge.M_implementation_convexity_type.concave_type
ExpressionTreeForge.M_implementation_convexity_type.concave_wrapper
ExpressionTreeForge.M_implementation_convexity_type.constant_type
ExpressionTreeForge.M_implementation_convexity_type.constant_wrapper
ExpressionTreeForge.M_implementation_convexity_type.convex_type
ExpressionTreeForge.M_implementation_convexity_type.convex_wrapper
ExpressionTreeForge.M_implementation_convexity_type.get_convexity_wrapper
ExpressionTreeForge.M_implementation_convexity_type.init_conv_status
ExpressionTreeForge.M_implementation_convexity_type.is_concave
ExpressionTreeForge.M_implementation_convexity_type.is_constant
ExpressionTreeForge.M_implementation_convexity_type.is_convex
ExpressionTreeForge.M_implementation_convexity_type.is_linear
ExpressionTreeForge.M_implementation_convexity_type.is_not_treated
ExpressionTreeForge.M_implementation_convexity_type.is_treated
ExpressionTreeForge.M_implementation_convexity_type.is_unknown
ExpressionTreeForge.M_implementation_convexity_type.linear_type
ExpressionTreeForge.M_implementation_convexity_type.linear_wrapper
ExpressionTreeForge.M_implementation_convexity_type.not_treated_type
ExpressionTreeForge.M_implementation_convexity_type.set_convexity_wrapper!
ExpressionTreeForge.M_implementation_convexity_type.unknown_type
ExpressionTreeForge.M_implementation_convexity_type.unknown_wrapper
ExpressionTreeForge.M_implementation_tree.equal_tree
ExpressionTreeForge.M_implementation_type_expr.return_constant
ExpressionTreeForge.M_implementation_type_expr.return_cubic
ExpressionTreeForge.M_implementation_type_expr.return_linear
ExpressionTreeForge.M_implementation_type_expr.return_more
ExpressionTreeForge.M_implementation_type_expr.return_quadratic
ExpressionTreeForge.M_interface_expr_node._cast_constant!
ExpressionTreeForge.M_interface_expr_node._change_from_N_to_Ni!
ExpressionTreeForge.M_interface_expr_node._evaluate_node
ExpressionTreeForge.M_interface_expr_node._evaluate_node!
ExpressionTreeForge.M_interface_expr_node._get_type_node
ExpressionTreeForge.M_interface_expr_node._get_var_index
ExpressionTreeForge.M_interface_expr_node._node_bound
ExpressionTreeForge.M_interface_expr_node._node_convexity
ExpressionTreeForge.M_interface_expr_node._node_is_constant
ExpressionTreeForge.M_interface_expr_node._node_is_cos
ExpressionTreeForge.M_interface_expr_node._node_is_minus
ExpressionTreeForge.M_interface_expr_node._node_is_operator
ExpressionTreeForge.M_interface_expr_node._node_is_plus
ExpressionTreeForge.M_interface_expr_node._node_is_power
ExpressionTreeForge.M_interface_expr_node._node_is_sin
ExpressionTreeForge.M_interface_expr_node._node_is_tan
ExpressionTreeForge.M_interface_expr_node._node_is_times
ExpressionTreeForge.M_interface_expr_node._node_is_variable
ExpressionTreeForge.M_interface_expr_node._node_to_Expr
ExpressionTreeForge.M_interface_expr_node._node_to_Expr2
ExpressionTreeForge.M_interface_expr_node._node_to_Expr_JuMP
ExpressionTreeForge.M_interface_expr_tree._expr_tree_to_create
ExpressionTreeForge.M_interface_expr_tree._get_expr_children
ExpressionTreeForge.M_interface_expr_tree._get_expr_node
ExpressionTreeForge.M_interface_expr_tree._get_real_node
ExpressionTreeForge.M_interface_expr_tree._inverse_expr_tree
ExpressionTreeForge.M_interface_expr_tree._sum_expr_trees
ExpressionTreeForge.M_interface_expr_tree._transform_to_expr_tree
ExpressionTreeForge.M_interface_tree._get_children
ExpressionTreeForge.M_interface_tree._get_children
ExpressionTreeForge.M_interface_tree._get_node
ExpressionTreeForge.M_interface_tree._get_node
ExpressionTreeForge.M_interface_type_expr._is_constant
ExpressionTreeForge.M_interface_type_expr._is_constant
ExpressionTreeForge.M_interface_type_expr._is_cubic
ExpressionTreeForge.M_interface_type_expr._is_cubic
ExpressionTreeForge.M_interface_type_expr._is_linear
ExpressionTreeForge.M_interface_type_expr._is_linear
ExpressionTreeForge.M_interface_type_expr._is_more
ExpressionTreeForge.M_interface_type_expr._is_more
ExpressionTreeForge.M_interface_type_expr._is_quadratic
ExpressionTreeForge.M_interface_type_expr._is_quadratic
ExpressionTreeForge.M_interface_type_expr._type_power
ExpressionTreeForge.M_interface_type_expr._type_power
ExpressionTreeForge.M_interface_type_expr._type_product
ExpressionTreeForge.M_interface_type_expr._type_product
ExpressionTreeForge.M_trait_expr_node.cast_constant!
ExpressionTreeForge.M_trait_expr_node.change_from_N_to_Ni!
ExpressionTreeForge.M_trait_expr_node.evaluate_node
ExpressionTreeForge.M_trait_expr_node.get_type_node
ExpressionTreeForge.M_trait_expr_node.get_var_index
ExpressionTreeForge.M_trait_expr_node.node_bound
ExpressionTreeForge.M_trait_expr_node.node_convexity
ExpressionTreeForge.M_trait_expr_node.node_is_constant
ExpressionTreeForge.M_trait_expr_node.node_is_cos
ExpressionTreeForge.M_trait_expr_node.node_is_minus
ExpressionTreeForge.M_trait_expr_node.node_is_operator
ExpressionTreeForge.M_trait_expr_node.node_is_plus
ExpressionTreeForge.M_trait_expr_node.node_is_power
ExpressionTreeForge.M_trait_expr_node.node_is_sin
ExpressionTreeForge.M_trait_expr_node.node_is_tan
ExpressionTreeForge.M_trait_expr_node.node_is_times
ExpressionTreeForge.M_trait_expr_node.node_is_variable
ExpressionTreeForge.M_trait_expr_node.node_to_Expr
ExpressionTreeForge.M_trait_expr_node.node_to_Expr2
ExpressionTreeForge.M_trait_expr_node.node_to_Expr_JuMP
ExpressionTreeForge.M_trait_expr_tree.expr_tree_equal
ExpressionTreeForge.M_trait_expr_tree.expr_tree_to_create
ExpressionTreeForge.M_trait_expr_tree.get_expr_children
ExpressionTreeForge.M_trait_expr_tree.get_expr_node
ExpressionTreeForge.M_trait_expr_tree.get_real_node
ExpressionTreeForge.M_trait_expr_tree.inverse_expr_tree
ExpressionTreeForge.M_trait_expr_tree.is_expr_tree
ExpressionTreeForge.M_trait_expr_tree.sum_expr_trees
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr
ExpressionTreeForge.M_trait_expr_tree.transform_to_Expr_JuMP
ExpressionTreeForge.M_trait_expr_tree.transform_to_expr_tree
ExpressionTreeForge.M_trait_tree.get_children
ExpressionTreeForge.M_trait_tree.get_node
ExpressionTreeForge.M_trait_tree.is_type_trait_tree
ExpressionTreeForge.M_trait_type_expr.is_constant
ExpressionTreeForge.M_trait_type_expr.is_cubic
ExpressionTreeForge.M_trait_type_expr.is_linear
ExpressionTreeForge.M_trait_type_expr.is_more
ExpressionTreeForge.M_trait_type_expr.is_quadratic
ExpressionTreeForge.M_trait_type_expr.is_trait_type_expr
ExpressionTreeForge.M_trait_type_expr.type_power
ExpressionTreeForge.M_trait_type_expr.type_product
ExpressionTreeForge.algo_tree.printer_tree
ExpressionTreeForge.cast_type_of_constant
ExpressionTreeForge.complete_tree
ExpressionTreeForge.concave_type
ExpressionTreeForge.constant_type
ExpressionTreeForge.convex_type
ExpressionTreeForge.create_bounds_tree
ExpressionTreeForge.create_convex_tree
ExpressionTreeForge.evaluate_expr_tree
ExpressionTreeForge.evaluate_expr_tree_multiple_points
ExpressionTreeForge.extract_element_functions
ExpressionTreeForge.get_Ui
ExpressionTreeForge.get_bounds
ExpressionTreeForge.get_convexity_status
ExpressionTreeForge.get_elemental_variables
ExpressionTreeForge.get_expression_tree
ExpressionTreeForge.get_function_of_evaluation
ExpressionTreeForge.get_type_tree
ExpressionTreeForge.gradient_forward
ExpressionTreeForge.gradient_reverse
ExpressionTreeForge.hessian
ExpressionTreeForge.is_concave
ExpressionTreeForge.is_constant
ExpressionTreeForge.is_constant
ExpressionTreeForge.is_convex
ExpressionTreeForge.is_cubic
ExpressionTreeForge.is_linear
ExpressionTreeForge.is_linear
ExpressionTreeForge.is_more
ExpressionTreeForge.is_not_treated
ExpressionTreeForge.is_quadratic
ExpressionTreeForge.is_treated
ExpressionTreeForge.is_unknown
ExpressionTreeForge.linear_type
ExpressionTreeForge.non_linear_JuMP_model_evaluator
ExpressionTreeForge.normalize_indices!
ExpressionTreeForge.print_tree
ExpressionTreeForge.set_bounds!
ExpressionTreeForge.set_convexity!
ExpressionTreeForge.sparse_jacobian_JuMP_model
ExpressionTreeForge.sum_expr_trees
ExpressionTreeForge.transform_to_Expr
ExpressionTreeForge.transform_to_Expr_JuMP
ExpressionTreeForge.transform_to_Expr_julia
ExpressionTreeForge.transform_to_expr_tree
ExpressionTreeForge.unknown_type
ExpressionTreeForge.Complete_expr_tree
— TypeComplete_expr_tree{T} <: AbstractTree
Implementation 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 a Complete_expr_tree{T}
.
sourceExpressionTreeForge.Type_calculus_tree
— TypeType_calculus_tree
Represent the different types that a expression can be :
constant
linear
quadratic
cubic
more
which means non-linear, non-quadratic and non-cubic.
sourceExpressionTreeForge.Type_expr_tree
— TypeType_expr_tree{T} <: AbstractTree
Basic 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_node
representing an operator, a constant or a variable;children::Vector{Type_expr_tree{T}}
a vector of children, each of them being a Type_expr_tree{T}
.
sourceExpressionTreeForge.Type_node
— TypeType_node{T} <: AbstractTree
Basic implementation of a tree. A Type_node has fields:
field
gathering the informations about the current node;children
a vector of children, each of them being a Type_node
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.complete_tree
— Methodcomplete_tree = complete_tree(expression_tree::Type_expr_tree)
Create a complete_tree::Complete_expr_tree
from expression_tree
.
sourceExpressionTreeForge.concave_type
— Methodconcave = concave_type()
Return the value concave
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.constant_type
— Methodconstant = constant_type()
Return the value constant
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.convex_type
— Methodconvex = convex_type()
Return the value convex
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.create_bounds_tree
— Methodbound_tree = create_bounds_tree(tree)
Return a convexity tree shaped as tree
, where each node has an undefined bounds.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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]))
+2.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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])
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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).
sourceExpressionTreeForge.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:
constant
linear
convex
concave
unknown
sourceExpressionTreeForge.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]) )
+ :(x[3] * x[4])
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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).
sourceExpressionTreeForge.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:
constant
linear
convex
concave
unknown
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.get_expression_tree
— Methodexpr = get_expression_tree(monlp::MathOptNLPModel)
+[1, 6, 2]
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
+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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
-true
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.is_concave
— Methodbool = is_concave(status::Convexity_type)
-bool = is_concave(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to concave
.
sourceExpressionTreeForge.is_constant
— Methodbool = is_constant(status::Convexity_type)
-bool = is_constant(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to constant
.
sourceExpressionTreeForge.is_constant
— Methodbool = is_constant(type::Type_calculus_tree)
Check if type
values constant
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.is_convex
— Methodbool = is_convex(status::Convexity_type)
-bool = is_convex(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to convex
.
sourceExpressionTreeForge.is_cubic
— Methodbool = is_cubic(type::Type_calculus_tree)
Check if type
values cubic
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.is_linear
— Methodbool = is_linear(status::Convexity_type)
-bool = is_linear(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to linear
.
sourceExpressionTreeForge.is_linear
— Methodbool = is_linear(type::Type_calculus_tree)
Check if type
values linear
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.is_more
— Methodbool = is_more(type::Type_calculus_tree)
Check if type
values more
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.is_quadratic
— Methodbool = is_quadratic(type::Type_calculus_tree)
Check if type
values quadratic
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.is_unknown
— Methodbool = is_unknown(status::Convexity_type)
-bool = is_unknown(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to unknown
.
sourceExpressionTreeForge.linear_type
— Methodlinear = linear_type()
Return the value linear
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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)
+true
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.is_concave
— Methodbool = is_concave(status::Convexity_type)
+bool = is_concave(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to concave
.
sourceExpressionTreeForge.is_constant
— Methodbool = is_constant(status::Convexity_type)
+bool = is_constant(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to constant
.
sourceExpressionTreeForge.is_constant
— Methodbool = is_constant(type::Type_calculus_tree)
Check if type
values constant
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.is_convex
— Methodbool = is_convex(status::Convexity_type)
+bool = is_convex(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to convex
.
sourceExpressionTreeForge.is_cubic
— Methodbool = is_cubic(type::Type_calculus_tree)
Check if type
values cubic
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.is_linear
— Methodbool = is_linear(status::Convexity_type)
+bool = is_linear(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to linear
.
sourceExpressionTreeForge.is_linear
— Methodbool = is_linear(type::Type_calculus_tree)
Check if type
values linear
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.is_more
— Methodbool = is_more(type::Type_calculus_tree)
Check if type
values more
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.is_quadratic
— Methodbool = is_quadratic(type::Type_calculus_tree)
Check if type
values quadratic
from the enumerative type Type_calculus_tree
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.is_unknown
— Methodbool = is_unknown(status::Convexity_type)
+bool = is_unknown(convexity::Convexity_wrapper)
Check if convexity
or status
is equal to unknown
.
sourceExpressionTreeForge.linear_type
— Methodlinear = linear_type()
Return the value linear
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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])
sourceExpressionTreeForge.print_tree
— Methodprint_tree(tree::AbstractTree)
Print a tree as long as it satisfies the interface M_interface_tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
).
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.sum_expr_trees
— Methodsummed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})
Sum every trees
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.transform_to_expr_tree
— Methodexpr_tree = transform_to_expr_tree(expr::Expr)
Transform expr
into an expr_tree::Type_expr_tree
.
sourceExpressionTreeForge.unknown_type
— Methodunknown = unknown_type()
Return the value unknown
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.M_abstract_expr_tree.AbstractExprTree
— TypeSupertype of every expression tree.
sourceExpressionTreeForge.M_abstract_expr_tree.Bounds
— TypeBounds{T <: Number}
Structure representing the upper-bound and the lower-bound of a node.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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)
.
sourceExpressionTreeForge.M_abstract_expr_tree.create_empty_bounds
— Methodbound = create_empty_bounds(type::DataType)
Create a Bounds
structure of type
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_tree.Is_expr_tree
— TypeType instantiated dynamically representeing that an argument is an expression tree.
sourceExpressionTreeForge.M_trait_expr_tree.Is_not_expr_tree
— TypeType instantiated dynamically representeing that an argument is not an expression tree.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_tree.get_expr_children
— Methodchildren = get_expr_children(tree::AbstractExprTree)
Return the children
from the root
of tree
.
sourceExpressionTreeForge.M_trait_expr_tree.get_expr_node
— Methodnode = get_expr_node(tree::AbstractExprTree)
Return the root node
of tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_tree.inverse_expr_tree
— Methodminus_tree = inverse_expr_tree(tree::AbstractExprTree)
Return minus_tree
which apply a unary minus onto tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_tree.sum_expr_trees
— Methodsummed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})
Sum every trees
.
sourceExpressionTreeForge.M_trait_expr_tree.transform_to_Expr
— Methodexpr = transform_to_Expr(expr_tree)
Return expr::Expr
from the expression tree expr_tree
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_tree._get_expr_children
— Methodchildren = _get_expr_children(tree::AbstractExprTree)
Return the children
from the root
of tree
.
sourceExpressionTreeForge.M_interface_expr_tree._get_expr_node
— Methodnode = _get_expr_node(tree::AbstractExprTree)
Return the root node
of tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_tree._inverse_expr_tree
— Methodminus_tree = _inverse_expr_tree(tree::AbstractExprTree)
Apply a unary minus on tree
.
sourceExpressionTreeForge.M_interface_expr_tree._sum_expr_trees
— Methodsummed_tree = _sum_expr_trees(trees::Vector{::AbstractExprTree})
Sum every trees
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_implementation_expr_tree_Expr.Variable_counter
— TypeVariable_counter
Associate the index of the symbol variable to their integer index.
sourceExpressionTreeForge.M_implementation_expr_tree.Type_expr_tree
— TypeType_expr_tree{T} <: AbstractTree
Basic 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_node
representing an operator, a constant or a variable;children::Vector{Type_expr_tree{T}}
a vector of children, each of them being a Type_expr_tree{T}
.
sourceExpressionTreeForge.M_implementation_complete_expr_tree.Complete_expr_tree
— TypeComplete_expr_tree{T} <: AbstractTree
Implementation 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 a Complete_expr_tree{T}
.
sourceExpressionTreeForge.M_implementation_complete_expr_tree.Complete_node
— TypeComplete_node{T <: Number}
Gather in a single structure:
op::M_abstract_expr_node.Abstract_expr_node
an 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_wrapper
the convexity status of this operator depending on its children.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_bound_propagations.Bound_tree
— TypeBound_tree
A tree where each node is a pair (bound_inf, bound_sup)
. Must be paired with an expression tree.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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).
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_convexity_detection.Convexity_tree
— TypeConvexity_tree
A tree where each node is a convexity status. Must be paired with an expression tree.
sourceExpressionTreeForge.M_convexity_detection.concave_type
— Methodconcave = concave_type()
Return the value concave
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.M_convexity_detection.constant_type
— Methodconstant = constant_type()
Return the value constant
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.M_convexity_detection.convex_type
— Methodconvex = convex_type()
Return the value convex
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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:
constant
linear
- strictly
convex
- strictly
concave
unknown
sourceExpressionTreeForge.M_convexity_detection.linear_type
— Methodlinear = linear_type()
Return the value linear
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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
).
sourceExpressionTreeForge.M_convexity_detection.unknown_type
— Methodunknown = unknown_type()
Return the value unknown
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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])
.
sourceExpressionTreeForge.M_algo_expr_tree.cast_type_of_constant
— Methodcast_type_of_constant(expr_tree, type::DataType)
Cast to type
the constants of expr_tree
.
sourceExpressionTreeForge.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] ) )
+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.
sourceExpressionTreeForge.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])
sourceExpressionTreeForge.print_tree
— Methodprint_tree(tree::AbstractTree)
Print a tree as long as it satisfies the interface M_interface_tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
).
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.sum_expr_trees
— Methodsummed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})
Sum every trees
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.transform_to_expr_tree
— Methodexpr_tree = transform_to_expr_tree(expr::Expr)
Transform expr
into an expr_tree::Type_expr_tree
.
sourceExpressionTreeForge.unknown_type
— Methodunknown = unknown_type()
Return the value unknown
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.M_abstract_expr_tree.AbstractExprTree
— TypeSupertype of every expression tree.
sourceExpressionTreeForge.M_abstract_expr_tree.Bounds
— TypeBounds{T <: Number}
Structure representing the upper-bound and the lower-bound of a node.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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)
.
sourceExpressionTreeForge.M_abstract_expr_tree.create_empty_bounds
— Methodbound = create_empty_bounds(type::DataType)
Create a Bounds
structure of type
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_tree.Is_expr_tree
— TypeType instantiated dynamically representeing that an argument is an expression tree.
sourceExpressionTreeForge.M_trait_expr_tree.Is_not_expr_tree
— TypeType instantiated dynamically representeing that an argument is not an expression tree.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_tree.get_expr_children
— Methodchildren = get_expr_children(tree::AbstractExprTree)
Return the children
from the root
of tree
.
sourceExpressionTreeForge.M_trait_expr_tree.get_expr_node
— Methodnode = get_expr_node(tree::AbstractExprTree)
Return the root node
of tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_tree.inverse_expr_tree
— Methodminus_tree = inverse_expr_tree(tree::AbstractExprTree)
Return minus_tree
which apply a unary minus onto tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_tree.sum_expr_trees
— Methodsummed_tree = sum_expr_trees(trees::Vector{::AbstractExprTree})
Sum every trees
.
sourceExpressionTreeForge.M_trait_expr_tree.transform_to_Expr
— Methodexpr = transform_to_Expr(expr_tree)
Return expr::Expr
from the expression tree expr_tree
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_tree._get_expr_children
— Methodchildren = _get_expr_children(tree::AbstractExprTree)
Return the children
from the root
of tree
.
sourceExpressionTreeForge.M_interface_expr_tree._get_expr_node
— Methodnode = _get_expr_node(tree::AbstractExprTree)
Return the root node
of tree
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_tree._inverse_expr_tree
— Methodminus_tree = _inverse_expr_tree(tree::AbstractExprTree)
Apply a unary minus on tree
.
sourceExpressionTreeForge.M_interface_expr_tree._sum_expr_trees
— Methodsummed_tree = _sum_expr_trees(trees::Vector{::AbstractExprTree})
Sum every trees
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_implementation_expr_tree_Expr.Variable_counter
— TypeVariable_counter
Associate the index of the symbol variable to their integer index.
sourceExpressionTreeForge.M_implementation_expr_tree.Type_expr_tree
— TypeType_expr_tree{T} <: AbstractTree
Basic 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_node
representing an operator, a constant or a variable;children::Vector{Type_expr_tree{T}}
a vector of children, each of them being a Type_expr_tree{T}
.
sourceExpressionTreeForge.M_implementation_complete_expr_tree.Complete_expr_tree
— TypeComplete_expr_tree{T} <: AbstractTree
Implementation 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 a Complete_expr_tree{T}
.
sourceExpressionTreeForge.M_implementation_complete_expr_tree.Complete_node
— TypeComplete_node{T <: Number}
Gather in a single structure:
op::M_abstract_expr_node.Abstract_expr_node
an 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_wrapper
the convexity status of this operator depending on its children.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_bound_propagations.Bound_tree
— TypeBound_tree
A tree where each node is a pair (bound_inf, bound_sup)
. Must be paired with an expression tree.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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).
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_convexity_detection.Convexity_tree
— TypeConvexity_tree
A tree where each node is a convexity status. Must be paired with an expression tree.
sourceExpressionTreeForge.M_convexity_detection.concave_type
— Methodconcave = concave_type()
Return the value concave
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.M_convexity_detection.constant_type
— Methodconstant = constant_type()
Return the value constant
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.M_convexity_detection.convex_type
— Methodconvex = convex_type()
Return the value convex
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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:
constant
linear
- strictly
convex
- strictly
concave
unknown
sourceExpressionTreeForge.M_convexity_detection.linear_type
— Methodlinear = linear_type()
Return the value linear
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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
).
sourceExpressionTreeForge.M_convexity_detection.unknown_type
— Methodunknown = unknown_type()
Return the value unknown
from the enumerative type M_implementation_convexity_type.Convexity_type
.
sourceExpressionTreeForge.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])
.
sourceExpressionTreeForge.M_algo_expr_tree.cast_type_of_constant
— Methodcast_type_of_constant(expr_tree, type::DataType)
Cast to type
the constants of expr_tree
.
sourceExpressionTreeForge.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])
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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]) )
+ :(x[3] * x[4])
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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]
sourceExpressionTreeForge.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
+[1, 6, 2]
sourceExpressionTreeForge.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
-true
sourceExpressionTreeForge.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)
+true
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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])
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_node.Type_expr_node
— TypeType instantiated dynamically representeing that an argument is an expression node.
sourceExpressionTreeForge.M_trait_expr_node.Type_not_expr_node
— TypeType instantiated dynamically representeing that an argument is a not an expression node.
sourceExpressionTreeForge.M_trait_expr_node.cast_constant!
— Methodbool = cast_constant!(node::Abstract_expr_node, type::Datatype)
Rewrite the Number
s composing node
as type
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_node.evaluate_node
— Methodvalue = _evaluate_node(node::Abstract_expr_node, value_children::AbstractVector{T}) where T<:Number
Evaluate node
depending on value_children
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_node.get_var_index
— Methodindex = get_var_index(variable::Abstract_expr_node)
Return the index
of the variable
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_node.node_is_constant
— Methodbool = node_is_constant(node::Abstract_expr_node)
Check if node
is a constant.
sourceExpressionTreeForge.M_trait_expr_node.node_is_cos
— Methodbool = node_is_cos(node::Abstract_expr_node)
Check if node
is a cos
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_minus
— Methodbool = node_is_minus(node::Abstract_expr_node)
Check if node
is a -
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_node.node_is_plus
— Methodbool = node_is_plus(node::Abstract_expr_node)
Check if node
is a +
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_power
— Methodbool = node_is_power(node::Abstract_expr_node)
Check if node
is a ^
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_sin
— Methodbool = node_is_sin(node::Abstract_expr_node)
Check if node
is a sin
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_tan
— Methodbool = node_is_tan(node::Abstract_expr_node)
Check if node
is a tan
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_times
— Methodbool = _node_is_times(node::Abstract_expr_node)
Check if node
is a *
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_node._cast_constant!
— Methodbool = _cast_constant!(node::Abstract_expr_node, type::Datatype)
Rewrite the Number
s composing node
as type
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_node._evaluate_node!
— Method_evaluate_node!(node::Abstract_expr_node, value_children::AbstractVector{T}, ref::MyRef{T}) where T<:Number
Evaluate node
depending on value_children
and store the result in ref
.
sourceExpressionTreeForge.M_interface_expr_node._evaluate_node
— Methodvalue = _evaluate_node(node::Abstract_expr_node, value_children::AbstractVector{T}) where T<:Number
Evaluate node
depending on value_children
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_interface_expr_node._get_var_index
— Methodindex = _get_var_index(variable::Abstract_expr_node)
Return the index
of the variable
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_interface_expr_node._node_is_constant
— Methodbool = _node_is_constant(node::Abstract_expr_node)
Check if node
is a constant.
sourceExpressionTreeForge.M_interface_expr_node._node_is_cos
— Methodbool = _node_is_cos(node::Abstract_expr_node)
Check if node
is a cos
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_minus
— Methodbool = _node_is_minus(node::Abstract_expr_node)
Check if node
is a -
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_node._node_is_plus
— Methodbool = _node_is_plus(node::Abstract_expr_node)
Check if node
is a +
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_power
— Methodbool = _node_is_power(node::Abstract_expr_node)
Check if node
is a ^
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_sin
— Methodbool = _node_is_sin(node::Abstract_expr_node)
Check if node
is a sin
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_tan
— Methodbool = _node_is_tan(node::Abstract_expr_node)
Check if node
is a tan
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_times
— Methodbool = _node_is_times(node::Abstract_expr_node)
Check if node
is a *
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_abstract_expr_node.Abstract_expr_node
— TypeSupertype of every node.
sourceExpressionTreeForge.M_abstract_expr_node.MyRef
— TypeMyRef{Y <: Number}
Sort of pointer. Contain the field:
value
which points to the desired structure.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_abstract_expr_node.get_myRef
— Methodvalue = get_myRef(reference::MyRef{Y}) where {Y <: Number}
Get the value
of the reference
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_abstract_expr_node.set_myRef!
— Methodset_myRef!(reference::MyRef{Y}, value::Y) where {Y <: Number}
Set the reference
to value
.
sourceExpressionTreeForge.M_trait_tree.Type_not_trait_tree
— TypeType instantiated dynamically representeing that an argument is not a tree.
sourceExpressionTreeForge.M_trait_tree.Type_trait_tree
— TypeType instantiated dynamically representeing that an argument is a tree.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_interface_tree._get_node
— Methodnode = _get_node(tree, trait_tree)
Get the root node
of tree
, if trait_tree::Type_trait_tree
.
sourceExpressionTreeForge.M_trait_tree.get_children
— Methodchildren = get_children(tree)
Get the children
from the root node of tree
.
sourceExpressionTreeForge.M_trait_tree.get_node
— Methodnode = get_node(tree)
Get the root node
of tree
.
sourceExpressionTreeForge.M_trait_tree.is_type_trait_tree
— MethodType_trait_tree = is_type_trait_tree(a::AbstractTree)
+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.
sourceExpressionTreeForge.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])
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_node.Type_expr_node
— TypeType instantiated dynamically representeing that an argument is an expression node.
sourceExpressionTreeForge.M_trait_expr_node.Type_not_expr_node
— TypeType instantiated dynamically representeing that an argument is a not an expression node.
sourceExpressionTreeForge.M_trait_expr_node.cast_constant!
— Methodbool = cast_constant!(node::Abstract_expr_node, type::Datatype)
Rewrite the Number
s composing node
as type
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_node.evaluate_node
— Methodvalue = _evaluate_node(node::Abstract_expr_node, value_children::AbstractVector{T}) where T<:Number
Evaluate node
depending on value_children
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_node.get_var_index
— Methodindex = get_var_index(variable::Abstract_expr_node)
Return the index
of the variable
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_expr_node.node_is_constant
— Methodbool = node_is_constant(node::Abstract_expr_node)
Check if node
is a constant.
sourceExpressionTreeForge.M_trait_expr_node.node_is_cos
— Methodbool = node_is_cos(node::Abstract_expr_node)
Check if node
is a cos
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_minus
— Methodbool = node_is_minus(node::Abstract_expr_node)
Check if node
is a -
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_trait_expr_node.node_is_plus
— Methodbool = node_is_plus(node::Abstract_expr_node)
Check if node
is a +
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_power
— Methodbool = node_is_power(node::Abstract_expr_node)
Check if node
is a ^
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_sin
— Methodbool = node_is_sin(node::Abstract_expr_node)
Check if node
is a sin
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_tan
— Methodbool = node_is_tan(node::Abstract_expr_node)
Check if node
is a tan
operator.
sourceExpressionTreeForge.M_trait_expr_node.node_is_times
— Methodbool = _node_is_times(node::Abstract_expr_node)
Check if node
is a *
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_node._cast_constant!
— Methodbool = _cast_constant!(node::Abstract_expr_node, type::Datatype)
Rewrite the Number
s composing node
as type
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_node._evaluate_node!
— Method_evaluate_node!(node::Abstract_expr_node, value_children::AbstractVector{T}, ref::MyRef{T}) where T<:Number
Evaluate node
depending on value_children
and store the result in ref
.
sourceExpressionTreeForge.M_interface_expr_node._evaluate_node
— Methodvalue = _evaluate_node(node::Abstract_expr_node, value_children::AbstractVector{T}) where T<:Number
Evaluate node
depending on value_children
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_interface_expr_node._get_var_index
— Methodindex = _get_var_index(variable::Abstract_expr_node)
Return the index
of the variable
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_interface_expr_node._node_is_constant
— Methodbool = _node_is_constant(node::Abstract_expr_node)
Check if node
is a constant.
sourceExpressionTreeForge.M_interface_expr_node._node_is_cos
— Methodbool = _node_is_cos(node::Abstract_expr_node)
Check if node
is a cos
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_minus
— Methodbool = _node_is_minus(node::Abstract_expr_node)
Check if node
is a -
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_interface_expr_node._node_is_plus
— Methodbool = _node_is_plus(node::Abstract_expr_node)
Check if node
is a +
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_power
— Methodbool = _node_is_power(node::Abstract_expr_node)
Check if node
is a ^
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_sin
— Methodbool = _node_is_sin(node::Abstract_expr_node)
Check if node
is a sin
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_tan
— Methodbool = _node_is_tan(node::Abstract_expr_node)
Check if node
is a tan
operator.
sourceExpressionTreeForge.M_interface_expr_node._node_is_times
— Methodbool = _node_is_times(node::Abstract_expr_node)
Check if node
is a *
operator.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.M_abstract_expr_node.Abstract_expr_node
— TypeSupertype of every node.
sourceExpressionTreeForge.M_abstract_expr_node.MyRef
— TypeMyRef{Y <: Number}
Sort of pointer. Contain the field:
value
which points to the desired structure.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_abstract_expr_node.get_myRef
— Methodvalue = get_myRef(reference::MyRef{Y}) where {Y <: Number}
Get the value
of the reference
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_abstract_expr_node.set_myRef!
— Methodset_myRef!(reference::MyRef{Y}, value::Y) where {Y <: Number}
Set the reference
to value
.
sourceExpressionTreeForge.M_trait_tree.Type_not_trait_tree
— TypeType instantiated dynamically representeing that an argument is not a tree.
sourceExpressionTreeForge.M_trait_tree.Type_trait_tree
— TypeType instantiated dynamically representeing that an argument is a tree.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_interface_tree._get_node
— Methodnode = _get_node(tree, trait_tree)
Get the root node
of tree
, if trait_tree::Type_trait_tree
.
sourceExpressionTreeForge.M_trait_tree.get_children
— Methodchildren = get_children(tree)
Get the children
from the root node of tree
.
sourceExpressionTreeForge.M_trait_tree.get_node
— Methodnode = get_node(tree)
Get the root node
of tree
.
sourceExpressionTreeForge.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
.
sourceBase.show
— Methodshow(tree::AbstractTree; deepth)
-show(io::IO, tree::AbstractTree; deepth)
Print tree
in the Julia console with a suitable form.
sourceExpressionTreeForge.algo_tree.printer_tree
— Functionprint_tree(tree::AbstractTree)
Print a tree as long as it satisfies the interface M_interface_tree
.
sourceExpressionTreeForge.M_interface_tree._get_children
— Methodchildren = _get_children(tree)
Get the children
from the root node of tree
.
sourceExpressionTreeForge.M_interface_tree._get_node
— Methodnode = _get_node(tree)
Get the root node
of tree
.
sourceExpressionTreeForge.M_implementation_tree.Type_node
— TypeType_node{T} <: AbstractTree
Basic implementation of a tree. A Type_node
has fields:
field
gathering the informations about the current node;children
a vector of children, each of them being a Type_node
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_abstract_tree.AbstractTree
— TypeSupertype of every tree.
sourceExpressionTreeForge.M_abstract_tree.create_tree
— Methodtree = create_tree(field::T, children::Vector{Type_node{T}}) where {T}
+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
.
sourceBase.show
— Methodshow(tree::AbstractTree; deepth)
+show(io::IO, tree::AbstractTree; deepth)
Print tree
in the Julia console with a suitable form.
sourceExpressionTreeForge.algo_tree.printer_tree
— Functionprint_tree(tree::AbstractTree)
Print a tree as long as it satisfies the interface M_interface_tree
.
sourceExpressionTreeForge.M_interface_tree._get_children
— Methodchildren = _get_children(tree)
Get the children
from the root node of tree
.
sourceExpressionTreeForge.M_interface_tree._get_node
— Methodnode = _get_node(tree)
Get the root node
of tree
.
sourceExpressionTreeForge.M_implementation_tree.Type_node
— TypeType_node{T} <: AbstractTree
Basic implementation of a tree. A Type_node
has fields:
field
gathering the informations about the current node;children
a vector of children, each of them being a Type_node
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_abstract_tree.AbstractTree
— TypeSupertype of every tree.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_trait_type_expr.Type_not_type_expr
— TypeType instantiated dynamically that checks if an argument is not a Type_expr_basic
sourceExpressionTreeForge.M_trait_type_expr.Type_type_expr
— TypeType instantiated dynamically that checks if an argument is a Type_expr_basic
sourceExpressionTreeForge.M_trait_type_expr.is_constant
— Methodbool = _is_constant(type)
Return true
if type
is a constant type.
sourceExpressionTreeForge.M_trait_type_expr.is_cubic
— Methodbool = _is_cubic(type)
Return true
if type
is a cubic type.
sourceExpressionTreeForge.M_trait_type_expr.is_linear
— Methodbool = _is_linear(type)
Return true
if type
is a linear type.
sourceExpressionTreeForge.M_trait_type_expr.is_more
— Methodbool = _is_more(type)
Return true
if type
is more
non linear than a cubic.
sourceExpressionTreeForge.M_trait_type_expr.is_quadratic
— Methodbool = _is_quadratic(type)
Return true
if type
is a quadratic type.
sourceExpressionTreeForge.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
sourceExpressionTreeForge.M_trait_type_expr.type_power
— Methodresult_type = type_power(index, type)
Return the type resulting of type
to power index
.
sourceExpressionTreeForge.M_trait_type_expr.type_product
— Methodresult_type = type_product(type1, type2)
Return the type resulting of a product between type1
and type2
.
sourceExpressionTreeForge.M_interface_type_expr._is_constant
— Methodbool = _is_constant(type)
Return true
if type
is a constant
type.
sourceExpressionTreeForge.M_interface_type_expr._is_cubic
— Methodbool = _is_cubic(type)
Return true
if type
is a cubic
type.
sourceExpressionTreeForge.M_interface_type_expr._is_linear
— Methodbool = _is_linear(type)
Return true
if type
is a linear
type.
sourceExpressionTreeForge.M_interface_type_expr._is_more
— Methodbool = _is_more(type)
Return true
if type
is more
non linear than a cubic type.
sourceExpressionTreeForge.M_interface_type_expr._is_quadratic
— Methodbool = _is_quadratic(type)
Return true
if type
is a quadratic
type.
sourceExpressionTreeForge.M_interface_type_expr._type_power
— Methodresult_type = _type_power(index, type)
Return the type resulting of type
to power index
.
sourceExpressionTreeForge.M_interface_type_expr._type_product
— Methodresult_type = _type_product(type1, type2)
Return the type resulting of a product between type1
and type2
.
sourceExpressionTreeForge.M_implementation_type_expr.return_constant
— Methodconstant = return_constant()
Return constantype::Type_expr_basic
.
sourceExpressionTreeForge.M_implementation_type_expr.return_cubic
— Methodcubic = return_cubic()
Return cubic::Type_expr_basic
.
sourceExpressionTreeForge.M_implementation_type_expr.return_linear
— Methodlinear = return_linear()
Return linear::Type_expr_basic
.
sourceExpressionTreeForge.M_implementation_type_expr.return_more
— Methodmore = return_more()
Return more::Type_expr_basic
.
sourceExpressionTreeForge.M_implementation_type_expr.return_quadratic
— Methodquadratic = return_quadratic()
Return quadratic::Type_expr_basic
.
sourceExpressionTreeForge.M_interface_type_expr._is_constant
— Methodbool = _is_constant(type::Type_expr_basic)
Check if type
equals constant
.
sourceExpressionTreeForge.M_interface_type_expr._is_cubic
— Methodbool = _is_cubic(type::Type_expr_basic)
Check if type
equals cubic
.
sourceExpressionTreeForge.M_interface_type_expr._is_linear
— Methodbool = _is_linear(type::Type_expr_basic)
Check if type
equals linear
.
sourceExpressionTreeForge.M_interface_type_expr._is_more
— Methodbool = _is_more(type::Type_expr_basic)
Check if type
equals more
.
sourceExpressionTreeForge.M_interface_type_expr._is_quadratic
— Methodbool = _is_quadratic(type::Type_expr_basic)
Check if type
equals quadratic
.
sourceExpressionTreeForge.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)
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_implementation_convexity_type.Convexity_type
— TypeConvexity_type
Type representing wether an expression is not_treated, constant, linear, convex, concave
or unknown
.
sourceExpressionTreeForge.M_implementation_convexity_type.Convexity_wrapper
— TypeConvexity_wrapper
Wrapper around Convexity_type
.
sourceExpressionTreeForge.M_implementation_convexity_type.concave_type
— Methodconcave = concave_type()
Return concave::Convexity_type
.
sourceExpressionTreeForge.M_implementation_convexity_type.concave_wrapper
— Methodconcave_wrapper = concave_wrapper()
Return a Convexity_wrapper
wich values concave
.
sourceExpressionTreeForge.M_implementation_convexity_type.constant_type
— Methodconstant = constant_type()
Return constant::Convexity_type
.
sourceExpressionTreeForge.M_implementation_convexity_type.constant_wrapper
— Methodconstant_wrapper = constant_wrapper()
Return a Convexity_wrapper
wich values constant
.
sourceExpressionTreeForge.M_implementation_convexity_type.convex_type
— Methodconvex = convex_type()
Return convex::Convexity_type
.
sourceExpressionTreeForge.M_implementation_convexity_type.convex_wrapper
— Methodconvex_wrapper = convex_wrapper()
Return a Convexity_wrapper
wich values convex
.
sourceExpressionTreeForge.M_implementation_convexity_type.get_convexity_wrapper
— Methodconvexity_status = get_convexity_wrapper(convexity::Convexity_wrapper)
Return the convexity status of convexity
.
sourceExpressionTreeForge.M_implementation_convexity_type.init_conv_status
— Methoduntreated_wrapper = init_conv_status()
Return a Convexity_wrapper
wich values not_treated
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.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
.
sourceExpressionTreeForge.M_implementation_convexity_type.linear_type
— Methodlinear = linear_type()
Return linear::Convexity_type
.
sourceExpressionTreeForge.M_implementation_convexity_type.linear_wrapper
— Methodlinear_wrapper = linear_wrapper()
Return a Convexity_wrapper
wich values linear
.
sourceExpressionTreeForge.M_implementation_convexity_type.not_treated_type
— Methodnot_treated = not_treated_type()
Return not_treated::Convexity_type
.
sourceExpressionTreeForge.M_implementation_convexity_type.set_convexity_wrapper!
— Methodset_convexity_wrapper!(convexity::Convexity_wrapper, t::Convexity_type)
Set the convexity status of convexity
to type
.
sourceExpressionTreeForge.M_implementation_convexity_type.unknown_type
— Methodunknown = unknown_type()
Return unknown::Convexity_type
.
sourceExpressionTreeForge.M_implementation_convexity_type.unknown_wrapper
— Methodunknown_wrapper = unknown_wrapper()
Return a Convexity_wrapper
wich values unknown
.
sourceSettings
This document was generated with Documenter.jl on Wednesday 2 October 2024. Using Julia version 1.10.5.
+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_type
Type representing wether an expression is not_treated, constant, linear, convex, concave
or unknown
.
ExpressionTreeForge.M_implementation_convexity_type.Convexity_wrapper
— TypeConvexity_wrapper
Wrapper 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
.