Package org.ojalgo.type
Class IndexSelector
- java.lang.Object
-
- org.ojalgo.type.IndexSelector
-
public final class IndexSelector extends java.lang.Object
An array of int:s (indices) that are partitioned to be either "included" or "excluded". If you need more than 2 different states thenEnumPartition
is an alternative.- See Also:
EnumPartition
-
-
Field Summary
Fields Modifier and Type Field Description private int[]
myExcluded
private int
myExcludedLength
private int[]
myIncluded
private int
myIncludedLength
private int
myLastExcluded
private int
myLastIncluded
private boolean[]
mySelector
-
Constructor Summary
Constructors Modifier Constructor Description private
IndexSelector()
IndexSelector(int count)
IndexSelector(int count, int[] initiallyIncludedIndeces)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countExcluded()
int
countIncluded()
void
exclude(int indexToExclude)
void
exclude(int... indecesToExclude)
void
excludeAll()
int[]
getExcluded()
int[]
getIncluded()
int
getLastExcluded()
int
getLastIncluded()
void
grow()
Randomly include 1 of the currently excludedvoid
include(int indexToInclude)
void
include(int... indecesToInclude)
void
includeAll()
boolean
isExcluded(int index)
boolean
isIncluded(int index)
boolean
isLastExcluded()
Is the last excluded index still excluded, or has it been included by a later operation?boolean
isLastIncluded()
Is the last included index still included, or has it been excluded by a later operation?void
pivot(int indexToExclude, int indexToInclude)
void
revertLastExclusion()
void
revertLastInclusion()
void
shrink()
Randomly exclude 1 of the currently includedvoid
shuffle()
Randomly exclude 1 of the currently included and include 1 of the excludedint
size()
java.lang.String
toString()
-
-
-
Field Detail
-
myExcluded
private transient int[] myExcluded
-
myExcludedLength
private int myExcludedLength
-
myIncluded
private transient int[] myIncluded
-
myIncludedLength
private int myIncludedLength
-
myLastExcluded
private int myLastExcluded
-
myLastIncluded
private int myLastIncluded
-
mySelector
private final boolean[] mySelector
-
-
Method Detail
-
countExcluded
public int countExcluded()
-
countIncluded
public int countIncluded()
-
exclude
public void exclude(int indexToExclude)
-
exclude
public void exclude(int... indecesToExclude)
-
excludeAll
public void excludeAll()
-
getExcluded
public int[] getExcluded()
-
getIncluded
public int[] getIncluded()
-
getLastExcluded
public int getLastExcluded()
-
getLastIncluded
public int getLastIncluded()
-
grow
public void grow()
Randomly include 1 of the currently excluded
-
include
public void include(int indexToInclude)
-
include
public void include(int... indecesToInclude)
-
includeAll
public void includeAll()
-
isExcluded
public boolean isExcluded(int index)
-
isIncluded
public boolean isIncluded(int index)
-
isLastExcluded
public boolean isLastExcluded()
Is the last excluded index still excluded, or has it been included by a later operation?
-
isLastIncluded
public boolean isLastIncluded()
Is the last included index still included, or has it been excluded by a later operation?
-
pivot
public void pivot(int indexToExclude, int indexToInclude)
-
revertLastExclusion
public void revertLastExclusion()
-
revertLastInclusion
public void revertLastInclusion()
-
shrink
public void shrink()
Randomly exclude 1 of the currently included
-
shuffle
public void shuffle()
Randomly exclude 1 of the currently included and include 1 of the excluded
-
size
public int size()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-