optimizer
Class DataCracker1991

java.lang.Object
  extended by optimizer.DataCracker1991

public class DataCracker1991
extends java.lang.Object

An object of DataCracker1991 will try its best to discover opportunities of partitioning the data.


Field Summary
(package private)  boolean isDecomposable
          Whether the recently processed operator is decomposable.
 java.util.HashMap<java.lang.String,java.lang.Integer> predField2varID
          The inverse map of varID2predField.
(package private)  double[] ss
          The array that saves the solution of the ILP solver.
 java.util.HashMap<java.lang.Integer,java.lang.Integer> varID2field
          Map from variable ID to predicate's field ID.
 java.util.HashMap<java.lang.Integer,FelixPredicate> varID2pred
          Map from variable ID to the predicate.
 java.util.HashMap<java.lang.Integer,java.lang.String> varID2predField
          Map from variable ID to the signature of predicate's field.
 
Constructor Summary
DataCracker1991()
           
 
Method Summary
 void decompose(StatOperator op)
          Decompose the data used by the given operator.
(package private)  int gcd(int... numbers)
          Return the GCD of the given multiple numbers.
(package private)  int gcd2(int a, int b)
          Return the GCD of the given two numbers.
 java.util.HashSet<mln.Expression> getExpressions(FelixClause fc, int base, int nThread, boolean isSignature)
          Given a clause appearing in the statOperator, return the appended expression to this clause to partition the data.
 java.lang.String toCanonicalFieldName(FelixPredicate p, int fieldNum)
          Generate the signature of predicate's field.
 java.lang.String toCanonicalFieldName(mln.Predicate p, int fieldNum)
          Generate the signature of predicate's field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

varID2predField

public java.util.HashMap<java.lang.Integer,java.lang.String> varID2predField
Map from variable ID to the signature of predicate's field. This ID is used in the ILP solver.


varID2pred

public java.util.HashMap<java.lang.Integer,FelixPredicate> varID2pred
Map from variable ID to the predicate. This ID is used in the ILP solver.


varID2field

public java.util.HashMap<java.lang.Integer,java.lang.Integer> varID2field
Map from variable ID to predicate's field ID. This ID is used in the ILP solver.


predField2varID

public java.util.HashMap<java.lang.String,java.lang.Integer> predField2varID
The inverse map of varID2predField.


ss

double[] ss
The array that saves the solution of the ILP solver.


isDecomposable

boolean isDecomposable
Whether the recently processed operator is decomposable.

Constructor Detail

DataCracker1991

public DataCracker1991()
Method Detail

toCanonicalFieldName

public java.lang.String toCanonicalFieldName(FelixPredicate p,
                                             int fieldNum)
Generate the signature of predicate's field.

Parameters:
p -
fieldNum -
Returns:

toCanonicalFieldName

public java.lang.String toCanonicalFieldName(mln.Predicate p,
                                             int fieldNum)
Generate the signature of predicate's field.

Parameters:
p -
fieldNum -
Returns:

decompose

public void decompose(StatOperator op)
Decompose the data used by the given operator.

Parameters:
op -

gcd2

int gcd2(int a,
         int b)
Return the GCD of the given two numbers.

Parameters:
a -
b -
Returns:

gcd

int gcd(int... numbers)
Return the GCD of the given multiple numbers.

Parameters:
numbers -
Returns:

getExpressions

public java.util.HashSet<mln.Expression> getExpressions(FelixClause fc,
                                                        int base,
                                                        int nThread,
                                                        boolean isSignature)
Given a clause appearing in the statOperator, return the appended expression to this clause to partition the data.

Parameters:
fc -
base - Number of partitions.
nThread - ID of the current partition.
isSignature - if this parameter is false, then it can be used as clause's constraints.
Returns: