Class FuncLib

java.lang.Object
  |
  +--FuncLib

public class FuncLib
extends java.lang.Object

FuncLib is a library grouping a number of helper functions.


Constructor Summary
FuncLib()
           
 
Method Summary
static double[][] addMatrices(double[][] m1, double[][] m2)
           
static int countCopies(int[] comb, boolean doSum)
           
static double[][] divideMatrixBy(double[][] m, double n)
           
static java.lang.String doubleToStringOfLength(double d, int length)
           
static long getTimeStamp()
          Never returns the same timestamp twice
static int howmanyTrue(boolean[] b)
           
static int lengthInterval(double d1, double d2)
          Returns n for the number 2^n that d1 should be multiplied with to get d2, in other words, log2(d2)/log2(d1).
static double[][] linearCombineMatrices(double[][] m1, double factor1, double[][] m2, double factor2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuncLib

public FuncLib()
Method Detail

addMatrices

public static double[][] addMatrices(double[][] m1,
                                     double[][] m2)

linearCombineMatrices

public static double[][] linearCombineMatrices(double[][] m1,
                                               double factor1,
                                               double[][] m2,
                                               double factor2)

divideMatrixBy

public static double[][] divideMatrixBy(double[][] m,
                                        double n)

doubleToStringOfLength

public static java.lang.String doubleToStringOfLength(double d,
                                                      int length)

howmanyTrue

public static int howmanyTrue(boolean[] b)

countCopies

public static int countCopies(int[] comb,
                              boolean doSum)

lengthInterval

public static int lengthInterval(double d1,
                                 double d2)
Returns n for the number 2^n that d1 should be multiplied with to get d2, in other words, log2(d2)/log2(d1).


getTimeStamp

public static long getTimeStamp()
Never returns the same timestamp twice