public class Utils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
fullGc()
performs a full garbage collection.
|
static double |
getMax(PrefixSum pSum)
max item of the prefix summed array.
|
static double |
getMin(PrefixSum pSum)
min item of the prefix summed array.
|
static PrefixSum |
getRandomOrdering(PrefixSum origPSum,
int seed)
returns a prefix-summed random ordering of the given prefix summed chain.
|
static PrefixSum |
getRandomProcessors(int p)
The default random processor chain factory.
|
static PrefixSum |
getRandomProcessors(int p,
int seed,
int range)
Returns random processors.
|
static PrefixSum |
getRandomProcessorsDouble(int p,
int seed,
int range)
Returns random processors.
|
static PrefixSum |
getRandomProcessorsNormal(int p,
int seed,
double mean,
double deviation)
Returns random processors.
|
static PrefixSum |
getRandomProcessorsNormalSquare(int p,
int seed,
double mean,
double deviation)
Returns random processors.
|
static PrefixSum |
getRandomProcessorsOrdered(int p,
int seed,
int range)
Returns random processors.
|
static RunningStatistics |
getStatistics(PrefixSum sequence)
calculates and returns the statistics based on the sequence.
|
static PrefixSum |
getUniformProcessors(int p)
Returns a prefix summed processor speed array, with all processor speeds are 1.
|
static PrefixSum |
prefixSum(double[] array)
calculates the prefix sum of the array.
|
static PrefixSum |
prefixSum(double[] array,
boolean clone)
calculates the prefix sum of the array.
|
static double[] |
readArray(java.lang.String fileName)
Reads the contents of the task array from a w-formatted file.
|
public static PrefixSum prefixSum(double[] array)
array
- the core array.public static PrefixSum prefixSum(double[] array, boolean clone)
array
- the core array.clone
- whether the array should be cloned, or the array can be used for the prefix sum.public static double[] readArray(java.lang.String fileName) throws java.io.IOException
fileName
- the filename to be read.java.io.IOException
- if some exception occurs while reading.public static PrefixSum getUniformProcessors(int p)
p
- the number of processors.public static PrefixSum getRandomProcessors(int p, int seed, int range)
p
- the number of processors.seed
- the seed.range
- the range.public static PrefixSum getRandomProcessorsOrdered(int p, int seed, int range)
p
- the number of processors.seed
- the seed.range
- the range.public static PrefixSum getRandomProcessorsDouble(int p, int seed, int range)
p
- the number of processors.seed
- the seed.range
- the range.public static PrefixSum getRandomProcessorsNormal(int p, int seed, double mean, double deviation)
p
- the number of processors.seed
- the seed.mean
- the mean.deviation
- the standard deviation.public static PrefixSum getRandomProcessorsNormalSquare(int p, int seed, double mean, double deviation)
p
- the number of processors.seed
- the seed.mean
- the mean.deviation
- the standard deviation.public static void fullGc()
public static PrefixSum getRandomProcessors(int p)
p
- the number of processors.public static PrefixSum getRandomOrdering(PrefixSum origPSum, int seed)
origPSum
- original prefix sum.seed
- seed.public static double getMax(PrefixSum pSum)
pSum
- the prefix summed array.public static double getMin(PrefixSum pSum)
pSum
- the prefix summed array.public static RunningStatistics getStatistics(PrefixSum sequence)
sequence
- the sequence to be investigated.