Class IndexSelector
java.lang.Object
org.ojalgo.type.IndexSelector
An array of int:s (indices) that are partitioned to be either "included" or "excluded". If you need more
than 2 different states then
EnumPartition is an alternative.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]private intprivate int[]private intprivate intprivate intprivate final boolean[] -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateIndexSelector(int count) IndexSelector(int count, int[] initiallyIncludedIndeces) -
Method Summary
Modifier and TypeMethodDescriptionintintvoidexclude(int indexToExclude) voidexclude(int... indecesToExclude) voidint[]int[]intintvoidgrow()Randomly include 1 of the currently excludedvoidinclude(int indexToInclude) voidinclude(int... indecesToInclude) voidbooleanisExcluded(int index) booleanisIncluded(int index) booleanIs the last excluded index still excluded, or has it been included by a later operation?booleanIs the last included index still included, or has it been excluded by a later operation?voidpivot(int indexToExclude, int indexToInclude) voidAfter bulk operations, like setting up some initial state, the history of last included and excluded is probably not relevant.voidvoidvoidshrink()Randomly exclude 1 of the currently includedvoidshuffle()Randomly exclude 1 of the currently included and include 1 of the excludedintsize()toString()
-
Field Details
-
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
-
-
Constructor Details
-
IndexSelector
public IndexSelector(int count) -
IndexSelector
public IndexSelector(int count, int[] initiallyIncludedIndeces) -
IndexSelector
private IndexSelector()
-
-
Method Details
-
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) -
resetHistory
public void resetHistory()After bulk operations, like setting up some initial state, the history of last included and excluded is probably not relevant. It may be a good idea to reset it to prevent it from affecting following logic. -
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
-