Skip to content

Commit

Permalink
Revert
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jun 26, 2023
1 parent 5d4dad5 commit 38e2d24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
5 changes: 2 additions & 3 deletions docs/src/manual/models.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,10 @@ julia> model = Model(solver);
By default, the coefficients of affine and quadratic expressions are numbers
of type either `Float64` or `Complex{Float64}` (see [Complex number support](@ref)).

The type `Float64` can be changed using the `value_type` argument of
[`Model`](@ref):
The type `Float64` can be changed using the [`GenericModel`](@ref) constructor:

```jldoctest
julia> model = Model(; value_type = Rational{BigInt});
julia> model = GenericModel{Rational{BigInt}}();
julia> @variable(model, x)
x
Expand Down
9 changes: 4 additions & 5 deletions docs/src/tutorials/conic/arbitrary_precision.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ import Clarabel

# ## Higher-precision arithmetic

# To create a model with a number type other than `Float64`, use the `value_type`
# argument to [`Model`](@ref) with an optimizer which supports the same number
# type:
# To create a model with a number type other than `Float64`, use [`GenericModel`](@ref)
# with an optimizer which supports the same number type:

model = Model(Clarabel.Optimizer{BigFloat}; value_type = BigFloat)
model = GenericModel{BigFloat}(Clarabel.Optimizer{BigFloat})

# The syntax for adding decision variables is the same as a normal JuMP
# model, except that values are converted to `BigFloat`:
Expand Down Expand Up @@ -109,7 +108,7 @@ value.(x) .- [3 // 7, 3 // 14]
# JuMP also supports solvers with exact rational arithmetic. One example is
# CDDLib.jl, which supports the `Rational{BigInt}` number type:

model = Model(CDDLib.Optimizer{Rational{BigInt}}; value_type = Rational{BigInt})
model = GenericModel{Rational{BigInt}}(CDDLib.Optimizer{Rational{BigInt}})

# As before, we can create variables using rational bounds:

Expand Down
4 changes: 0 additions & 4 deletions src/JuMP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,6 @@ function GenericModel{T}(
return model
end

function GenericModel{T}(args...; kwargs...) where {T}
return Model(args...; value_type = T, kwargs...)
end

"""
direct_generic_model(
value_type::Type{T},
Expand Down

0 comments on commit 38e2d24

Please sign in to comment.