|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--AlgebraicVector
This class defines an Algebric Vector entity and what can be managing Trapezim
| Field Summary | |
private double[] |
algebricVector
|
| Constructor Summary | |
AlgebraicVector(double[] data)
Construct a new vector with the given double values |
|
AlgebraicVector(int dimension)
Construct a new vector with the specified dimension. |
|
| Method Summary | |
AlgebraicVector |
add(AlgebraicVector other)
Adds the current vector to the other vector and returns the result as a new AlgebraicVector object |
void |
addToThis(AlgebraicVector other)
Adds the other vector to the current vector and stores the result in the current vector. |
double |
elementAt(int i)
Returns the value of the i'th element in the vector. |
int |
getDimension()
Returns the dimension of the vector (the number of elements in the vector). |
double |
mul(AlgebraicVector other)
Construct a new ITrapezoid with the given vertices and widths |
AlgebraicVector |
mul(double scalar)
Computes the Scalar multiplication (dot product) of the current vector and the other vector. |
void |
mulToThis(double scalar)
Computes the multiplication of the current vector with the given scalar. |
void |
setElementAt(double value,
int i)
Sets the element in the i'th index to value. |
AlgebraicVector |
sub(AlgebraicVector other)
Substracts the current vector to the other vector and returns the result as a new AlgebraicVector object. |
void |
subToThis(AlgebraicVector other)
Substracts the current vector to the other vector and stores the result in the current vector. |
java.lang.String |
toString()
Returns a string representation of the vector in the following format: “[2.0, 3.1, 5.4]” (there is a single space between each element and there are no other characthers but [,] (no ‘\n’ also!) |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private double[] algebricVector
| Constructor Detail |
public AlgebraicVector(int dimension)
dimension - how many values in a vectorpublic AlgebraicVector(double[] data)
data - the raw vector stored in an array (double[])| Method Detail |
public int getDimension()
public double elementAt(int i)
i - location of value requested
public void setElementAt(double value,
int i)
value - the value you want to storei - position in the vector to store given valuepublic AlgebraicVector add(AlgebraicVector other)
other - a vector to addpublic void addToThis(AlgebraicVector other)
other - a vector to addpublic AlgebraicVector sub(AlgebraicVector other)
other - a vector to substract.public void subToThis(AlgebraicVector other)
other - a vector to substract.public AlgebraicVector mul(double scalar)
scalar - a scalar value to multiply bypublic double mul(AlgebraicVector other)
other - a vector to multiply bypublic void mulToThis(double scalar)
scalar - a scalar value to multiply bypublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||