package umontreal.iro.lecuyer.hups;

 import umontreal.iro.lecuyer.rng.RandomStream;
 import java.lang.IllegalArgumentException;


/**
 * This class implements a
 * {@link umontreal.iro.lecuyer.hups.PointSetRandomization PointSetRandomization}
 * that performs a left matrix scrambling and adds a random digital
 * shift. Point set must be a
 * {@link umontreal.iro.lecuyer.hups.DigitalNet DigitalNet} or an
 * {@link java.lang.IllegalArgumentException IllegalArgumentException} is thrown.
 * 
 */
public class LMScrambleShift extends RandomShift  {



   /**
    * Empty constructor.
    * 
    */
   public LMScrambleShift()  {
   }
   


   /**
    * Sets internal variable stream to the given
    *    stream.
    * 
    * @param stream stream to use in the randomization
    * 
    */
   public LMScrambleShift (RandomStream stream)  {
       super(stream);
   }
   


   /**
    * This method calls
    *    {@link umontreal.iro.lecuyer.hups.DigitalNet#leftMatrixScramble(RandomStream) leftMatrixScramble},
    *    then
    *    {@link umontreal.iro.lecuyer.hups.DigitalNet#addRandomShift(RandomStream) addRandomShift}.
    *    If p is not a
    *    {@link umontreal.iro.lecuyer.hups.DigitalNet DigitalNet}, an
    * {@link java.lang.IllegalArgumentException IllegalArgumentException} is thrown.
    * 
    * @param p Point set to randomize
    * 
    * 
    */
   public void randomize (PointSet p)  {
      if (p instanceof DigitalNet) {
         ((DigitalNet)p).leftMatrixScramble (stream);
         ((DigitalNet)p).addRandomShift (stream);
      } else {
         throw new IllegalArgumentException("LMScrambleShift"+
                                            " can only randomize a DigitalNet");
      }
   }
   

}

 

Ads help maintain this website.