daikon.inv.binary.twoScalar
Class LinearBinaryCoreFloat

Object
  extended by LinearBinaryCoreFloat
All Implemented Interfaces:
Serializable, Cloneable

public final class LinearBinaryCoreFloat
extends Object
implements Serializable, Cloneable

See Also:
Serialized Form

Field Summary
 double a
           
 double b
           
 double c
           
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
LinearBinaryCoreFloat(Invariant wrapper)
           
 
Method Summary
 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, 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)
           
 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()
           
 
Methods inherited from class Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final Logger debug
Debug tracer.


a

public double a

b

public double b

c

public double c

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

wrapper

public Invariant wrapper

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

public LinearBinaryCoreFloat clone()
Overrides:
clone in class Object

swap

public void swap()

isActive

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

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()

computeConfidence

public double computeConfidence()

repr

public String repr()

formatTerm

public static String formatTerm(double coeff,
                                String varname,
                                boolean first)

format_using

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

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 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

public boolean isSameFormula(LinearBinaryCoreFloat other)

isExclusiveFormula

public boolean isExclusiveFormula(LinearBinaryCoreFloat other)