|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.chemistry.quantum.math.vector.VectorND
public class VectorND
Defines an R^n space vector.
| Field Summary | |
|---|---|
protected int |
size
Holds value of property size. |
protected double[] |
vector
Holds value of property vector. |
| Constructor Summary | |
|---|---|
VectorND(double[] array)
Creates a new VectorND object. |
|
VectorND(int size)
Creates a new instance of Vector |
|
VectorND(Matrix a)
Creates a new instance of Vector from a square Matrix |
|
| Method Summary | |
|---|---|
VectorND |
add(VectorND b)
addition of two vectors |
java.lang.Object |
clone()
clone this vector ;) Cloning is getting interesting! |
double |
dot(VectorND b)
The dot product of two vectors (a.b) |
int |
getSize()
Getter for property size. |
double[] |
getVector()
Getter for property vector. |
double |
getVector(int index)
Indexed getter for property vector. |
double |
magnitude()
The magnitude of this vector |
void |
makeZero()
Make this vector a Null vector |
VectorND |
mul(double k)
multiplication of this vector with a scalar k |
VectorND |
negate()
negate this vector |
VectorND |
normalize()
get the normalized form of this vector |
void |
setSize(int size)
Setter for property size. |
void |
setVector(double[] vector)
Setter for property vector. |
void |
setVector(int index,
double vector)
Indexed setter for property vector. |
VectorND |
sub(VectorND b)
substraction of two vectors (this - b) |
java.lang.String |
toString()
the overridden toString() method |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int size
protected double[] vector
| Constructor Detail |
|---|
public VectorND(int size)
size - DOCUMENT ME!public VectorND(double[] array)
array - DOCUMENT ME!public VectorND(Matrix a)
a - the square matrix from which this vector will be made| Method Detail |
|---|
public void makeZero()
public int getSize()
public void setSize(int size)
size - New value of property size.public double getVector(int index)
index - Index of the property.
index.public double[] getVector()
public void setVector(int index,
double vector)
index - Index of the property.vector - New value of the property at index.public void setVector(double[] vector)
vector - New value of property vector.public VectorND add(VectorND b)
b - : to be added to the current vector
public VectorND sub(VectorND b)
b - : to be substracted from the current vector
public VectorND mul(double k)
k - k : the scalar to be multiplied to this vector
public double dot(VectorND b)
b - vector with which the dot product is to be evaluated
public double magnitude()
public VectorND normalize()
public VectorND negate()
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||