Class GRPreFactor

java.lang.Object
  |
  +--GRFactor
        |
        +--GRPreFactor
All Implemented Interfaces:
java.lang.Cloneable

public class GRPreFactor
extends GRFactor

Class representing a factor (-1)^exp*(2*f_0+1)^(exp_0/2)+...+(2*f_k+1)^(exp_k/2) with exp a lineair combination of labels with positive, integer coefficients, f_0...f_k labels and exp_0..exp_k integer powers.

Author:
Dries.VanDyck@rug.ac.be
See Also:
GenRecoupCoeff, Edge, GRFactor, GRVisitor

Constructor Summary
GRPreFactor()
          Constructs a new GRPreFactor.
GRPreFactor(int nroflabels)
          Constructs a GRPreFactor with nroflabels expected total number of labels
GRPreFactor(int nroflabels, int factor, java.lang.String j)
          Constructs a new GRPreFactor representing (-1)^(factor*j) with nroflabels expected number of labels.
GRPreFactor(int nroflabels, int factor, java.lang.String j, java.lang.String a, int exp)
          Constructs a new GRPreFactor representing (-1)^(factor*j)*(2*a+1)^(exp/2) with nroflabels expected number of labels.
GRPreFactor(int factor, java.lang.String j)
          Constructs a new GRPreFactor representing (-1)^(factor*j).
GRPreFactor(int nroflabels, java.lang.String[] j)
          Constructs a new GRPreFactor representing (-1)^(j[0]+..+j[j.length-1]) with nroflabels expected number of labels..
GRPreFactor(int nroflabels, java.lang.String[] a, int exp)
          Constructs a new GRPreFactor representing ((2*a[0]+1)* ...
GRPreFactor(int nroflabels, java.lang.String[] a, int[] exp)
          Constructs a new GRPreFactor representing (2*a[0]+1)^exp[0]* ...
GRPreFactor(int nroflabels, java.lang.String a, int exp)
          Constructs a new GRPreFactor representing (2*a+1)^(exp/2) with nroflabels expected number of labels.
GRPreFactor(java.lang.String[] j)
          Constructs a new GRPreFactor representing (-1)^(j[0]+..+j[j.length-1]).
GRPreFactor(java.lang.String[] a, int exp)
          Constructs a new GRPreFactor representing ((2*a[0]+1)* ...
GRPreFactor(java.lang.String[] a, int[] exp)
          Constructs a new GRPreFactor representing (2*a[0]+1)^(exp[0]/2)* ...
GRPreFactor(java.lang.String a, int exp)
          Constructs a new GRPreFactor representing (2*a+1)^(exp/2).
 
Method Summary
 void accept(GRVisitor v)
          Implementation of the Visitor pattern.
 void append(GRPreFactor gpf)
          Appends the GRPreFactor object gpf to this GRPreFactor.
 void appendExp(int factor, java.lang.String j)
          Appends a factor (-1)^(factor*j) to this GRPreFactor.
 void appendExp(int factor, java.lang.String[] j)
          Appends a factor (-1)^(factor*j[0]+...+factor*j[j.length-1]) to this GRPreFactor.
 void appendExp(java.lang.String[] j)
          Appends a factor (-1)^(j[0]+..+j[j.length-1]) to this GRPreFactor.
 void appendFactor(java.lang.String a)
          Appends a factor (2*a+1) to this GRPreFactor.
 void appendFactor(java.lang.String[] a)
          Appends a factor (2*a[0]+1)* ...
 void appendFactor(java.lang.String[] a, int exp)
          Appends a factor ((2*a[0]+1)* ...
 void appendFactor(java.lang.String[] a, int[] exp)
          Appends a factor (2*a[0]+1)^(exp[0]/2)* ...
 void appendFactor(java.lang.String a, int exp)
          Appends a factor (2*a+1)^(exp/2) to this GRPreFactor.
 java.lang.Object clone()
          Returns a clone of this object, immutable objects are not cloned.
 boolean containsLabel(java.lang.String label)
          True if this GRPreFactor contains this label, false otherwise.
 boolean empty()
          Returns true if this GRPreFactor represents 1, i.e.
 java.util.Iterator expCoeffs()
          Returns an Iterator of the coeffs in the exponent of (-1).
 boolean expEmpty()
          Returns true if this GRPreFactor represents (-1)^0*factors.
 java.util.Iterator expLabels()
          Returns an Iterator over the labels in the exponent of (-1).
 int expSize()
          Returns the number of labels present in the exponent of (-1).
 boolean factorsEmpty()
          Returns true if this GRPreFactor represents (-1)^exp*1.
 java.util.Iterator factorsExps()
          Returns an Iterator over the exponents in the factors (2*label+1)^(exp/2).
 java.util.Iterator factorsLabels()
          Returns an Iterator of the labels in the factors (2*label+1)^(exp/2).
 int factorsSize()
          Returns the number of factors in the product.
 java.lang.String toString()
          A String representation of this GRPreFactor.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GRPreFactor

public GRPreFactor()
Constructs a new GRPreFactor.


GRPreFactor

public GRPreFactor(int nroflabels)
Constructs a GRPreFactor with nroflabels expected total number of labels

Parameters:
nroflabels - the expected number of labels.

GRPreFactor

public GRPreFactor(java.lang.String[] j)
Constructs a new GRPreFactor representing (-1)^(j[0]+..+j[j.length-1]).

Parameters:
j - array of labels of the exponent of the phase factor

GRPreFactor

public GRPreFactor(int factor,
                   java.lang.String j)
Constructs a new GRPreFactor representing (-1)^(factor*j).

Parameters:
factor - the factor of the specified label
j - the label of the exponent of the phase factor

GRPreFactor

public GRPreFactor(int nroflabels,
                   java.lang.String[] j)
Constructs a new GRPreFactor representing (-1)^(j[0]+..+j[j.length-1]) with nroflabels expected number of labels..

Parameters:
nroflabels - the expected number of labels
j - array of labels of the exponent of the phase factor

GRPreFactor

public GRPreFactor(int nroflabels,
                   int factor,
                   java.lang.String j)
Constructs a new GRPreFactor representing (-1)^(factor*j) with nroflabels expected number of labels.

Parameters:
nroflabels - the expected number of labels
factor - the factor of the specified label
j - the label of the exponent of the phase factor

GRPreFactor

public GRPreFactor(java.lang.String a,
                   int exp)
Constructs a new GRPreFactor representing (2*a+1)^(exp/2).

Parameters:
a - label of the weight
exp - 2*exponent of the weight

GRPreFactor

public GRPreFactor(int nroflabels,
                   java.lang.String a,
                   int exp)
Constructs a new GRPreFactor representing (2*a+1)^(exp/2) with nroflabels expected number of labels.

Parameters:
nroflabels - the expected number of labels
a - label of the weight
exp - 2*exponent of the weight

GRPreFactor

public GRPreFactor(java.lang.String[] a,
                   int exp)
Constructs a new GRPreFactor representing ((2*a[0]+1)* ... * (2a[a.length-1]+1))^(exp/2).

Parameters:
a - array of labels of the weights
exp - 2*exponent of the weights

GRPreFactor

public GRPreFactor(int nroflabels,
                   java.lang.String[] a,
                   int exp)
Constructs a new GRPreFactor representing ((2*a[0]+1)* ... * (2a[a.length-1]+1))^(exp/2) with nroflabels expected number of labels.

Parameters:
nroflabels - the expected number of labels
a - arrary of labels of the weights
exp - 2*exponent of the weights

GRPreFactor

public GRPreFactor(java.lang.String[] a,
                   int[] exp)
Constructs a new GRPreFactor representing (2*a[0]+1)^(exp[0]/2)* ... * (2a[a.length-1]+1)^(exp[a,length-1]/2).

Parameters:
a - array of labels of the weights
exp - array of 2*exponents of the weights

GRPreFactor

public GRPreFactor(int nroflabels,
                   java.lang.String[] a,
                   int[] exp)
Constructs a new GRPreFactor representing (2*a[0]+1)^exp[0]* ... * (2a[a.length-1]+1))^(exp[a.length-1]/2) with nroflabels expected number of labels.

Parameters:
nroflabels - the expected number of labels
a - array of labels of the weights
exp - array of 2*exponents of the weights

GRPreFactor

public GRPreFactor(int nroflabels,
                   int factor,
                   java.lang.String j,
                   java.lang.String a,
                   int exp)
Constructs a new GRPreFactor representing (-1)^(factor*j)*(2*a+1)^(exp/2) with nroflabels expected number of labels.

Parameters:
nroflabels - the expected number of labels
factor - factor of the label of the exponent of the phase factor
j - label of the exponent of the phase factor
a - label of the weight
exp - 2*exponent of the weight
Method Detail

containsLabel

public boolean containsLabel(java.lang.String label)
True if this GRPreFactor contains this label, false otherwise.

Specified by:
containsLabel in class GRFactor
Parameters:
label - the label to be checked
Returns:
true if the label appears in this GRPreFactor, false otherwise

appendExp

public void appendExp(java.lang.String[] j)
Appends a factor (-1)^(j[0]+..+j[j.length-1]) to this GRPreFactor.

Parameters:
j - array of labels to be appended to the exponent of the phase factor

appendExp

public void appendExp(int factor,
                      java.lang.String j)
Appends a factor (-1)^(factor*j) to this GRPreFactor.

Parameters:
factor - the factor of the label to be appended to the exponent of the phase factor
j - label to be appended to the exponent of the phase factor

appendExp

public void appendExp(int factor,
                      java.lang.String[] j)
Appends a factor (-1)^(factor*j[0]+...+factor*j[j.length-1]) to this GRPreFactor.

Parameters:
factor - the factor of the labels to be appended to the exponent of the phase factors
j - array of labels to be appended to the exponent of the phase factor

append

public void append(GRPreFactor gpf)
Appends the GRPreFactor object gpf to this GRPreFactor.

Parameters:
gpf - the GRPreFactor to be appended

expEmpty

public boolean expEmpty()
Returns true if this GRPreFactor represents (-1)^0*factors.

Returns:
true, if the phase factor equals 1, false otherwise

expSize

public int expSize()
Returns the number of labels present in the exponent of (-1).

Returns:
the number of labels in the exponent of (-1)

appendFactor

public void appendFactor(java.lang.String a,
                         int exp)
Appends a factor (2*a+1)^(exp/2) to this GRPreFactor.

Parameters:
a - the label of the weight to be appended
exp - 2*exponent of the weight to be appended

appendFactor

public void appendFactor(java.lang.String a)
Appends a factor (2*a+1) to this GRPreFactor.

Parameters:
a - the label of the weight to be appended

appendFactor

public void appendFactor(java.lang.String[] a,
                         int exp)
Appends a factor ((2*a[0]+1)* ... * (2a[a.length-1]+1))^(exp/2) to this GRPreFactor.

Parameters:
a - array of labels of the weights to be appended
exp - 2*exponent of the weights to be appended

appendFactor

public void appendFactor(java.lang.String[] a,
                         int[] exp)
Appends a factor (2*a[0]+1)^(exp[0]/2)* ... * (2a[a.length-1]+1)^(exp[a.length-1]/2) to this GRPreFactor.

Parameters:
a - array of labels of the weights to be appended
exp - array of 2*exponents of the weights to be appended

appendFactor

public void appendFactor(java.lang.String[] a)
Appends a factor (2*a[0]+1)* ... * (2a[a.length-1]+1) to this GRPreFactor.

Parameters:
a - array of labels of the weights to be appended

factorsEmpty

public boolean factorsEmpty()
Returns true if this GRPreFactor represents (-1)^exp*1.

Returns:
true if the weights equals 1, false otherwise

factorsSize

public int factorsSize()
Returns the number of factors in the product.

Returns:
the number of factors in the product

empty

public boolean empty()
Returns true if this GRPreFactor represents 1, i.e. (-1)^0*1.

Returns:
true if this GRPreFactor equals 1, false otherwise

expLabels

public java.util.Iterator expLabels()
Returns an Iterator over the labels in the exponent of (-1). To be used in collaboration with expCoeffs().

Returns:
an Iterator over the labels of the exponent of the phase factor
See Also:
expCoeffs()

expCoeffs

public java.util.Iterator expCoeffs()
Returns an Iterator of the coeffs in the exponent of (-1). To be used in collaboration with expLabels().

Returns:
an Iterator over the coefficients of the labels of the exponent of the phase factor
See Also:
expLabels()

factorsLabels

public java.util.Iterator factorsLabels()
Returns an Iterator of the labels in the factors (2*label+1)^(exp/2). To be used in collaboration with factorsExps().

Returns:
an Iterator over the labels of the weights
See Also:
factorsExps()

factorsExps

public java.util.Iterator factorsExps()
Returns an Iterator over the exponents in the factors (2*label+1)^(exp/2). To be used in collaboration with factorsLabels().

Returns:
an Iterator over the exponents of the weights
See Also:
factorsLabels()

toString

public java.lang.String toString()
A String representation of this GRPreFactor.

Specified by:
toString in class GRFactor
Returns:
a String representation of this GRPreFactor

clone

public java.lang.Object clone()
Returns a clone of this object, immutable objects are not cloned.

Overrides:
clone in class GRFactor
Returns:
a clone of this GRPreFactor.

accept

public void accept(GRVisitor v)
Implementation of the Visitor pattern.

Specified by:
accept in class GRFactor
Parameters:
v - the GRVisitor to be accepted
See Also:
GRVisitor