|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.vectors.MathVector JSci.maths.vectors.AbstractIntegerVector
public abstract class AbstractIntegerVector
The AbstractIntegerVector class encapsulates vectors containing integers.
Field Summary |
---|
Fields inherited from class JSci.maths.vectors.MathVector |
---|
N |
Constructor Summary | |
---|---|
protected |
AbstractIntegerVector(int dim)
|
Method Summary | |
---|---|
abstract AbstractIntegerVector |
add(AbstractIntegerVector v)
Returns the addition of this vector and another. |
boolean |
equals(java.lang.Object obj)
Compares two integer vectors for equality. |
abstract int |
getComponent(int n)
Returns a component of this vector. |
java.lang.Object |
getSet()
|
int |
hashCode()
Returns a hashcode for this vector. |
double |
infNorm()
Returns the l-norm. |
double |
norm()
Returns the l2-norm (magnitude). |
double |
norm(int n)
Returns the ln-norm. |
abstract AbstractIntegerVector |
scalarMultiply(int x)
Returns the multiplication of this vector by a scalar. |
abstract int |
scalarProduct(AbstractIntegerVector v)
Returns the scalar product of this vector and another. |
abstract void |
setComponent(int n,
int x)
Sets the value of a component of this vector. |
abstract AbstractIntegerVector |
subtract(AbstractIntegerVector v)
Returns the subtraction of this vector by another. |
AbstractDoubleVector |
toDoubleVector()
Converts this vector to a double vector. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
Methods inherited from class JSci.maths.vectors.MathVector |
---|
dimension, getInvalidComponentMsg |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, 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 |
Constructor Detail |
---|
protected AbstractIntegerVector(int dim)
Method Detail |
---|
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- an integer vectorpublic java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public AbstractDoubleVector toDoubleVector()
public abstract int getComponent(int n)
n
- index of the vector component
VectorDimensionException
- If attempting to access an invalid component.public abstract void setComponent(int n, int x)
n
- index of the vector componentx
- an integer
VectorDimensionException
- If attempting to access an invalid component.public java.lang.Object getSet()
public double norm(int n)
public double norm()
norm
in class MathVector
public double infNorm()
public abstract AbstractIntegerVector add(AbstractIntegerVector v)
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.public abstract AbstractIntegerVector subtract(AbstractIntegerVector v)
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.public abstract AbstractIntegerVector scalarMultiply(int x)
x
- an integerpublic abstract int scalarProduct(AbstractIntegerVector v)
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |