public interface PrefixSum
Modifier and Type | Method and Description |
---|---|
double |
get(int i)
The sum of weights up to item i, i.e., t_0 + t_1 + ...
|
double[] |
getArray()
The underlying core prefix-summed array.
|
double |
getAt(int p)
returns the actual value of the item at p.
|
double[] |
getOriginalValues()
The actual values.
|
double |
getSum()
sum of all items.
|
double |
getSum(int i,
int j)
Get a partial of the range (j, i], i.e.
|
int |
search(double v)
search for the prefix sum value.
|
int |
searchGreaterThan(double v)
returns the index of the smallest index that has a prefix sum not smaller than v.
|
int |
searchLessThan(double v)
returns the index of the largest index that has a prefix sum not larger than v.
|
int |
size()
The number of tasks.
|
int size()
double get(int i)
i
- the last task for the summation.double getSum(int i, int j)
i
- the index of the last weight to be summed.j
- the index of the task prior to the first task to be summed.double getSum()
int search(double v)
v
- the prefix sum value to be searched.int searchLessThan(double v)
v
- the prefix sum value to be searched.int searchGreaterThan(double v)
v
- the prefix sum value to be searched.double getAt(int p)
p
- the index of the desired item.double[] getArray()
double[] getOriginalValues()