Table of Contents

Class Variable

Namespace
Nalu.Cassowary
Assembly
Nalu.Maui.Layouts.dll

Identifies a variable for the constraint solver. Each new variable is unique in the view of the solver, but copying or cloning the variable produces a copy of the same variable.

public class Variable
Inheritance
Variable
Inherited Members

Constructors

Variable()

Initializes a new instance of the Variable class.

public Variable()

Properties

CurrentValue

Gets or sets the current value of the variable.

public double CurrentValue { get; set; }

Property Value

double

Remarks

Don't use this value unless you know what you're doing.

Name

Gets the name for this variable.

public string? Name { get; }

Property Value

string

Methods

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int

A hash code for the current object.

SetName(string)

Sets the variable name for debugging purposes.

public void SetName(string name)

Parameters

name string

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

Operators

operator +(Variable, Expression)

Add expression to variable and return new Expression.

public static Expression operator +(Variable variable, Expression expression)

Parameters

variable Variable

The Variable.

expression Expression

The Expression.

Returns

Expression

New Expression instance with variable.

operator +(Variable, Term)

Add term to variable and return new Expression.

public static Expression operator +(Variable variable, Term term)

Parameters

variable Variable

The Variable.

term Term

The Term.

Returns

Expression

New Expression instance with variable and term and Constant as 0.

operator +(Variable, Variable)

Add other to variable and return new Expression.

public static Expression operator +(Variable variable, Variable other)

Parameters

variable Variable

The Variable.

other Variable

The Variable.

Returns

Expression

New Expression instance with both variables and constant as 0.

operator +(Variable, double)

Add value to variable and return new Expression.

public static Expression operator +(Variable variable, double value)

Parameters

variable Variable

The Variable.

value double

The value.

Returns

Expression

New Expression instance with variable value value as Constant.

operator +(Variable, float)

Add value to variable and return new Expression.

public static Expression operator +(Variable variable, float value)

Parameters

variable Variable

The Variable.

value float

The value.

Returns

Expression

New Expression instance with variable value value as Constant.

operator +(double, Variable)

Add value to variable and return new Expression.

public static Expression operator +(double value, Variable variable)

Parameters

value double

The value.

variable Variable

The Variable.

Returns

Expression

New Expression instance with variable value value as Constant.

operator +(float, Variable)

Add value to variable and return new Expression.

public static Expression operator +(float value, Variable variable)

Parameters

value float

The value.

variable Variable

The Variable.

Returns

Expression

New Expression instance with variable value value as Constant.

operator |(Variable, WeightedRelation)

Or variable with relation.

public static PartialConstraint operator |(Variable variable, WeightedRelation relation)

Parameters

variable Variable

The Variable.

relation WeightedRelation

The WeightedRelation.

Returns

PartialConstraint

New PartialConstraint instance.

operator /(Variable, double)

Divide variable by value and return new Term.

public static Term operator /(Variable variable, double value)

Parameters

variable Variable

The Variable.

value double

The value.

Returns

Term

New Term.

operator /(Variable, float)

Divide variable by value and return new Term.

public static Term operator /(Variable variable, float value)

Parameters

variable Variable

The Variable.

value float

The value.

Returns

Term

New Term.

operator *(Variable, double)

Multiply variable with value and return new Term.

public static Term operator *(Variable variable, double value)

Parameters

variable Variable

The Variable.

value double

The value.

Returns

Term

New Term instance.

operator *(Variable, float)

Multiply variable with value and return new Term.

public static Term operator *(Variable variable, float value)

Parameters

variable Variable

The Variable.

value float

The value.

Returns

Term

New Term instance.

operator *(double, Variable)

Multiply variable with value and return new Term.

public static Term operator *(double value, Variable variable)

Parameters

value double

The value.

variable Variable

The Variable.

Returns

Term

New Term instance.

operator *(float, Variable)

Multiply variable with value and return new Term.

public static Term operator *(float value, Variable variable)

Parameters

value float

The value.

variable Variable

The Variable.

Returns

Term

New Term instance.

operator -(Variable, Expression)

Subtract expression from variable and return new Expression.

public static Expression operator -(Variable variable, Expression expression)

Parameters

variable Variable

The Variable.

expression Expression

The Expression.

Returns

Expression

New Expression instance.

operator -(Variable, Term)

Subtract term from variable and return new Expression.

public static Expression operator -(Variable variable, Term term)

Parameters

variable Variable

The Variable.

term Term

The Term.

Returns

Expression

New Expression instance.

operator -(Variable, Variable)

Subtract other from variable and return new Expression.

public static Expression operator -(Variable variable, Variable other)

Parameters

variable Variable

The Variable.

other Variable

The Variable.

Returns

Expression

New Expression instance with both variables and constant as 0.

operator -(Variable, double)

Subtract value from variable and return new Expression.

public static Expression operator -(Variable variable, double value)

Parameters

variable Variable

The Variable.

value double

The value.

Returns

Expression

New Expression instance with variable and negate value as Constant .

operator -(Variable, float)

Subtract value from variable and return new Expression.

public static Expression operator -(Variable variable, float value)

Parameters

variable Variable

The Variable.

value float

The value.

Returns

Expression

New Expression instance with variable and negate value as Constant .

operator -(double, Variable)

Subtract value from variable and return new Expression.

public static Expression operator -(double value, Variable variable)

Parameters

value double

The value.

variable Variable

The Variable.

Returns

Expression

New Expression instance with variable and negate value as Constant .

operator -(float, Variable)

Subtract value from variable and return new Expression.

public static Expression operator -(float value, Variable variable)

Parameters

value float

The value.

variable Variable

The Variable.

Returns

Expression

New Expression instance with variable and negate value as Constant .

operator -(Variable)

Negate variable and return new Term.

public static Term operator -(Variable variable)

Parameters

variable Variable

The Variable.

Returns

Term

New Term instance with the variable and Coefficient as -1.