SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.matrix.doubles
Class AreMatrices

java.lang.Object
  extended by com.numericalmethod.suanshu.matrix.doubles.AreMatrices

public class AreMatrices
extends java.lang.Object

This class collects the boolean operators that take two or more matrices or vectors and compare their properties.


Method Summary
static boolean equal(Matrix A1, Matrix A2, double epsilon)
          Check the equality of two matrices up to a precision.
static boolean equal(Vector v1, Vector v2, double epsilon)
          Check if two vectors are equal up to a precision.
static boolean orthogonal(Vector[] v, double epsilon)
          Check if a set of vectors are orthogonal.
static boolean orthogonal(Vector v1, Vector v2, double epsilon)
          Check if two vectors are orthogonal.
static boolean orthogonormal(Vector[] v, double epsilon)
          Check if a set of vectors are orthogonormal.
static boolean orthogonormal(Vector v1, Vector v2, double epsilon)
          Check if two vectors are orthogonormal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equal

public static boolean equal(Matrix A1,
                            Matrix A2,
                            double epsilon)
Check the equality of two matrices up to a precision.

Two matrices are equal iff

  1. the dimensions are the same;
  2. all entries are equal
Parameters:
A1 - a matrix
A2 - a matrix
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff all entries are equal, entry by entry

equal

public static boolean equal(Vector v1,
                            Vector v2,
                            double epsilon)
Check if two vectors are equal up to a precision.

Parameters:
v1 - a vector
v2 - a vector
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff v1 - v2 is a zero vector, up to a precision

orthogonal

public static boolean orthogonal(Vector v1,
                                 Vector v2,
                                 double epsilon)
Check if two vectors are orthogonal.

Parameters:
v1 - a vector
v2 - a vector
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff
v1 ∙ v2 == 0

orthogonal

public static boolean orthogonal(Vector[] v,
                                 double epsilon)
Check if a set of vectors are orthogonal.

Parameters:
v - a set of vectors
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff
v1 ∙ v2 == 0
for any v1, v2 in v

orthogonormal

public static boolean orthogonormal(Vector v1,
                                    Vector v2,
                                    double epsilon)
Check if two vectors are orthogonormal.

Parameters:
v1 - a vector
v2 - a vector
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff {v1, v2} are orthogonal and
||v1|| = ||v2|| = 1

orthogonormal

public static boolean orthogonormal(Vector[] v,
                                    double epsilon)
Check if a set of vectors are orthogonormal.

Parameters:
v - a set of vectors
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
Returns:
true iff {v1, v2} are orthogonormal, for any v1, v2 in v

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.