SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
AntitheticPointSet.java
1/*
2 * Class: AntitheticPointSet
3 * Description:
4 * Environment: Java
5 * Software: SSJ
6 * Copyright (C) 2001--2018 Pierre L'Ecuyer and Universite de Montreal
7 * Organization: DIRO, Universite de Montreal
8 * @author
9 * @since
10 *
11 *
12 * Licensed under the Apache License, Version 2.0 (the "License");
13 * you may not use this file except in compliance with the License.
14 * You may obtain a copy of the License at
15 *
16 * http://www.apache.org/licenses/LICENSE-2.0
17 *
18 * Unless required by applicable law or agreed to in writing, software
19 * distributed under the License is distributed on an "AS IS" BASIS,
20 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 * See the License for the specific language governing permissions and
22 * limitations under the License.
23 *
24 */
25package umontreal.ssj.hups;
26
27import umontreal.ssj.util.PrintfFormat;
28
41
48 init(p);
49 }
50
51 public double getCoordinate(int i, int j) {
52 return 1.0 - P.getCoordinate(i, j);
53 }
54
56 return new AntitheticPointSetIterator();
57 }
58
59 public String toString() {
60 return "Antithetic point set of: {" + PrintfFormat.NEWLINE + P.toString() + PrintfFormat.NEWLINE + "}";
61 }
62
63 // ***************************************************************
64
66
67 public double nextCoordinate() {
68 return 1.0 - innerIterator.nextCoordinate();
69 }
70
71 public double nextDouble() {
72 return 1.0 - innerIterator.nextCoordinate();
73 }
74
75 public void nextCoordinates(double p[], int d) {
76 innerIterator.nextCoordinates(p, d);
77 for (int j = 0; j < d; j++)
78 p[j] = 1.0 - p[j];
79 }
80
81 public int nextPoint(double p[], int d) {
82 innerIterator.nextPoint(p, d);
83 for (int j = 0; j < d; j++)
84 p[j] = 1.0 - p[j];
85 return getCurPointIndex();
86 }
87
88 }
89}
int nextPoint(double p[], int d)
Same as nextPoint(p, 0, d).
AntitheticPointSet(PointSet p)
Constructs an antithetic point set from the given point set p.
PointSetIterator iterator()
Return an iterator for this ContainerPointSet.
double getCoordinate(int i, int j)
By default, returns the untransformed coordinate for the contained point set.
String toString()
Formats a string that contains information about the point set.
This acts as a generic base class for all container classes that contain a point set and apply a spec...
void init(PointSet p0)
Initializes this container point set so that it will contain the point set p0.
This abstract class represents a general point set.
Definition PointSet.java:99
static final String NEWLINE
End-of-line symbol or line separator.
This is the interface for iterators that permit one to go through the points of a PointSet and the su...