|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object JSci.maths.vectors.MathVector JSci.maths.vectors.AbstractIntegerVector JSci.maths.vectors.IntegerVector
public class IntegerVector
An array-based implementation of an integer vector.
Field Summary | |
---|---|
protected int[] |
vector
Array containing the components of the vector. |
Fields inherited from class JSci.maths.vectors.MathVector |
---|
N |
Constructor Summary | |
---|---|
IntegerVector(int dim)
Constructs an empty vector. |
|
IntegerVector(int[] array)
Constructs a vector by wrapping an array. |
Method Summary | |
---|---|
AbelianGroup.Member |
add(AbelianGroup.Member v)
Returns the addition of this vector and another. |
AbstractIntegerVector |
add(AbstractIntegerVector v)
Returns the addition of this vector and another. |
IntegerVector |
add(IntegerVector v)
|
boolean |
equals(java.lang.Object a)
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 x)
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 v)
Returns the scalar product of this vector and another. |
int |
scalarProduct(IntegerVector v)
|
void |
setComponent(int n,
int x)
Sets the value of a component of this vector. |
AbelianGroup.Member |
subtract(AbelianGroup.Member v)
Returns the subtraction of this vector by another. |
AbstractIntegerVector |
subtract(AbstractIntegerVector v)
Returns the subtraction of this vector by another. |
IntegerVector |
subtract(IntegerVector v)
|
AbstractComplexVector |
toComplexVector()
Converts this vector to a complex vector. |
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.AbstractIntegerVector |
---|
getSet, 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[] vector
Constructor Detail |
---|
public IntegerVector(int dim)
dim
- the dimension of the vector.public IntegerVector(int[] array)
array
- an assigned valueMethod Detail |
---|
public boolean equals(java.lang.Object a)
equals
in class AbstractIntegerVector
a
- an integer 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 x)
setComponent
in class AbstractIntegerVector
n
- index of the vector componentx
- an integer
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 v)
v
- a group memberpublic AbstractIntegerVector add(AbstractIntegerVector v)
add
in class AbstractIntegerVector
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.public IntegerVector add(IntegerVector v)
public AbelianGroup.Member subtract(AbelianGroup.Member v)
v
- a group memberpublic AbstractIntegerVector subtract(AbstractIntegerVector v)
subtract
in class AbstractIntegerVector
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.public IntegerVector subtract(IntegerVector v)
public Module.Member scalarMultiply(Ring.Member x)
x
- a ring memberpublic AbstractIntegerVector scalarMultiply(int x)
scalarMultiply
in class AbstractIntegerVector
x
- an integerpublic int scalarProduct(AbstractIntegerVector v)
scalarProduct
in class AbstractIntegerVector
v
- an integer vector
VectorDimensionException
- If the vectors are different sizes.public int scalarProduct(IntegerVector v)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |