Top Description Fields Constructors Methods
org.apache.commons.math3.util

public Class CentralPivotingStrategy

extends Object
implements PivotingStrategyInterface, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, org.apache.commons.math3.util.PivotingStrategyInterface
Imports
java.io.Serializable, org.apache.commons.math3.exception.MathIllegalArgumentException

A mid point strategy based on the average of begin and end indices.
Since
3.4

Field Summary

Modifier and TypeField and Description
private static final long
serialVersionUID

Serializable UID.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

The index corresponding to a simple average of the first and the last element indices of the array slice
pivotIndex
(final double[]
data array
work
,
final int
index of the first element of the slice
begin
,
final int
index after the last element of the slice
end
)

Implements org.apache.commons.math3.util.PivotingStrategyInterface.pivotIndex.

Find pivot index of the array so that partition and Kth element selection can be made This in particular picks a average of begin and end indices

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Serializable UID.

Constructor Detail

CentralPivotingStrategyback to summary
public CentralPivotingStrategy()

Method Detail

pivotIndexback to summary
public int pivotIndex(final double[] work, final int begin, final int end) throws MathIllegalArgumentException

Implements org.apache.commons.math3.util.PivotingStrategyInterface.pivotIndex.

Doc from org.apache.commons.math3.util.PivotingStrategyInterface.pivotIndex.

Find pivot index of the array so that partition and Kth element selection can be made This in particular picks a average of begin and end indices

Parameters
work:double[]

data array

begin:int

index of the first element of the slice

end:int

index after the last element of the slice

Returns:int

The index corresponding to a simple average of the first and the last element indices of the array slice

Exceptions
MathIllegalArgumentException:
when indices exceeds range