You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The objective function will now be ``\\max 1.0x + 1.0``.
544
+
The objective function will now be ``\max 1.0x + 1.0``.
537
545
538
546
#### Constant terms in a vector function
539
547
540
-
We can modify the constant terms in a [`VectorAffineFunction`](@ref) or a
541
-
[`VectorQuadraticFunction`](@ref) using the [`VectorConstantChange`](@ref)
542
-
subtype of [`AbstractFunctionModification`](@ref).
548
+
We can modify the constant terms in a [`VectorAffineFunction`](@ref MathOptInterface.VectorAffineFunction) or a[`VectorQuadraticFunction`](@ref MathOptInterface.VectorQuadraticFunction) using the
549
+
[`VectorConstantChange`](@ref MathOptInterface.VectorConstantChange) subtype of
We can modify the constant vector in the [`VectorAffineFunction`](@ref) from
558
-
`[0.0, 0.0]` to `[1.0, 2.0]` as follows:
565
+
We can modify the constant vector in the [`VectorAffineFunction`](@ref MathOptInterface.VectorAffineFunction)
566
+
from `[0.0, 0.0]` to `[1.0, 2.0]` as follows:
559
567
```julia
560
568
modify!(m, c, VectorConstantChange([1.0, 2.0])
561
569
)
562
570
```
563
-
The constraints are now ``1.0x + 1.0 \\le 0.0`` and ``2.0y + 2.0 \\le 0.0``.
571
+
The constraints are now ``1.0x + 1.0 \le 0.0`` and ``2.0y + 2.0 \le 0.0``.
564
572
565
573
#### Affine coefficients in a scalar function
566
574
567
575
In addition to modifying the constant terms in a function, we can also modify
568
-
the affine variable coefficients in an [`ScalarAffineFunction`](@ref) or a
569
-
[`ScalarQuadraticFunction`](@ref) using the [`ScalarCoefficientChange`](@ref)
570
-
subtype of [`AbstractFunctionModification`](@ref).
576
+
the affine variable coefficients in an [`ScalarAffineFunction`](@ref MathOptInterface.ScalarAffineFunction) or a[`ScalarQuadraticFunction`](@ref MathOptInterface.ScalarQuadraticFunction) using
577
+
the [`ScalarCoefficientChange`](@ref MathOptInterface.ScalarCoefficientChange)
578
+
subtype of [`AbstractFunctionModification`](@ref MathOptInterface.AbstractFunctionModification).
571
579
572
580
For example, given the constraint ``1.0x <= 1.0``:
573
581
```julia
@@ -582,19 +590,22 @@ we can modify the coefficient of the `x` variable so that the constraint becomes
582
590
modify!(m, c, ScalarCoefficientChange(x, 2.0))
583
591
```
584
592
585
-
[`ScalarCoefficientChange`](@ref) can also be used to modify the objective
586
-
function by passing an instance of [`ObjectiveFunction`](@ref) instead of the
593
+
[`ScalarCoefficientChange`](@ref MathOptInterface.ScalarCoefficientChange) can
594
+
also be used to modify the objective function by passing an instance of
595
+
[`ObjectiveFunction`](@ref MathOptInterface.ObjectiveFunction) instead of the
587
596
constraint index `c` as we saw above.
588
597
589
598
#### Affine coefficients in a vector function
590
599
591
600
Finally, the last modification supported by MathOptInterface is the ability to
592
601
modify the affine coefficients of a single variable in a
593
-
[`VectorAffineFunction`](@ref) or a [`VectorQuadraticFunction`](@ref) using the
594
-
[`MultirowChange`](@ref) subtype of [`AbstractFunctionModification`](@ref).
602
+
[`VectorAffineFunction`](@ref MathOptInterface.VectorAffineFunction) or a
603
+
[`VectorQuadraticFunction`](@ref MathOptInterface.VectorQuadraticFunction) using
604
+
the [`MultirowChange`](@ref MathOptInterface.MultirowChange) subtype of
0 commit comments