SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | List of all members
DoubleArrayComparator Class Reference

This provides an implementation of Comparator in which arrays of double in \(d\) dimensions are compared by comparing their coordinate \(j\) in the natural order of real numbers, where \(j \in\{0,…,d-1\}\) is given in the constructor. More...

Inheritance diagram for DoubleArrayComparator:
[legend]
Collaboration diagram for DoubleArrayComparator:
[legend]

Public Member Functions

 DoubleArrayComparator (int j)
 Constructs a comparator, where j is the coordinate used for the comparisons. More...
 
int compare (double[] d1, double[] d2)
 Returns \(-1\), \(0\), or \(1\) depending on whether d1[j] is less than, equal to, or greater than d2[j]. More...
 

Detailed Description

This provides an implementation of Comparator in which arrays of double in \(d\) dimensions are compared by comparing their coordinate \(j\) in the natural order of real numbers, where \(j \in\{0,…,d-1\}\) is given in the constructor.

The method compare(d1, d2) returns \(-1\), \(0\), or \(1\) depending on whether d1[j] is less than, equal to, or greater than d2[j].

Constructor & Destructor Documentation

◆ DoubleArrayComparator()

Constructs a comparator, where j is the coordinate used for the comparisons.

Parameters
jindex used for comparison

Member Function Documentation

◆ compare()

int compare ( double []  d1,
double []  d2 
)

Returns \(-1\), \(0\), or \(1\) depending on whether d1[j] is less than, equal to, or greater than d2[j].

Parameters
d1first array
d2second array

The documentation for this class was generated from the following file: