SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
IndependentPointsCached.java
1/*
2 * Class: IndependentPointsCached
3 * Description:
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author
9 * @since
10
11 * SSJ is free software: you can redistribute it and/or modify it under
12 * the terms of the GNU General Public License (GPL) as published by the
13 * Free Software Foundation, either version 3 of the License, or
14 * any later version.
15
16 * SSJ is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20
21 * A copy of the GNU General Public License is available at
22 <a href="http://www.gnu.org/licenses">GPL licence site</a>.
23 */
24package umontreal.ssj.hups;
25
26import umontreal.ssj.rng.RandomStream;
27
36public class IndependentPointsCached extends CachedPointSet {
37
44 public IndependentPointsCached(int n, int dim) {
45 this.dim = dim;
46 numPoints = n;
47 x = new double[numPoints][dim];
48 }
49
55 public void randomize(RandomStream stream) {
56 for (int j = 0; j < dim; j++) {
57 for (int i = 0; i < numPoints; i++)
58 x[i][j] = stream.nextDouble();
59 }
60 }
61
67 public void addRandomShift(int fromDim, int toDim, RandomStream stream) {
68 randomize(stream);
69 }
70
75 public void randomize(PointSetRandomization rand) {
76 randomize(rand.getStream());
77 }
78
79 public String toString() {
80 return "IndependentPointsCached: independent points in " + dim + "dimensions.";
81 }
82}
IndependentPointsCached(int n, int dim)
Constructs the structure for n points in dim dimensions.
void addRandomShift(int fromDim, int toDim, RandomStream stream)
Random shifts and partial randomizations are irrelevant here, so this method is redefined to be equiv...
void randomize(RandomStream stream)
This randomization generates and stores independent random points.
String toString()
Formats a string that contains information about the point set.
void randomize(PointSetRandomization rand)
Generates a new set of independent points, regardless of what rand is.
int numPoints
Number of points.
int dim
Dimension of the points.
This interface is for a randomization that can be used to randomize a umontreal.ssj....
RandomStream getStream()
Returns the internal umontreal.ssj.rng.RandomStream.
This interface defines the basic structures to handle multiple streams of uniform (pseudo)random numb...
double nextDouble()
Returns a (pseudo)random number from the uniform distribution over the interval , using this stream,...