|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvec_math.Extremum
public class Extremum
Helper class to hold some type of (local) extremum in an indexed data set. Saddle points are not considered as extrema. It holds the index of the extremum, its value and the type, minima or maxima. They are comparable, which does sorting on the value of the extremum. In the very unlikely event of two extrema having the same value, their inidices are compared. Two extrema are equal, if their index, type and value agree. The hash code is the extrema index.
| Nested Class Summary | |
|---|---|
static class |
Extremum.File
Finds all maxima and minima in the quasi-conitinuous function, tabluated as an ascii-file in the first command line argument. |
static class |
Extremum.Test1
Classes that test the extrema finding method in smooth parabola. |
static class |
Extremum.Test2
Classes that test the extrema finding method in smooth parabola. |
static class |
Extremum.Test3
Classes that test the extrema finding method in smooth parabola. |
static class |
Extremum.Test4
Classes that test the extrema finding method in smooth parabola. |
static class |
Extremum.Test5
Classes that test the extrema finding method in smooth parabola. |
static class |
Extremum.Test6
Classes that test the extrema finding method in smooth parabola. |
static class |
Extremum.Test7
Classes that test the extrema finding method in smooth parabola. |
static class |
Extremum.Test8
Classes that test the extrema finding method in smooth parabola. |
| Field Summary | |
|---|---|
private int |
index
Index of the extremum, specified at construct. |
private boolean |
ismax
If true, this extremum is a maximum, otherwise its a minimum. |
private double |
value
Value of the extremum, specified at construct. |
| Constructor Summary | |
|---|---|
Extremum(int ind,
double val,
boolean max)
Constructs a new extremum, specifying all information. |
|
| Method Summary | |
|---|---|
int |
compareTo(Extremum that)
Compares two extrem, consitent with equals. |
boolean |
equals(Object that)
Two extrema are equal, if their type, value and index are identical. |
int |
getIndex()
Returns the index in the array at which the extremum was encountered. |
double |
getValue()
Returns the value of the extremum. |
int |
hashCode()
Returns the index. |
boolean |
isMaximum()
Returns true, if this extremum is a maximum. |
boolean |
isMinimum()
Returns true, if this extremum is a minimum. |
String |
toString()
Easy-readable sting. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int index
private double value
private boolean ismax
| Constructor Detail |
|---|
public Extremum(int ind,
double val,
boolean max)
| Method Detail |
|---|
public boolean isMaximum()
public boolean isMinimum()
public int getIndex()
public double getValue()
public int hashCode()
hashCode in class Objectpublic boolean equals(Object that)
equals in class Objectpublic int compareTo(Extremum that)
This is faster than first checking for different types.
compareTo in interface Comparable<Extremum>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||