public class ActiveSet extends Object
Constructor and Description |
---|
ActiveSet(boolean sorted)
Construct a working set of active/inactive indices.
|
ActiveSet(boolean sorted,
Collection<Integer> indices)
Construct a working set of active/inactive indices.
|
ActiveSet(boolean sorted,
int[] indices)
Construct a working set of active/inactive indices.
|
Modifier and Type | Method and Description |
---|---|
int |
activeSize()
Get the number of active indices.
|
void |
addActive(Collection<Integer> indices)
Add active indices.
|
void |
addActive(int j)
Add an active constraint by index.
|
void |
addActive(int[] indices)
Add active indices.
|
void |
addInactive(Collection<Integer> indices)
Add inactive indices.
|
void |
addInactive(int j)
Add an inactive constraint by index.
|
void |
addInactive(int[] indices)
Add inactive indices.
|
boolean |
containActive(int j)
Check if the active set contains a certain index.
|
boolean |
containInactive(int j)
Check if the inactive set contains a certain index.
|
int |
getActive(int i)
Get the i-th active index.
|
int[] |
getActiveIndices()
Get all active indices.
|
int |
getInactive(int i)
Get the i-th inactive index.
|
int[] |
getInactiveIndices()
Get all inactive indices.
|
int |
inactiveSize()
Get the number of inactive indices.
|
void |
removeActive(int j)
Remove an active index.
|
void |
removeActiveByIndex(int i)
Remove an active constraint by index.
|
void |
removeInactive(int j)
Remove an inactive index.
|
void |
removeInactiveByIndex(int i)
Remove an active constraint by index.
|
String |
toString() |
public ActiveSet(boolean sorted)
sorted
- indicator of whether the indices are sortedpublic ActiveSet(boolean sorted, Collection<Integer> indices)
sorted
- indicator of whether the indices are sortedindices
- the active indicespublic ActiveSet(boolean sorted, int[] indices)
sorted
- indicator of whether the indices are sortedindices
- the active indicespublic void addActive(Collection<Integer> indices)
indices
- a collection of active constraint indicespublic void addActive(int[] indices)
indices
- an array of active constraint indicespublic void addInactive(Collection<Integer> indices)
indices
- a collection of inactive constraint indicespublic void addInactive(int[] indices)
indices
- an array of inactive constraint indicespublic void addActive(int j)
j
- an index of an active constraintpublic void addInactive(int j)
j
- an index of an inactive constraintpublic void removeActive(int j)
j
- an active index to be removed.public void removeInactive(int j)
j
- an inactive index to be removed.public void removeActiveByIndex(int i)
i
- an active index, counting from 1public void removeInactiveByIndex(int i)
i
- an inactive index, counting from 1public int activeSize()
public int inactiveSize()
public boolean containActive(int j)
j
- an index of an active constrainttrue
if the active set contains j
public boolean containInactive(int j)
j
- an index of an inactive constrainttrue
if the inactive set contains j
public int[] getActiveIndices()
public int[] getInactiveIndices()
public int getActive(int i)
i
- an index.public int getInactive(int i)
i
- an index, counting from 1Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.