@@ -8,45 +8,63 @@ import (
88
99const (
1010 // Zero is a constant expression representing the value 0.
11+ //
12+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
1113 Zero = K (0 )
1214 // One is a constant expression representing the value 1.
15+ //
16+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
1317 One = K (1 )
1418)
1519
1620// K is a constant expression type for an MIP (Mixed Integer Program).
21+ //
22+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
1723type K float64
1824
1925// Variables returns all variables included in the expression.
2026// For constant K, there are no variables, so it returns an empty slice.
27+ //
28+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
2129func (c K ) Variables () []Variable {
2230 return []Variable {}
2331}
2432
2533// NumVars returns the number of variables in the expression.
2634// For constant K, this is always 0.
35+ //
36+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
2737func (c K ) NumVars () int {
2838 return 0
2939}
3040
3141// IDs returns a slice of the variable IDs in the expression.
3242// For constant K, this is always nil.
43+ //
44+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
3345func (c K ) IDs () []uint64 {
3446 return nil
3547}
3648
3749// Coeffs returns a slice of the coefficients in the expression.
3850// For constant K, this is always nil.
51+ //
52+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
3953func (c K ) Coeffs () []float64 {
4054 return nil
4155}
4256
4357// Constant returns the constant additive value in the expression.
4458// For constant K, this is just the constant's value.
59+ //
60+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
4561func (c K ) Constant () float64 {
4662 return float64 (c )
4763}
4864
4965// Plus adds the current expression to another and returns the resulting expression.
66+ //
67+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
5068func (c K ) Plus (rightIn interface {}, errors ... error ) (Expression , error ) {
5169 // Input Processing
5270 err := CheckErrors (errors )
@@ -78,21 +96,29 @@ func (c K) Plus(rightIn interface{}, errors ...error) (Expression, error) {
7896}
7997
8098// LessEq returns a less than or equal to (<=) constraint between the current expression and another.
99+ //
100+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
81101func (c K ) LessEq (rightIn interface {}, errors ... error ) (Constraint , error ) {
82102 return c .Comparison (rightIn , SenseLessThanEqual , errors ... )
83103}
84104
85105// GreaterEq returns a greater than or equal to (>=) constraint between the current expression and another.
106+ //
107+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
86108func (c K ) GreaterEq (rightIn interface {}, errors ... error ) (Constraint , error ) {
87109 return c .Comparison (rightIn , SenseGreaterThanEqual , errors ... )
88110}
89111
90112// Eq returns an equality (==) constraint between the current expression and another.
113+ //
114+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
91115func (c K ) Eq (rightIn interface {}, errors ... error ) (Constraint , error ) {
92116 return c .Comparison (rightIn , SenseEqual , errors ... )
93117}
94118
95119// Comparison compares the receiver with expression rhs in the sense provided by sense.
120+ //
121+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
96122func (c K ) Comparison (rhsIn interface {}, sense ConstrSense , errors ... error ) (Constraint , error ) {
97123 // InputProcessing
98124 err := CheckErrors (errors )
@@ -112,6 +138,8 @@ func (c K) Comparison(rhsIn interface{}, sense ConstrSense, errors ...error) (Co
112138}
113139
114140// Multiply multiplies the input constant by another expression.
141+ //
142+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
115143func (c K ) Multiply (term1 interface {}, errors ... error ) (Expression , error ) {
116144 // Constants
117145
@@ -217,19 +245,30 @@ func (c K) Multiply(term1 interface{}, errors ...error) (Expression, error) {
217245 }
218246}
219247
248+ // Dims returns the dimensions of the constant K expression, which is always [1, 1] for a scalar.
249+ //
250+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
220251func (c K ) Dims () []int {
221252 return []int {1 , 1 } // Signifies scalar
222253}
223254
255+ // Check verifies that the constant K expression is valid. For K, this always returns nil.
256+ //
257+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
224258func (c K ) Check () error {
225259 return nil
226260}
227261
262+ // Transpose returns the transpose of the constant K expression, which is the constant itself.
263+ //
264+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
228265func (c K ) Transpose () Expression {
229266 return c
230267}
231268
232269// ToSymbolic converts the constant to a symbolic expression (i.e., one that uses the symbolic math toolbox).
270+ //
271+ // Deprecated: This package is deprecated. Please use github.com/MatProGo-dev/SymbolicMath.go instead.
233272func (c K ) ToSymbolic () (symbolic.Expression , error ) {
234273 return symbolic .K (c ), nil
235274}
0 commit comments