public class LinearSystem
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static long |
ARRAY_ROW_CREATION |
static boolean |
DEBUG |
static boolean |
FULL_DEBUG |
boolean |
graphOptimizer |
boolean |
hasSimpleDefinition |
static boolean |
MEASURE |
boolean |
newgraphOptimizer |
static long |
OPTIMIZED_ARRAY_ROW_CREATION |
static boolean |
OPTIMIZED_ENGINE |
static boolean |
SIMPLIFY_SYNONYMS |
static boolean |
SKIP_COLUMNS |
static Metrics |
sMetrics |
static boolean |
USE_BASIC_SYNONYMS |
static boolean |
USE_DEPENDENCY_ORDERING |
static boolean |
USE_SYNONYMS |
| Constructor and Description |
|---|
LinearSystem() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCentering(SolverVariable a,
SolverVariable b,
int m1,
float bias,
SolverVariable c,
SolverVariable d,
int m2,
int strength)
Add an equation of the form (1 - bias) * (a - b) = bias * (c - d)
|
void |
addCenterPoint(ConstraintWidget widget,
ConstraintWidget target,
float angle,
int radius)
Add the equations constraining a widget center to another widget center, positioned
on a circle, following an angle and radius
|
void |
addConstraint(ArrayRow row)
Add the equation to the system
|
void |
addEquality(SolverVariable a,
int value)
Add an equation of the form a = value
|
ArrayRow |
addEquality(SolverVariable a,
SolverVariable b,
int margin,
int strength)
Add an equation of the form a = b + margin
|
void |
addGreaterBarrier(SolverVariable a,
SolverVariable b,
int margin,
boolean hasMatchConstraintWidgets) |
void |
addGreaterThan(SolverVariable a,
SolverVariable b,
int margin,
int strength)
Add an equation of the form a >= b + margin
|
void |
addLowerBarrier(SolverVariable a,
SolverVariable b,
int margin,
boolean hasMatchConstraintWidgets) |
void |
addLowerThan(SolverVariable a,
SolverVariable b,
int margin,
int strength)
Add an equation of the form a <= b + margin
|
void |
addRatio(SolverVariable a,
SolverVariable b,
SolverVariable c,
SolverVariable d,
float ratio,
int strength) |
void |
addSynonym(SolverVariable a,
SolverVariable b,
int margin) |
SolverVariable |
createErrorVariable(int strength,
java.lang.String prefix) |
SolverVariable |
createExtraVariable() |
SolverVariable |
createObjectVariable(java.lang.Object anchor) |
ArrayRow |
createRow() |
static ArrayRow |
createRowDimensionPercent(LinearSystem linearSystem,
SolverVariable variableA,
SolverVariable variableC,
float percent)
Create a constraint to express A = C * percent
|
SolverVariable |
createSlackVariable() |
void |
displayReadableRows() |
void |
displayVariablesReadableRows() |
void |
fillMetrics(Metrics metrics) |
Cache |
getCache() |
int |
getMemoryUsed() |
static Metrics |
getMetrics() |
int |
getNumEquations() |
int |
getNumVariables() |
int |
getObjectVariableValue(java.lang.Object object) |
void |
minimize()
Minimize the current goal of the system.
|
void |
removeRow(ArrayRow row) |
void |
reset()
Reset the LinearSystem object so that it can be reused.
|
public static final boolean FULL_DEBUG
public static final boolean DEBUG
public static final boolean MEASURE
public static boolean USE_DEPENDENCY_ORDERING
public static boolean USE_BASIC_SYNONYMS
public static boolean SIMPLIFY_SYNONYMS
public static boolean USE_SYNONYMS
public static boolean SKIP_COLUMNS
public static boolean OPTIMIZED_ENGINE
public boolean hasSimpleDefinition
public boolean graphOptimizer
public boolean newgraphOptimizer
public static Metrics sMetrics
public static long ARRAY_ROW_CREATION
public static long OPTIMIZED_ARRAY_ROW_CREATION
public void fillMetrics(Metrics metrics)
public static Metrics getMetrics()
public void reset()
public SolverVariable createObjectVariable(java.lang.Object anchor)
public ArrayRow createRow()
public SolverVariable createSlackVariable()
public SolverVariable createExtraVariable()
public SolverVariable createErrorVariable(int strength, java.lang.String prefix)
public int getObjectVariableValue(java.lang.Object object)
public void minimize()
throws java.lang.Exception
java.lang.Exceptionpublic void addConstraint(ArrayRow row)
row - the equation we want to add expressed as a system row.public void removeRow(ArrayRow row)
public void displayReadableRows()
public void displayVariablesReadableRows()
public int getMemoryUsed()
public int getNumEquations()
public int getNumVariables()
public Cache getCache()
public void addGreaterThan(SolverVariable a, SolverVariable b, int margin, int strength)
a - variable ab - variable bmargin - marginstrength - strength usedpublic void addGreaterBarrier(SolverVariable a, SolverVariable b, int margin, boolean hasMatchConstraintWidgets)
public void addLowerThan(SolverVariable a, SolverVariable b, int margin, int strength)
a - variable ab - variable bmargin - marginstrength - strength usedpublic void addLowerBarrier(SolverVariable a, SolverVariable b, int margin, boolean hasMatchConstraintWidgets)
public void addCentering(SolverVariable a, SolverVariable b, int m1, float bias, SolverVariable c, SolverVariable d, int m2, int strength)
a - variable ab - variable bm1 - margin 1bias - bias between ab - cdc - variable cd - variable dm2 - margin 2strength - strength usedpublic void addRatio(SolverVariable a, SolverVariable b, SolverVariable c, SolverVariable d, float ratio, int strength)
public void addSynonym(SolverVariable a, SolverVariable b, int margin)
public ArrayRow addEquality(SolverVariable a, SolverVariable b, int margin, int strength)
a - variable ab - variable bmargin - margin usedstrength - strength usedpublic void addEquality(SolverVariable a, int value)
a - variable avalue - the value we setpublic static ArrayRow createRowDimensionPercent(LinearSystem linearSystem, SolverVariable variableA, SolverVariable variableC, float percent)
linearSystem - the system we create the row onvariableA - variable avariableC - variable cpercent - the percent usedpublic void addCenterPoint(ConstraintWidget widget, ConstraintWidget target, float angle, int radius)
widget - target - angle - from 0 to 360radius - the distance between the two centers