|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectgeometry.Vector
Represents a Column-Vector of doubles (least index is 1).
| Field Summary | |
JLinAlg.Vector |
v
The internal representation as a JLinAlg vector. |
| Constructor Summary | |
Vector(double[] coords)
Constructs a vector with the given entries. |
|
Vector(int dim)
Constructs a zero-vector. |
|
Vector(int dim,
int coord)
Constructs a unit-coordinate-vector. |
|
Vector(int dim,
int coord,
double length)
Constructs a coordinate-vector. |
|
Vector(JLinAlg.Vector vector)
Constructs a vector directly referencing the given JLinAlg vector. |
|
| Method Summary | |
Vector |
add(Vector other)
Calculates the sum of two vectors. |
Vector |
copy()
Returns a deep copy of this vector. |
int |
dim()
Returns the dimension of this vector. |
double |
get(int i)
Gets an entry of the vector. |
boolean |
isZero()
Tests whether this is the zero vector |
double |
scalarProduct(Vector other)
Calculates the scalar product of two vectors. |
Vector |
scale(double factor)
Calculates a multiple of this vector. |
void |
set(int i,
double value)
Sets an entry of the vector to the given value. |
Vector |
subtract(Vector other)
Calculates the difference beween two vectors. |
Vector |
subVector(int start,
int end)
Copies a part of the entries into a new vector. |
java.lang.String |
toString()
Returns a String representation of this vector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public JLinAlg.Vector v
JLinAlg vector.
| Constructor Detail |
public Vector(int dim)
dim - the number of coordinates
public Vector(int dim,
int coord,
double length)
dim - the number of coordinatescoord - the index of the only non-zero coordinate of this vectorlength - the length of the vector
public Vector(int dim,
int coord)
dim - the number of coordinatescoord - the index of the only non-zero coordinate of this vectorpublic Vector(double[] coords)
coords[0] will be the first
entry of the vecor get(1)
coords - the entries of the vectorpublic Vector(JLinAlg.Vector vector)
JLinAlg vector. The entries of the given vector
have to be instances of DoubleWrapper.
vector - the original vector to be referenced| Method Detail |
public Vector subVector(int start,
int end)
start - the first entry to be copiedend - the last entry to be copied
public void set(int i,
double value)
i - the index of the changing coordinatevalue - the new value for the selected coordinatepublic double get(int i)
i - the index of a coordinate
public int dim()
public Vector subtract(Vector other)
other - the vector, which is to be subtracted from this vector
public Vector add(Vector other)
other - the vector, which is to be added to this vector
public Vector scale(double factor)
factor - the value this vector is to be multiplied with
public double scalarProduct(Vector other)
other - the vector, which is to be multiplied with this vector
public java.lang.String toString()
public Vector copy()
public boolean isZero()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||