Package daikon.inv.binary.twoScalar
Class LinearBinaryCoreFloat
- Object
-
- LinearBinaryCoreFloat
-
- All Implemented Interfaces:
Serializable
,Cloneable
public final class LinearBinaryCoreFloat extends Object implements Serializable, Cloneable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description double
a
This invariant represents ax + by + c = 0; the first argument is x, second is y.double
b
This invariant represents ax + by + c = 0; the first argument is x, second is y.double
c
This invariant represents ax + by + c = 0; the first argument is x, second is y.static Logger
debug
Debug tracer.double
max_a
double
max_b
double
max_c
double
max_x
double
max_y
double
min_a
double
min_b
double
min_c
double
min_x
double
min_y
int
values_seen
Invariant
wrapper
double[]
x_cache
double[]
y_cache
-
Constructor Summary
Constructors Constructor Description LinearBinaryCoreFloat(Invariant wrapper)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description InvariantStatus
add_modified(double x, double y, int count)
LinearBinaryCoreFloat
clone()
double
computeConfidence()
boolean
enoughSamples()
String
format_reversed_using(OutputFormat format, String xname, String yname)
static String
format_simplify(String str_x, String str_y, double a, double b, double c)
String
format_using(OutputFormat format, String xname, String yname)
String
format_using(OutputFormat format, String vix, String viy, double u, double v, double w)
static String
formatTerm(double coeff, @Nullable String varname, boolean first)
boolean
isActive()
Returns whether or not the invariant is currently active.boolean
isExclusiveFormula(LinearBinaryCoreFloat other)
boolean
isFlowable()
LinearBinary can't be flowed because it keeps samples to build the line.boolean
isSameFormula(LinearBinaryCoreFloat other)
@Nullable LinearBinaryCoreFloat
merge(List<LinearBinaryCoreFloat> cores, Invariant wrapper)
Merge the linear binary cores in cores to form a new core.boolean
mergeFormulasOk()
In general, we can't merge formulas, but we can merge invariants with too few samples to have formed a line with invariants with enough samples.String
repr()
void
swap()
-
-
-
Field Detail
-
a
public double a
This invariant represents ax + by + c = 0; the first argument is x, second is y.
-
b
public double b
This invariant represents ax + by + c = 0; the first argument is x, second is y.
-
c
public double c
This invariant represents ax + by + c = 0; the first argument is x, second is y.
-
min_x
public double min_x
-
min_y
public double min_y
-
max_x
public double max_x
-
max_y
public double max_y
-
min_a
public double min_a
-
max_a
public double max_a
-
min_b
public double min_b
-
max_b
public double max_b
-
min_c
public double min_c
-
max_c
public double max_c
-
values_seen
public int values_seen
-
x_cache
public double[] x_cache
-
y_cache
public double[] y_cache
-
-
Constructor Detail
-
LinearBinaryCoreFloat
public LinearBinaryCoreFloat(Invariant wrapper)
-
-
Method Detail
-
clone
@SideEffectFree public LinearBinaryCoreFloat clone(@GuardSatisfied LinearBinaryCoreFloat this)
-
swap
public void swap()
-
isActive
@Pure public boolean isActive()
Returns whether or not the invariant is currently active. We become active after MINPAIRS values have been seen and a line calculated. Before that, a and b are uninitialized.
-
isFlowable
@Pure public boolean isFlowable()
LinearBinary can't be flowed because it keeps samples to build the line. These sample can't be flowed from ppt to ppt (since they probably didn't occur at the lower ppt).
-
add_modified
public InvariantStatus add_modified(double x, double y, int count)
-
enoughSamples
public boolean enoughSamples(@GuardSatisfied LinearBinaryCoreFloat this)
-
computeConfidence
public double computeConfidence()
-
formatTerm
public static String formatTerm(double coeff, @Nullable String varname, boolean first)
-
format_using
@SideEffectFree public String format_using(OutputFormat format, String vix, String viy, double u, double v, double w)
-
format_simplify
public static String format_simplify(String str_x, String str_y, double a, double b, double c)
-
format_using
@SideEffectFree public String format_using(OutputFormat format, String xname, String yname)
-
format_reversed_using
public String format_reversed_using(OutputFormat format, String xname, String yname)
-
mergeFormulasOk
public boolean mergeFormulasOk()
In general, we can't merge formulas, but we can merge invariants with too few samples to have formed a line with invariants with enough samples. And those will appear to have different formulas.
-
merge
public @Nullable LinearBinaryCoreFloat merge(List<LinearBinaryCoreFloat> cores, Invariant wrapper)
Merge the linear binary cores in cores to form a new core. Any core in the list that has seen enough points to define a line, must define the same line. Any cores that have not yet seen enough points, will have each of their points applied to that invariant. The merged core is returned. Null is returned if the cores don't describe the same line- Parameters:
cores
- list of LinearBinary cores to merge. They should all be permuted to match the variable order in ppt.
-
isSameFormula
@Pure public boolean isSameFormula(LinearBinaryCoreFloat other)
-
isExclusiveFormula
@Pure public boolean isExclusiveFormula(LinearBinaryCoreFloat other)
-
-