org.neo4j.graphalgo.impl.util
Class MatrixUtil

java.lang.Object
  extended by org.neo4j.graphalgo.impl.util.MatrixUtil

public class MatrixUtil
extends Object

Utility class that hold implementations of vectors and matrices of doubles, all indexed by integers, together with some essential operations on those.

Author:
Patrik Larsson

Nested Class Summary
static class MatrixUtil.DoubleMatrix
          2-Dimensional matrix of doubles.
static class MatrixUtil.DoubleVector
          Vector of doubles
 
Constructor Summary
MatrixUtil()
           
 
Method Summary
static MatrixUtil.DoubleVector LinearSolve(MatrixUtil.DoubleMatrix a, MatrixUtil.DoubleVector b)
          Solves the linear equation system ax = b.
static void LUDecomposition(MatrixUtil.DoubleMatrix matrix)
          Destructive (in-place) LU-decomposition
static MatrixUtil.DoubleVector multiply(MatrixUtil.DoubleMatrix matrix, MatrixUtil.DoubleVector vector)
          Multiplies a matrix and a vector.
static double normalize(MatrixUtil.DoubleVector vector)
          In-place normalization of a vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixUtil

public MatrixUtil()
Method Detail

LUDecomposition

public static void LUDecomposition(MatrixUtil.DoubleMatrix matrix)
Destructive (in-place) LU-decomposition

Parameters:
matrix - input

LinearSolve

public static MatrixUtil.DoubleVector LinearSolve(MatrixUtil.DoubleMatrix a,
                                                  MatrixUtil.DoubleVector b)
Solves the linear equation system ax = b.

Parameters:
a - Input matrix. Will be altered in-place.
b - Input vector. Will be altered in-place.
Returns:
the vector x solving the equations.

multiply

public static MatrixUtil.DoubleVector multiply(MatrixUtil.DoubleMatrix matrix,
                                               MatrixUtil.DoubleVector vector)
Multiplies a matrix and a vector.

Parameters:
matrix -
vector -
Returns:
The result as a new vector.

normalize

public static double normalize(MatrixUtil.DoubleVector vector)
In-place normalization of a vector.

Parameters:
vector -
Returns:
The initial euclidean length of the vector.


Copyright © 2002-2012 The Neo4j Graph Database Project. All Rights Reserved.