

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object  +javaslam.util.Flops
A class containing methods for counting floating point operations.
Field Summary  
static boolean 
countFlops
A flag that determines whether count(long) will
increment the flop count. 
protected static long 
flops
A counter of the number of floatingpoint operations performed. 
Constructor Summary  
Flops()

Method Summary  
static int 
add(int n,
int m)
Counts the number of floating point operations used to add two n bym matrices. 
static int 
backSubst(int n,
int k,
int m)
Counts the number of floating point operations used to solve for X via back substitution in the matrix equation AX = B where A is upper triangular. 
static int 
chol(int n)
Counts the number of floating point operations used to compute the Cholesky decomposition of an n byn
symmetric positive definite matrix. 
static long 
count()
Returns the number of floating point operations performed by code in the tjtf package since the virtual machine was
started. 
static void 
count(long f)
Increments the flop counter by f . 
static int 
det(int n,
boolean isSPD)
Counts the number of floating point operations used to compute the determinant of an n byn matrix
that is possibly symmetric positive definite. 
static int 
exp()
Counts the number of floating point operations used to compute the exponential of a number. 
static int 
forwardSubst(int n,
int k,
int m)
Counts the number of floating point operations used to solve for X via back substitution in the matrix equation AX = B where A is unit lower triangular. 
static int 
inv(int n,
boolean isSPD)
Counts the number of floating point operations used to invert an n byn matrix that is possibly
symmetric positive definite. 
static int 
log()
Counts the number of floating point operations used to compute the logarithm of a number. 
static int 
lu(int n)
Counts the number of floating point operations used to compute the LU decomposition of an n byn
square matrix. 
static int 
mult(int n,
int k,
int m)
Counts the number of floating point operations used to compute the product of two matrices A and B. 
static int 
rand()
Counts the number of floating point operations used to compute a random doubleprecision floating point number between 0.0 and 1.0 using a simple linearcongruential formula x_{i + 1} = a x_{i} + b (mod c). 
static int 
randn()
Counts the number of floating point operations used to compute a sample from the standard normal using the BoxMuller method. 
static int 
randnorm(int n,
int k)
Counts the number of floating point operations used to compute n samples from a k dimensional
multivariate Gaussian distribution represented using a covariance
matrix. 
static void 
reset()
A method that resets the flop count. 
static int 
solve(int n,
int k,
int m,
boolean isSPD)
Counts the number of floating point operations used to solve for X in the matrix equation AX = B where A is possibly symmetric positive definite. 
static int 
sqrt()
Counts the number of floating point operations used to compute the square root of a number. 
static int 
trace(int n)
Counts the number of floating point operations used to compute the trace of a square matrix A. 
Methods inherited from class java.lang.Object 
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Field Detail 
public static boolean countFlops
count(long)
will
increment the flop count.
protected static long flops
Constructor Detail 
public Flops()
Method Detail 
public static long count()
tjtf
package since the virtual machine was
started.
public static void count(long f)
f
.
public static void reset()
public static int solve(int n, int k, int m, boolean isSPD)
n
 the number of rows in Ak
 the number of columns in A (and also the number
of rows in B)m
 the number of columns in BisSPD
 true if A is positive definite, enabling
the Cholesky decomposition
public static int backSubst(int n, int k, int m)
n
 the number of rows in Ak
 the number of columns in A (and also the number
of rows in B)m
 the number of columns in B
public static int forwardSubst(int n, int k, int m)
n
 the number of rows in Ak
 the number of columns in A (and also the number
of rows in B)m
 the number of columns in B
public static int inv(int n, boolean isSPD)
n
byn
matrix that is possibly
symmetric positive definite.
This algorithm comes from the Numerical Recipes algorithm via the
Lightspeed Matlab library of Tom Minka.
n
 the number of rows and columns of the square matrixisSPD
 true if the matrix is positive definite,
enabling the Cholesky decomposition
public static int chol(int n)
n
byn
symmetric positive definite matrix.
This formula comes from the Numerical Recipes algorithm via the
Lightspeed Matlab library of Tom Minka.
n
 the number of rows and columns of the square matrix
public static int lu(int n)
n
byn
square matrix.
This formula comes from
http://www.maths.uq.edu.au/~gac/math2200/mn_nla2.pdf.
n
 the number of rows and columns of the square matrix
public static int sqrt()
15
and is based on source code for
sqrt()
function at
http://www.opencores.org/cvsweb.shtml/or1k/newlib/newlib/libm/mathfp/s_sqrt.c.
This formula comes from the Lightspeed Matlab library of Tom
Minka.
public static int det(int n, boolean isSPD)
n
byn
matrix
that is possibly symmetric positive definite.
n
 the number of rows and columns of the square matrixisSPD
 true if the matrix is positive definite,
enabling the Cholesky decomposition
This formula comes from the Lightspeed Matlab library of Tom
Minka.public static int log()
20
; this formula comes from the Lightspeed Matlab
library of Tom Minka.
public static int exp()
20
; this formula comes from the Lightspeed Matlab
library of Tom Minka.
public static int rand()
public static int randn()
public static int randnorm(int n, int k)
n
samples from a k
dimensional
multivariate Gaussian distribution represented using a covariance
matrix.
n
 the number of samplesk
 the dimension of the Gaussian distribution
n
times from a
k
dimensional multivariate Gaussian
distribution represented using a covariance matrix.public static int mult(int n, int k, int m)
n
 the number of rows in Ak
 the number of columns in A (and also the number
of rows in B)m
 the number of columns in B
public static int trace(int n)
n
 the number of rows (and columns) in A
public static int add(int n, int m)
n
bym
matrices.
n
 the number of rows in each matrixm
 the number of columns in each matrix


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 