|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface to vector-methods
Note that s stands for this vector (source), r means result vector and letter
a is chosen for scalar values, in all cases a double precision floating point.
Method Summary | |
java.lang.Object |
clone()
Clone a vector. |
Vector |
copy()
Copies s into a new vector r |
Vector |
crossProduct(Vector v)
calulates the cross product: r = s x v. |
boolean |
equals(java.lang.Object obj)
Test, whether s and v are identical or not |
double |
get(int pos)
Gets an element from s |
Vector |
get(int i0,
int i1)
Get a part of the vector. |
int |
getDim()
Returns the dimension of s |
double |
getLength()
Calculates the length of s. |
Matrix |
getMatrix()
Creates a matrix from s This is a "kind" of typecast. |
Vector |
minus(Vector v)
Substracts to vectors: r = s-v |
Vector |
mult(double f)
Multiplication with scalar: r = a*s |
double |
normF()
Calculates the Frobenius norm of a vector, which is the same as the getLength(). |
double |
normM()
Calculates the maximum norm of a vector |
Vector |
plus(Vector v)
Add two vectors: r = s+v |
void |
print()
Prints this matrix to stdout |
void |
print(int w,
int d)
Prints this matrix to stdout Note:It may be useful to select w > d. |
void |
printMatlab()
Prints this matrix in Matlab format to stdout |
double |
scalarmult(Vector v)
scalarmultiplication (or dot product)of two vectors: a = s*v, where a is a scalar value |
void |
set(int pos,
double value)
Set an element of s |
void |
set(int pos,
Vector v)
Set a part of a vector |
Matrix |
SkewSym()
Creates a skew-symmetrix matrix from s. s must have dimension 3 to do that. |
java.lang.String |
toString()
Delivers a string with the elements of the matrix. |
Method Detail |
public Vector plus(Vector v)
v
- vector to add
public Vector minus(Vector v)
v
- vector to substract
public double scalarmult(Vector v)
v
- vector to scalarmultiplicate
public Vector crossProduct(Vector v)
v
- vector to create cross product with
public Vector mult(double f)
f
- scalar value
public Vector copy()
public void set(int pos, double value)
pos
- Position to set a new value. First position is 0value
- new value to setpublic void set(int pos, Vector v)
pos
- begining position (inclusive)v
- vector which hold the values to be set. All the values from the
vector are copied to the target.public double get(int pos)
pos
- Position to get element from. Starts with 0
public Vector get(int i0, int i1)
i0
- index of first vector elementi1
- index of the last vector element
public int getDim()
public double getLength()
public double normF()
public double normM()
public void print(int w, int d)
w
- describes the width of a single elementd
- number of decimals after commapublic void print()
public void printMatlab()
public java.lang.String toString()
public boolean equals(java.lang.Object obj)
obj
- vector to test
public Matrix getMatrix()
public Matrix SkewSym()
e.g.: | a | | 0 -c b | if s = | b | , then s.Skewsym() returns | c 0 -a | | c | | -b a 0 |This matrix can be read as a cross product.
public java.lang.Object clone()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |