|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.algebraic.AbstractHypermatrix
org.jscience.mathematics.algebraic.AbstractMatrix
org.jscience.mathematics.algebraic.AbstractVector
org.jscience.mathematics.algebraic.matrices.AbstractIntegerVector
org.jscience.mathematics.algebraic.matrices.Integer3Vector
public class Integer3Vector
An optimised implementation of a 3D integer vector.
| Field Summary | |
|---|---|
int |
x
DOCUMENT ME! |
int |
y
DOCUMENT ME! |
int |
z
DOCUMENT ME! |
| Constructor Summary | |
|---|---|
Integer3Vector()
Constructs an empty 3-vector. |
|
Integer3Vector(int[] array)
Constructs a 3-vector. |
|
Integer3Vector(Integer3Vector vec)
Constructs a 2-vector. |
|
Integer3Vector(int x,
int y,
int z)
Constructs a 3-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. |
java.lang.Object |
clone()
Clone vector into a new vector. |
boolean |
equals(java.lang.Object obj)
Compares two Integer vectors for equality. |
int |
getPrimitiveElement(int n)
Returns a component of this vector. |
int |
getX()
DOCUMENT ME! |
int |
getY()
DOCUMENT ME! |
int |
getZ()
DOCUMENT ME! |
int |
infNorm()
Returns the l -norm. |
AbstractDoubleVector |
mapElements(PrimitiveMapping f)
Applies a function on all the vector components. |
int |
mass()
Returns the mass. |
Integer3Vector |
multiply(Integer3Vector vec)
Returns the vector product of this vector and another (so(3) algebra). |
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 |
setAllElements(int r)
Sets the value of all elements of the vector. |
void |
setElement(int n,
int value)
Sets the value of a component of this vector. |
void |
setX(int d)
DOCUMENT ME! |
void |
setY(int d)
DOCUMENT ME! |
void |
setZ(int d)
DOCUMENT ME! |
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. |
int |
sumSquares()
Returns the sum of the squares of the components. |
AbstractComplexVector |
toComplexVector()
Converts this 3-vector to a complex 3-vector. |
AbstractDoubleVector |
toDoubleVector()
Converts this 3-vector to a double 3-vector. |
int[] |
toPrimitiveArray()
Projects the vector to an array. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
| Methods inherited from class org.jscience.mathematics.algebraic.matrices.AbstractIntegerVector |
|---|
abs, equals, getColumn, getElement, getRow, getSubVector, hashCode, max, mean, min, multiply, read, reverse, scalarDivide, setColumn, setElement, setRow, setSubVector, standardDeviation, tensorProduct, toMatrix, transpose, variance |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractVector |
|---|
getDimension, getElement, getInvalidElementMsg, toArray, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractMatrix |
|---|
getElement, getInvalidElementMsg, numColumns, numRows, print, print, print, print, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractHypermatrix |
|---|
getDimensions, numDimensions, numElements, numElements, toArray |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jscience.mathematics.algebraic.Matrix |
|---|
numColumns, numRows, toArray |
| Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix |
|---|
getDimensions, getElement, numDimensions, numElements, numElements, toArray |
| Field Detail |
|---|
public int x
public int y
public int z
| Constructor Detail |
|---|
public Integer3Vector()
public Integer3Vector(int x,
int y,
int z)
x - x coordinate.y - y coordinate.z - z coordinate.public Integer3Vector(int[] array)
array - DOCUMENT ME!public Integer3Vector(Integer3Vector vec)
vec - DOCUMENT ME!| Method Detail |
|---|
public boolean equals(java.lang.Object obj)
equals in class AbstractIntegerVectorobj - a Integer 3-vector
public java.lang.String toString()
toString in class AbstractIntegerVectorpublic AbstractDoubleVector toDoubleVector()
toDoubleVector in class AbstractIntegerVectorpublic AbstractComplexVector toComplexVector()
toComplexVector in class AbstractIntegerVectorpublic int getPrimitiveElement(int n)
getPrimitiveElement in class AbstractIntegerVectorn - index of the vector component
IllegalDimensionException - If attempting to access an invalid
component.
public void setElement(int n,
int value)
setElement in class AbstractIntegerVectorn - index of the vector componentvalue - a number
IllegalDimensionException - If attempting to access an invalid
component.public void setAllElements(int r)
setAllElements in class AbstractIntegerVectorr - a int elementpublic int getX()
public int getY()
public int getZ()
public void setX(int d)
d - DOCUMENT ME!public void setY(int d)
d - DOCUMENT ME!public void setZ(int d)
d - DOCUMENT ME!public double norm(int n)
norm in class AbstractIntegerVectorn - DOCUMENT ME!
public double norm()
norm in class AbstractIntegerVectorpublic int infNorm()
-norm.
infNorm in class AbstractIntegerVectorpublic int sumSquares()
sumSquares in class AbstractIntegerVectorpublic int mass()
mass in class AbstractIntegerVectorpublic AbelianGroup.Member negate()
negate in interface AbelianGroup.Memberpublic AbelianGroup.Member add(AbelianGroup.Member vec)
add in interface AbelianGroup.Membervec - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public AbstractIntegerVector add(AbstractIntegerVector vec)
add in class AbstractIntegerVectorvec - a integer 3-vector
IllegalDimensionException - DOCUMENT ME!public AbelianGroup.Member subtract(AbelianGroup.Member vec)
subtract in interface AbelianGroup.Membervec - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public AbstractIntegerVector subtract(AbstractIntegerVector vec)
subtract in class AbstractIntegerVectorvec - a integer 3-vector
IllegalDimensionException - DOCUMENT ME!public Module.Member scalarMultiply(Ring.Member x)
scalarMultiply in interface Module.Memberx - DOCUMENT ME!
java.lang.IllegalArgumentException - DOCUMENT ME!public AbstractIntegerVector scalarMultiply(int k)
scalarMultiply in class AbstractIntegerVectork - a integer
public int scalarProduct(AbstractIntegerVector vec)
scalarProduct in class AbstractIntegerVectorvec - a integer 3-vector
IllegalDimensionException - DOCUMENT ME!public Integer3Vector multiply(Integer3Vector vec)
vec - a integer 3-vector
public AbstractDoubleVector mapElements(PrimitiveMapping f)
mapElements in class AbstractIntegerVectorf - a user-defined function.
public int[] toPrimitiveArray()
toPrimitiveArray in class AbstractIntegerVectorpublic java.lang.Object clone()
clone in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||