|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.inria.myriads.snoozenode.util.MathUtils
public final class MathUtils
Math utility.
Field Summary | |
---|---|
static int |
RESOURCE_VECTOR_SIZE
Size of the resource vectors. |
Method Summary | |
---|---|
static ArrayList<Double> |
addVectors(List<Double> firstVector,
List<Double> secondVector)
Adds two vectors. |
static double |
computeEuclidNorm(List<Double> values)
Computes the Euclid norm. |
static double |
computeL1Norm(List<Double> values)
Computes the L1 norm. |
static double |
computeMaxNorm(List<Double> values)
Computes the Max norm. |
static ArrayList<Double> |
createCustomVector(double cpu,
double memory,
org.inria.myriads.snoozecommon.communication.virtualcluster.monitoring.NetworkDemand networkDemand)
Creates virtual machine utilization vector. |
static ArrayList<Double> |
createEmptyVector()
Creates and empty vector. |
static ArrayList<Double> |
divideVector(List<Double> vector,
int divisor)
Divides all values of a vector by a number. |
static boolean |
isCorrectDimension(List<Double> firstVector,
List<Double> secondVector)
Verifies the dimensions. |
static double |
roundDoubleValue(double value)
Rounds a double value to the first two digits. |
static ArrayList<Double> |
substractVector(List<Double> firstVector,
List<Double> secondVector)
Divides all values of a vector by a number. |
static boolean |
vectorCompareIsGreater(List<Double> firstVector,
List<Double> secondVector)
Compares two vectors. |
static boolean |
vectorCompareIsLess(List<Double> firstVector,
List<Double> secondVector)
Compares two vectors. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int RESOURCE_VECTOR_SIZE
Method Detail |
---|
public static boolean vectorCompareIsLess(List<Double> firstVector, List<Double> secondVector)
firstVector
- The first vectorsecondVector
- The second vector
public static double roundDoubleValue(double value)
value
- The original value
public static boolean vectorCompareIsGreater(List<Double> firstVector, List<Double> secondVector)
firstVector
- The first vectorsecondVector
- The second vector
public static boolean isCorrectDimension(List<Double> firstVector, List<Double> secondVector)
firstVector
- The first vectorsecondVector
- The second vector
public static ArrayList<Double> addVectors(List<Double> firstVector, List<Double> secondVector)
firstVector
- The first vectorsecondVector
- The second vector
public static ArrayList<Double> divideVector(List<Double> vector, int divisor)
vector
- The vectordivisor
- The divisor
public static ArrayList<Double> substractVector(List<Double> firstVector, List<Double> secondVector)
firstVector
- The first vectorsecondVector
- The second vector
public static double computeL1Norm(List<Double> values)
values
- The data
public static double computeMaxNorm(List<Double> values)
values
- The data
public static ArrayList<Double> createCustomVector(double cpu, double memory, org.inria.myriads.snoozecommon.communication.virtualcluster.monitoring.NetworkDemand networkDemand)
cpu
- The cpu utilizationmemory
- The memory usagenetworkDemand
- The network demand
public static ArrayList<Double> createEmptyVector()
public static double computeEuclidNorm(List<Double> values)
values
- The data
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |