JSci.maths
Class MathVector

java.lang.Object
  extended by JSci.maths.MathVector
All Implemented Interfaces:
java.io.Serializable, Module.Member, AbelianGroup.Member, Member
Direct Known Subclasses:
BraVector, ComplexVector, DoubleVector, IntegerVector, KetVector

public abstract class MathVector
extends java.lang.Object
implements Module.Member

The MathVector superclass provides an abstract encapsulation for vectors.

Version:
2.2
Author:
Mark Hale
See Also:
Serialized Form

Field Summary
protected static int CLASS_SPECIFIC
          Storage format identifier.
protected  int N
          The vector's dimension.
protected  int storageFormat
           
 
Constructor Summary
MathVector(int n)
          Constructs a mathematical vector.
 
Method Summary
 int dimension()
          Returns the vector's dimension.
protected static java.lang.String getInvalidComponentMsg(int i)
          Returns an "invalid component" error message.
abstract  double norm()
          Returns the norm (magnitude).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface JSci.maths.algebras.Module.Member
scalarMultiply
 
Methods inherited from interface JSci.maths.groups.AbelianGroup.Member
add, negate, subtract
 

Field Detail

CLASS_SPECIFIC

protected static final int CLASS_SPECIFIC
Storage format identifier. Strictly for internal use only.

See Also:
Constant Field Values

storageFormat

protected int storageFormat

N

protected final int N
The vector's dimension.

Constructor Detail

MathVector

public MathVector(int n)
Constructs a mathematical vector.

Parameters:
n - the dimension of the vector.
Method Detail

norm

public abstract double norm()
Returns the norm (magnitude).


dimension

public final int dimension()
Returns the vector's dimension.


getInvalidComponentMsg

protected static java.lang.String getInvalidComponentMsg(int i)
Returns an "invalid component" error message.

Parameters:
i - index of the component