|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectvec_math.NVector
public class NVector
The definition of a N-dimensional vector. Normally, one uses the daugther classes, if appropriate. The base class is only a container for an N-dimensinal double array.
| Nested Class Summary | |
|---|---|
static class |
NVector.CloneTest
Testing cloning. |
private static class |
NVector.IComp
Special index comparator. |
| Field Summary | |
|---|---|
protected double[] |
a
|
| Constructor Summary | |
|---|---|
protected |
NVector()
Empty constructor. |
|
NVector(double[] a)
Constructs a new, n-dimensional vector. |
|
NVector(Double[] d)
Constructs a new, n-dimensional vector. |
|
NVector(int n)
Constructs a new nvector with the specified dimension. |
| Method Summary | ||
|---|---|---|
static NVector |
add(NVector s1,
NVector s2,
NVector dest)
Returns the addition of two vectors with equal dimension. |
|
Object |
clone()
Returns a clone of this NVector. |
|
int |
dimension()
Returns the dimension of the vector. |
|
static Matrix |
direct(NVector a,
NVector b)
Returns the direct product of this vector with the argumental vector. |
|
static double |
dot(NVector a,
NVector b)
Returns the scalar product of this vector with the target vector. |
|
static NVector[] |
doubleParse(String doubletokenize)
Double-tokenizes a string such that the input is split on the semicolon (actually the OUTERLIST separator of StringTool) and each of these splits is used to parse a single vector out of it. |
|
boolean |
equals(Object that)
Checks for equality. |
|
double |
get(int index)
Returns coordinate with specified index. |
|
double[] |
getAsArray()
Returns the coordinates as an array of doubles. |
|
double |
getLength()
Returns the length of the vector. |
|
int |
hashCode()
A hash code for this vector. |
|
static NVector |
multiply(double lambda,
NVector s1,
NVector dest)
Multiplies this vector with a scalar. |
|
static NVector |
parse(String comma)
Parses an NVector from a comma-sparated list of doubles. |
|
static int |
search(NVector[] sorted,
int index,
double max)
Returns the integer such that |
|
static int[] |
searchMinMax(NVector[] data,
int coor)
Returns the index of the minimum and maximum vector component in the specified array. |
|
void |
set(int index,
double value)
Sets the coordinate with the specified index. |
|
static
|
sort(T[] unsorted,
int index)
Data must be sorted according to given indices values. |
|
static NVector |
subtract(NVector s1,
NVector s2,
NVector dest)
Returns the subtraction of two vectors with equal dimension. |
|
String |
toString()
Converts this vector into a String. |
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected double[] a
| Constructor Detail |
|---|
protected NVector()
public NVector(int n)
public NVector(double[] a)
public NVector(Double[] d)
| Method Detail |
|---|
public static NVector parse(String comma)
public static NVector[] doubleParse(String doubletokenize)
StringTool.OUTERLISTpublic double get(int index)
index - Index in coordinate arraypublic double[] getAsArray()
public void set(int index,
double value)
index - Index in coordinate array.value - New valuepublic int dimension()
public static NVector multiply(double lambda,
NVector s1,
NVector dest)
public static double dot(NVector a,
NVector b)
a⋅b = δijaibi
IllegalArgumentException - If the dimension of the two vectors are
not identical.public double getLength()
public static Matrix direct(NVector a,
NVector b)
(a⊗b)ij=aibj
Note that the direct product is not commutative.
public static NVector add(NVector s1,
NVector s2,
NVector dest)
public static NVector subtract(NVector s1,
NVector s2,
NVector dest)
public boolean equals(Object that)
equals in class Objectthat - The NVector to check.public String toString()
toString in class Objectpublic int hashCode()
hashCode in class Objectpublic Object clone()
clone in class Object
public static <T extends NVector> T[] sort(T[] unsorted,
int index)
public static int search(NVector[] sorted,
int index,
double max)
NVector[index] >= f && NVector[index-1] < f
or -1.
public static int[] searchMinMax(NVector[] data,
int coor)
coor - Search is performed on this vector index, 0 to dimension-1.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||