JSci.maths.vectors
Class MathVector

java.lang.Object
  extended by JSci.maths.vectors.MathVector
All Implemented Interfaces:
java.io.Serializable, Module.Member, AbelianGroup.Member, Member
Direct Known Subclasses:
AbstractComplexVector, AbstractDoubleVector, AbstractIntegerVector, BraVector, KetVector

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

The MathVector superclass provides an abstract encapsulation for vectors.

See Also:
Serialized Form
PlanetMath references:
Vector

Field Summary
protected  int N
          The vector's dimension.
 
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
 
Methods inherited from interface JSci.maths.Member
getSet
 

Field Detail

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