SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.vector.doubles
Class IsVector

java.lang.Object
  extended by com.numericalmethod.suanshu.vector.doubles.IsVector

public class IsVector
extends java.lang.Object

This class collects the utility functions to validate input arguments for vector operations.


Nested Class Summary
static class IsVector.SizeMismatch
          This exception should be thrown when a vector operation is performed on two vectors with different sizes.
static class IsVector.VectorAccessException
          This exception should be thrown if any invalid access to a Vector instance is detected.
 
Method Summary
static void equalSize(Vector v1, Vector v2)
          Check if the input vectors are of the same size.
static void validIndex(Vector v, int index)
          Check if the input index is a valid index Vector v.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

equalSize

public static void equalSize(Vector v1,
                             Vector v2)
Check if the input vectors are of the same size.

Parameters:
v1 - a vector
v2 - a vector
Throws:
IsVector.SizeMismatch - if sizes do not match

validIndex

public static void validIndex(Vector v,
                              int index)
Check if the input index is a valid index Vector v.

Parameters:
v - a vector
index - the input index
Throws:
IsVector.VectorAccessException - if the index is invalid

SuanShu, a Java numerical and statistical library

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