diff --git a/docs/src/index.md b/docs/src/index.md index b3a3e04..c7e1697 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -3,5 +3,5 @@ ```@autodocs Modules = [ConstraintTrees] -Pages = ["ConstraintTrees.jl"] +Pages = ["src/ConstraintTrees.jl"] ``` diff --git a/docs/src/metabolic-modeling.jl b/docs/src/metabolic-modeling.jl index 58f38d9..f8861f4 100644 --- a/docs/src/metabolic-modeling.jl +++ b/docs/src/metabolic-modeling.jl @@ -115,7 +115,7 @@ sum(C.value.(values(c.fluxes))) # To demonstrate, let's make a small system with 2 variables. system = C.allocate_variables(keys = [:x, :y]) -# To add an affine element to a [`Value`](@ref), simply add it as a `Real` +# To add an affine element to a `Value`, simply add it as a `Real` # number, as in the linear transformations below: system = :original_coords^system * diff --git a/docs/src/quadratic-optimization.jl b/docs/src/quadratic-optimization.jl index 4ab5876..9847c6b 100644 --- a/docs/src/quadratic-optimization.jl +++ b/docs/src/quadratic-optimization.jl @@ -3,13 +3,13 @@ # # In this example we demonstrate the use of quadratic constraints and values. # We assume that the reader is already familiar with the construction of -# [`ConstraintTree`](@ref)s; if not, it is advisable to read the previous part +# `ConstraintTree`s; if not, it is advisable to read the previous part # of the documentation first. # # In short, quadratic values and constraints are expressed similarly as other -# contents of the constraint trees using types [`QValue`](@ref) and -# [`QConstraint`](@ref), which are quadratic alikes of the linear -# [`Value`](@ref) and [`Constraint`](@ref). +# contents of the constraint trees using types `QValue` and +# `QConstraint`, which are quadratic alikes of the linear +# `Value` and `Constraint`. # # ## Working with quadratic values and constraints # @@ -58,7 +58,7 @@ point = C.allocate_variables(keys = [:x, :y]) ellipse_system = C.make_constraint_tree( :point => point, :in_area => C.QConstraint( - qvalue = squared(point.x.value / 2) + squared(10.0 - point.y.value), + qvalue = squared(point.x.value) / 4 + squared(10.0 - point.y.value), bound = (-Inf, 1.0), ), ); @@ -127,6 +127,7 @@ function optimized_vars(cs::C.ConstraintTree, objective::Union{C.Value,C.QValue} add_constraint.(values(c)) end add_constraint(cs) + JuMP.set_silent(model) JuMP.optimize!(model) JuMP.value.(model[:x]) end diff --git a/docs/src/reference.md b/docs/src/reference.md index 068ff23..fb1681b 100644 --- a/docs/src/reference.md +++ b/docs/src/reference.md @@ -1,30 +1,53 @@ # Reference -## Values (linear combinations of variables) +## Values + +### Linear and affine values + +```@autodocs +Modules = [ConstraintTrees] +Pages = ["src/value.jl"] +``` + +### Quadratic values ```@autodocs Modules = [ConstraintTrees] -Pages = ["value.jl"] +Pages = ["src/qvalue.jl"] ``` ## Constraints ```@autodocs Modules = [ConstraintTrees] -Pages = ["constraint.jl"] +Pages = ["src/bound.jl"] +``` + +### Linear and affine constraints + +```@autodocs +Modules = [ConstraintTrees] +Pages = ["src/constraint.jl"] +``` + +### Quadratic constraints + +```@autodocs +Modules = [ConstraintTrees] +Pages = ["src/qconstraint.jl"] ``` ## Constraint trees ```@autodocs Modules = [ConstraintTrees] -Pages = ["constraint_tree.jl"] +Pages = ["src/constraint_tree.jl"] ``` ## Solution trees ```@autodocs Modules = [ConstraintTrees] -Pages = ["solution.jl"] +Pages = ["src/solution_tree.jl"] ```