Class ConstantExpression
A ConstantExpression only holds a double value but can be used as part of an expression
Inherited Members
Namespace: OPTANO.Modeling.Optimization
Assembly: Optimization.dll
Syntax
[DataContract]
[Serializable]
public class ConstantExpression : Expression
Constructors
ConstantExpression(Double)
Initializes a new instance of the ConstantExpression class.
Declaration
public ConstantExpression(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value. |
Properties
Constant
Gets the constant.
Declaration
public override double Constant { get; }
Property Value
Type | Description |
---|---|
System.Double |
Overrides
ConstantValue
Gets the constant.
Declaration
public double ConstantValue { get; }
Property Value
Type | Description |
---|---|
System.Double |
ContainsAtMostOneVariable
Declaration
public override bool ContainsAtMostOneVariable { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
ContainsNoVariables
Declaration
public override bool ContainsNoVariables { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Overrides
IsLinear
Gets or sets a value indicating whether this instance is linear.
Declaration
public override bool IsLinear { get; }
Property Value
Type | Description |
---|---|
System.Boolean | Always |
Overrides
Terms
Gets the terms.
Declaration
public override IEnumerable<Term> Terms { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Term> | Always |
Overrides
Variables
Gets the variables.
Declaration
public override IEnumerable<Variable> Variables { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Variable> | Always |
Overrides
Methods
ToString()
Returns a System.String that represents this instance.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |
Overrides
Operators
Addition(ConstantExpression, Double)
Implements the operator +.
Declaration
public static ConstantExpression operator +(ConstantExpression expression, double constant)
Parameters
Type | Name | Description |
---|---|---|
ConstantExpression | expression | The expression. |
System.Double | constant | The constant. |
Returns
Type | Description |
---|---|
ConstantExpression | The result of the operator. |
Addition(Double, ConstantExpression)
Implements the operator +.
Declaration
public static ConstantExpression operator +(double constant, ConstantExpression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Double | constant | The constant. |
ConstantExpression | expression | The expression. |
Returns
Type | Description |
---|---|
ConstantExpression | The result of the operator. |
Implicit(Double to ConstantExpression)
Performs an implicit conversion from System.Double to ConstantExpression.
Declaration
public static implicit operator ConstantExpression(double value)
Parameters
Type | Name | Description |
---|---|---|
System.Double | value | The value. |
Returns
Type | Description |
---|---|
ConstantExpression | The result of the conversion. |
Implicit(Int32 to ConstantExpression)
Performs an implicit conversion from System.Int32 to ConstantExpression.
Declaration
public static implicit operator ConstantExpression(int value)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | value | The value. |
Returns
Type | Description |
---|---|
ConstantExpression | The result of the conversion. |
Multiply(ConstantExpression, Double)
Implements the operator *.
Declaration
public static ConstantExpression operator *(ConstantExpression expression, double factor)
Parameters
Type | Name | Description |
---|---|---|
ConstantExpression | expression | The expression. |
System.Double | factor | The factor. |
Returns
Type | Description |
---|---|
ConstantExpression | The result of the operator. |
Multiply(Double, ConstantExpression)
Implements the operator *.
Declaration
public static ConstantExpression operator *(double factor, ConstantExpression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Double | factor | The factor. |
ConstantExpression | expression | The constant expression. |
Returns
Type | Description |
---|---|
ConstantExpression | A new ConstantExpression. |
Subtraction(ConstantExpression, Double)
Implements the operator +.
Declaration
public static ConstantExpression operator -(ConstantExpression expression, double constant)
Parameters
Type | Name | Description |
---|---|---|
ConstantExpression | expression | The expression. |
System.Double | constant | The constant. |
Returns
Type | Description |
---|---|
ConstantExpression | The result of the operator. |
Subtraction(Double, ConstantExpression)
Implements the operator -.
Declaration
public static ConstantExpression operator -(double constant, ConstantExpression expression)
Parameters
Type | Name | Description |
---|---|---|
System.Double | constant | The constant. |
ConstantExpression | expression | The expression. |
Returns
Type | Description |
---|---|
ConstantExpression | The result of the operator. |