|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.mathematics.algebraic.AbstractHypermatrix
org.jscience.mathematics.algebraic.AbstractMatrix
org.jscience.mathematics.algebraic.AbstractVector
org.jscience.mathematics.algebraic.matrices.AbstractDoubleVector
public abstract class AbstractDoubleVector
The AbstractDoubleVector class encapsulates vectors containing doubles.
| Constructor Summary | |
|---|---|
protected |
AbstractDoubleVector(int dim)
|
| Method Summary | |
|---|---|
AbstractDoubleVector |
abs()
Applies the abs function on all the vector components. |
AbstractDoubleVector |
add(AbstractDoubleVector v)
Returns the addition of this vector and another. |
boolean |
equals(java.lang.Object obj)
Compares two double vectors for equality. |
boolean |
equals(java.lang.Object obj,
double tol)
|
AbstractDoubleVector |
getColumn(int j)
Returns the ith column. |
Double |
getElement(int n)
Returns an element of this vector. |
abstract double |
getPrimitiveElement(int n)
Returns an element of this vector (this is the fastest way of getting an element for this kind of matrix). |
AbstractDoubleVector |
getRow(int i)
Returns the ith row. |
AbstractDoubleVector |
getSubVector(int k1,
int k2)
Computes a sub vector from the parameters index. |
int |
hashCode()
Returns a hashcode for this NON EMPTY vector. |
double |
infNorm()
Returns the l -norm. |
AbstractDoubleVector |
mapElements(PrimitiveMapping f)
Applies a function on all the vector components. |
double |
mass()
Returns the mass. |
double |
max()
Gets the max of the vector components. |
double |
mean()
Gets the mean of the vector components. |
double |
min()
Gets the min of the vector components. |
Ring.Member |
multiply(Ring.Member r)
The multiplication law. |
double |
norm()
Returns the l2-norm (magnitude). |
double |
norm(int n)
Returns the ln-norm. |
void |
normalize()
Makes the norm of this vector equal to one. |
static AbstractDoubleVector |
read(java.io.BufferedReader input)
Read a vector from a stream. |
AbstractDoubleVector |
reverse()
Invert vector elements order from the last to the first. |
AbstractDoubleVector |
scalarDivide(double x)
Returns the division of this vector by a scalar. |
AbstractDoubleVector |
scalarMultiply(double x)
Returns the multiplication of this vector by a scalar. |
double |
scalarProduct(AbstractDoubleVector v)
Returns the scalar product of this vector and another. |
void |
setAllElements(double r)
Sets the value of all elements of the vector. |
void |
setColumn(int j,
AbstractDoubleVector v)
Returns the ith column. |
abstract void |
setElement(int n,
double x)
Sets the value of an element of this vector. |
void |
setElement(int n,
Double x)
Sets the value of a component of this vector. |
void |
setRow(int i,
AbstractDoubleVector v)
Returns the ith row. |
AbstractDoubleVector |
setSubVector(int k,
AbstractDoubleVector v)
Set a sub vector. |
double |
standardDeviation()
Computes the (bias-corrected sample) standard deviation . |
AbstractDoubleVector |
subtract(AbstractDoubleVector v)
Returns the subtraction of this vector by another. |
double |
sumSquares()
Returns the sum of the squares of the components. |
DoubleMatrix |
tensorProduct(AbstractDoubleVector v)
Returns the tensor product of this vector and another. |
AbstractComplexVector |
toComplexVector()
Converts this vector to a complex vector. |
AbstractIntegerVector |
toIntegerVector()
Converts this vector to a integer vector. |
Matrix |
toMatrix()
Projects the vector to the corresponding (n, 1) matrix class. |
double[] |
toPrimitiveArray()
Projects the vector to an array. |
java.lang.String |
toString()
Returns a comma delimited string representing the value of this vector. |
Matrix |
transpose()
Returns the transpose of this matrix. |
double |
variance()
Computes the (bias-corrected sample) variance. |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractVector |
|---|
getDimension, getElement, getInvalidElementMsg, toArray, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractMatrix |
|---|
getElement, getInvalidElementMsg, numColumns, numRows, print, print, print, print, toArray |
| Methods inherited from class org.jscience.mathematics.algebraic.AbstractHypermatrix |
|---|
getDimensions, numDimensions, numElements, numElements, toArray |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jscience.mathematics.algebraic.modules.VectorSpace.Member |
|---|
scalarDivide |
| Methods inherited from interface org.jscience.mathematics.algebraic.modules.Module.Member |
|---|
scalarMultiply |
| Methods inherited from interface org.jscience.mathematics.algebraic.groups.AbelianGroup.Member |
|---|
add, negate, subtract |
| Methods inherited from interface org.jscience.mathematics.algebraic.Matrix |
|---|
numColumns, numRows, toArray |
| Methods inherited from interface org.jscience.mathematics.algebraic.Hypermatrix |
|---|
getDimensions, getElement, numDimensions, numElements, numElements, toArray |
| Constructor Detail |
|---|
protected AbstractDoubleVector(int dim)
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic AbstractIntegerVector toIntegerVector()
public AbstractComplexVector toComplexVector()
public abstract double getPrimitiveElement(int n)
n - index of the vector element.
IllegalDimensionException - If attempting to access an invalid element.public Double getElement(int n)
getElement in interface VectorgetElement in class AbstractVectorn - index of the vector element.
IllegalDimensionException - If attempting to access an invalid element.public AbstractDoubleVector getRow(int i)
getRow in interface Matrixi - DOCUMENT ME!
public AbstractDoubleVector getColumn(int j)
getColumn in interface Matrixj - DOCUMENT ME!
public void setRow(int i,
AbstractDoubleVector v)
public void setColumn(int j,
AbstractDoubleVector v)
public abstract void setElement(int n,
double x)
n - index of the vector element.x - a number.
IllegalDimensionException - If attempting to access an invalid element.
public void setElement(int n,
Double x)
n - index of the vector componentx - an double
IllegalDimensionException - If attempting to access an invalid
component.public void setAllElements(double r)
r - a ring elementpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - a double vector
public boolean equals(java.lang.Object obj,
double tol)
public double sumSquares()
public double mass()
public double norm(int n)
public double norm()
norm in interface BanachSpace.Memberpublic void normalize()
public double infNorm()
-norm.
public AbstractDoubleVector abs()
public double min()
public double max()
public double mean()
public double variance()
public double standardDeviation()
public Matrix transpose()
Matrix
transpose in interface Matrixpublic Ring.Member multiply(Ring.Member r)
Ring.Member
multiply in interface Ring.Memberr - a ring member
public AbstractDoubleVector add(AbstractDoubleVector v)
v - a double vector.
IllegalDimensionException - If the vectors are different sizes.public AbstractDoubleVector subtract(AbstractDoubleVector v)
v - a double vector.
IllegalDimensionException - If the vectors are different sizes.public AbstractDoubleVector scalarMultiply(double x)
x - a double.public AbstractDoubleVector scalarDivide(double x)
x - a double.
java.lang.ArithmeticException - If divide by zero.public double scalarProduct(AbstractDoubleVector v)
v - a double vector.
IllegalDimensionException - If the vectors are different sizes.public DoubleMatrix tensorProduct(AbstractDoubleVector v)
v - DOCUMENT ME!
public AbstractDoubleVector reverse()
public AbstractDoubleVector getSubVector(int k1,
int k2)
k1 - the beginning indexk2 - the finishing index
public AbstractDoubleVector setSubVector(int k,
AbstractDoubleVector v)
k - Initial row index to offset the patching vectorv - the patching vectorpublic AbstractDoubleVector mapElements(PrimitiveMapping f)
f - a user-defined function.
public double[] toPrimitiveArray()
public Matrix toMatrix()
public static AbstractDoubleVector read(java.io.BufferedReader input)
throws java.io.IOException
input - the input stream.
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||