|
||||||||||
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 JSci.maths.vectors.Integer2Vector
An optimised implementation of a 2D integer vector.
Field Summary | |
protected int |
x
|
protected int |
y
|
Fields inherited from class JSci.maths.vectors.MathVector |
N |
Constructor Summary | |
Integer2Vector()
Constructs an empty 2-vector. |
|
Integer2Vector(int[] array)
Constructs a 2-vector. |
|
Integer2Vector(int x,
int y)
Constructs a 2-vector. |
Method Summary | |
AbelianGroup.Member |
add(AbelianGroup.Member vec)
Returns the addition of this vector and another. |
AbstractIntegerVector |
add(AbstractIntegerVector vec)
Returns the addition of this vector and another. |
boolean |
equals(java.lang.Object obj)
Compares two integer vectors for equality. |
int |
getComponent(int n)
Returns a component of this vector. |
double |
infNorm()
Returns the l-norm. |
AbelianGroup.Member |
negate()
Returns the negative of this vector. |
double |
norm()
Returns the l2-norm (magnitude). |
double |
norm(int n)
Returns the ln-norm. |
AbstractIntegerVector |
scalarMultiply(int k)
Returns the multiplication of this vector by a scalar. |
Module.Member |
scalarMultiply(Ring.Member x)
Returns the multiplication of this vector by a scalar. |
int |
scalarProduct(AbstractIntegerVector vec)
Returns the scalar product of this vector and another. |
void |
setComponent(int n,
int value)
Sets the value of a component of this vector. |
AbelianGroup.Member |
subtract(AbelianGroup.Member vec)
Returns the subtraction of this vector by another. |
AbstractIntegerVector |
subtract(AbstractIntegerVector vec)
Returns the subtraction of this vector by another. |
AbstractComplexVector |
toComplexVector()
Converts this 2-vector to a complex 2-vector. |
AbstractDoubleVector |
toDoubleVector()
Converts this 2-vector to a double 2-vector. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
Methods inherited from class JSci.maths.vectors.AbstractIntegerVector |
hashCode |
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 |
Field Detail |
protected int x
protected int y
Constructor Detail |
public Integer2Vector()
public Integer2Vector(int x, int y)
x
- x coordinate.y
- y coordinate.public Integer2Vector(int[] array)
Method Detail |
public boolean equals(java.lang.Object obj)
equals
in class AbstractIntegerVector
obj
- a integer 2-vectorpublic java.lang.String toString()
toString
in class AbstractIntegerVector
public AbstractDoubleVector toDoubleVector()
toDoubleVector
in class AbstractIntegerVector
public AbstractComplexVector toComplexVector()
public int getComponent(int n)
getComponent
in class AbstractIntegerVector
n
- index of the vector component
VectorDimensionException
- If attempting to access an invalid component.public void setComponent(int n, int value)
setComponent
in class AbstractIntegerVector
n
- index of the vector componentvalue
- a number
VectorDimensionException
- If attempting to access an invalid component.public double norm(int n)
norm
in class AbstractIntegerVector
public double norm()
norm
in class AbstractIntegerVector
public double infNorm()
infNorm
in class AbstractIntegerVector
public AbelianGroup.Member negate()
public AbelianGroup.Member add(AbelianGroup.Member vec)
vec
- a group memberpublic AbstractIntegerVector add(AbstractIntegerVector vec)
add
in class AbstractIntegerVector
vec
- a integer 2-vectorpublic AbelianGroup.Member subtract(AbelianGroup.Member vec)
vec
- a group memberpublic AbstractIntegerVector subtract(AbstractIntegerVector vec)
subtract
in class AbstractIntegerVector
vec
- a integer 2-vectorpublic Module.Member scalarMultiply(Ring.Member x)
x
- a ring memberpublic AbstractIntegerVector scalarMultiply(int k)
scalarMultiply
in class AbstractIntegerVector
k
- a integer
public int scalarProduct(AbstractIntegerVector vec)
scalarProduct
in class AbstractIntegerVector
vec
- a integer 2-vector
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |