Class GRCompoundFactor

java.lang.Object
  |
  +--GRCompoundFactor
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
GRSummation

public class GRCompoundFactor
extends java.lang.Object
implements java.lang.Cloneable

Class represting a product of elementary GRFactor's.

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

Constructor Summary
GRCompoundFactor()
          Constructs a new (empty) product of GRFactor's.
GRCompoundFactor(GRFactor f)
          Constructs a new product of GRFactor's with initial GRFactor f.
GRCompoundFactor(int nroffactors)
          Constructs a new (empty) product of GRFactor's with nroffactors expected number of factors.
GRCompoundFactor(int nroffactors, GRFactor f)
          Constructs a new product of GRFactor's with initial GRFactor f and nroffactors expected number of factors.
 
Method Summary
 void accept(GRVisitor v)
          Implementation of the Visitor pattern.
 void append(GRFactor grf)
          Appends the factor grf.
 void appendExp(int factor, java.lang.String j)
          Appends a factor (-1)^(factor*j) to this GRCompoundFactor.
 void appendExp(java.lang.String[] j)
          Appends a factor (-1)^(j[0] + ...
 void appendFactor(java.lang.String[] a, int exp)
          Appends a factor ((2*a[0]+1)*...*(2*a[a.length-1]+1))^(exp/2) to this GRCompoundFactor.
 void appendFactor(java.lang.String a, int exp)
          Appends a factor (2*a+1)^(exp/2) to this GRCompoundFactor.
 java.lang.Object clone()
          Returns a clone of this GRCompoundFactor object.
 boolean containsLabel(java.lang.String label)
          True if this GRCompoundFactor contains a factor with label label, false otherwise.
 java.util.Iterator factors()
          Returns an Iterator of the factors in this GRCompoundFactor object.
 java.lang.String toString()
          A String representation of this GRCompoundFactor.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GRCompoundFactor

public GRCompoundFactor()
Constructs a new (empty) product of GRFactor's.

See Also:
GRFactor

GRCompoundFactor

public GRCompoundFactor(int nroffactors)
Constructs a new (empty) product of GRFactor's with nroffactors expected number of factors.

Parameters:
nroffactors - the expected number of factors
See Also:
GRFactor

GRCompoundFactor

public GRCompoundFactor(GRFactor f)
Constructs a new product of GRFactor's with initial GRFactor f.

Parameters:
f - the intial GRFactor
See Also:
GRFactor

GRCompoundFactor

public GRCompoundFactor(int nroffactors,
                        GRFactor f)
Constructs a new product of GRFactor's with initial GRFactor f and nroffactors expected number of factors.

Parameters:
nroffactors - the expected number of factors
f - the intial GRFactor
See Also:
GRFactor
Method Detail

toString

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

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this GRCompoundFactor

clone

public java.lang.Object clone()
Returns a clone of this GRCompoundFactor object.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this GRCompoundFactor

accept

public void accept(GRVisitor v)
Implementation of the Visitor pattern. Visits first itself and than calls accept on its composites.

Parameters:
v - the GRVisitor to be accepted
See Also:
GRVisitor

appendExp

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

Parameters:
j - array of labels to be appended

appendExp

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

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

append

public void append(GRFactor grf)
Appends the factor grf.

Parameters:
grf - the GRFactor to be appended
See Also:
GRFactor

appendFactor

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

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

appendFactor

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

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

containsLabel

public boolean containsLabel(java.lang.String label)
True if this GRCompoundFactor contains a factor with label label, false otherwise.

Parameters:
label - the label to be checked
Returns:
true if the label appears in this GRCompoundFactor, false otherwise

factors

public java.util.Iterator factors()
Returns an Iterator of the factors in this GRCompoundFactor object.

Returns:
an Iterator over the GRFactors
See Also:
GRFactor