class ArrayRow

Known direct subclasses
GoalRow
PriorityGoalRow

Implements a row containing goals taking in account priorities.


Summary

Nested types

Public constructors

ArrayRow(cache: Cache!)

Public functions

Unit
ArrayRow!
addError(system: LinearSystem!, strength: Int)
Unit
ArrayRow!
createRowDimensionRatio(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    variableC: SolverVariable!,
    variableD: SolverVariable!,
    ratio: Float
)

Create a constraint to express A = B + (C - D) * ratio We use this for ratio, where for example Right = Left + (Bottom - Top) * percent

ArrayRow!
createRowEqualDimension(
    currentWeight: Float,
    totalWeights: Float,
    nextWeight: Float,
    variableStartA: SolverVariable!,
    marginStartA: Int,
    variableEndA: SolverVariable!,
    marginEndA: Int,
    variableStartB: SolverVariable!,
    marginStartB: Int,
    variableEndB: SolverVariable!,
    marginEndB: Int
)
ArrayRow!
createRowEqualMatchDimensions(
    currentWeight: Float,
    totalWeights: Float,
    nextWeight: Float,
    variableStartA: SolverVariable!,
    variableEndA: SolverVariable!,
    variableStartB: SolverVariable!,
    variableEndB: SolverVariable!
)
ArrayRow!
createRowEquals(variable: SolverVariable!, value: Int)
ArrayRow!
createRowEquals(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    margin: Int
)
ArrayRow!
ArrayRow!
createRowGreaterThan(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    slack: SolverVariable!,
    margin: Int
)
ArrayRow!
createRowLowerThan(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    slack: SolverVariable!,
    margin: Int
)
ArrayRow!
createRowWithAngle(
    at: SolverVariable!,
    ab: SolverVariable!,
    bt: SolverVariable!,
    bb: SolverVariable!,
    angleComponent: Float
)

Create a constraint to express At + (Ab-At)/2 = Bt + (Bb-Bt)/2 - angle

SolverVariable!
SolverVariable!
Unit

Used to initiate a goal from a given row (to see if we can remove an extra var)

Boolean
SolverVariable!
Unit
String!
Unit
updateFromFinalVariable(
    system: LinearSystem!,
    variable: SolverVariable!,
    removeFromDefinition: Boolean
)
Unit
updateFromRow(
    system: LinearSystem!,
    definition: ArrayRow!,
    removeFromDefinition: Boolean
)
Unit
updateFromSynonymVariable(
    system: LinearSystem!,
    variable: SolverVariable!,
    removeFromDefinition: Boolean
)
Unit

Public constructors

ArrayRow

Added in 1.1.0
ArrayRow()

ArrayRow

Added in 1.1.0
ArrayRow(cache: Cache!)

Public functions

addError

Added in 1.1.0
fun addError(error: SolverVariable!): Unit

addError

Added in 1.1.0
fun addError(system: LinearSystem!, strength: Int): ArrayRow!

clear

Added in 1.1.0
fun clear(): Unit

createRowDimensionRatio

Added in 1.1.0
fun createRowDimensionRatio(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    variableC: SolverVariable!,
    variableD: SolverVariable!,
    ratio: Float
): ArrayRow!

Create a constraint to express A = B + (C - D) * ratio We use this for ratio, where for example Right = Left + (Bottom - Top) * percent

Parameters
variableA: SolverVariable!

variable A

variableB: SolverVariable!

variable B

variableC: SolverVariable!

variable C

variableD: SolverVariable!

variable D

ratio: Float

ratio between AB and CD

Returns
ArrayRow!

the row

createRowEqualDimension

Added in 1.1.0
fun createRowEqualDimension(
    currentWeight: Float,
    totalWeights: Float,
    nextWeight: Float,
    variableStartA: SolverVariable!,
    marginStartA: Int,
    variableEndA: SolverVariable!,
    marginEndA: Int,
    variableStartB: SolverVariable!,
    marginStartB: Int,
    variableEndB: SolverVariable!,
    marginEndB: Int
): ArrayRow!

createRowEqualMatchDimensions

Added in 1.1.0
fun createRowEqualMatchDimensions(
    currentWeight: Float,
    totalWeights: Float,
    nextWeight: Float,
    variableStartA: SolverVariable!,
    variableEndA: SolverVariable!,
    variableStartB: SolverVariable!,
    variableEndB: SolverVariable!
): ArrayRow!

createRowEquals

Added in 1.1.0
fun createRowEquals(variable: SolverVariable!, value: Int): ArrayRow!

createRowEquals

Added in 1.1.0
fun createRowEquals(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    margin: Int
): ArrayRow!

createRowGreaterThan

Added in 1.1.0
fun createRowGreaterThan(a: SolverVariable!, b: Int, slack: SolverVariable!): ArrayRow!

createRowGreaterThan

Added in 1.1.0
fun createRowGreaterThan(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    slack: SolverVariable!,
    margin: Int
): ArrayRow!

createRowLowerThan

Added in 1.1.0
fun createRowLowerThan(
    variableA: SolverVariable!,
    variableB: SolverVariable!,
    slack: SolverVariable!,
    margin: Int
): ArrayRow!

createRowWithAngle

Added in 1.1.0
fun createRowWithAngle(
    at: SolverVariable!,
    ab: SolverVariable!,
    bt: SolverVariable!,
    bb: SolverVariable!,
    angleComponent: Float
): ArrayRow!

Create a constraint to express At + (Ab-At)/2 = Bt + (Bb-Bt)/2 - angle

getKey

Added in 1.1.0
fun getKey(): SolverVariable!

getPivotCandidate

Added in 1.1.0
fun getPivotCandidate(system: LinearSystem!, avoid: BooleanArray!): SolverVariable!

initFromRow

Added in 1.1.0
fun initFromRow(row: LinearSystem.Row!): Unit

Used to initiate a goal from a given row (to see if we can remove an extra var)

isEmpty

Added in 1.1.0
fun isEmpty(): Boolean

pickPivot

Added in 1.1.0
fun pickPivot(exclude: SolverVariable!): SolverVariable!

reset

Added in 1.1.0
fun reset(): Unit

toString

fun toString(): String!

updateFromFinalVariable

Added in 1.1.0
fun updateFromFinalVariable(
    system: LinearSystem!,
    variable: SolverVariable!,
    removeFromDefinition: Boolean
): Unit

updateFromRow

Added in 1.1.0
fun updateFromRow(
    system: LinearSystem!,
    definition: ArrayRow!,
    removeFromDefinition: Boolean
): Unit

updateFromSynonymVariable

Added in 1.1.0
fun updateFromSynonymVariable(
    system: LinearSystem!,
    variable: SolverVariable!,
    removeFromDefinition: Boolean
): Unit

updateFromSystem

Added in 1.1.0
fun updateFromSystem(system: LinearSystem!): Unit

Public properties

variables

Added in 1.1.0
val variablesArrayRow.ArrayRowVariables!