|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.math.linear.OpenMapRealVector
public class OpenMapRealVector
This class implements the RealVector interface with a OpenIntToDoubleHashMap backing store.
| Field Summary | |
|---|---|
static double |
DEFAULT_ZERO_TOLERANCE
Default Tolerance for having a value considered zero. |
| Constructor Summary | |
|---|---|
|
OpenMapRealVector()
Build a 0-length vector. |
|
OpenMapRealVector(double[] values)
Create from a double array. |
|
OpenMapRealVector(java.lang.Double[] values)
Create from a Double array. |
|
OpenMapRealVector(double[] values,
double epsilon)
Create from a double array, specifying zero tolerance. |
|
OpenMapRealVector(java.lang.Double[] values,
double epsilon)
Create from a Double array. |
|
OpenMapRealVector(int dimension)
Construct a (dimension)-length vector of zeros. |
|
OpenMapRealVector(int dimension,
double epsilon)
Construct a (dimension)-length vector of zeros, specifying zero tolerance. |
|
OpenMapRealVector(int dimension,
int expectedSize)
Build a vector with known the sparseness (for advanced use only). |
|
OpenMapRealVector(int dimension,
int expectedSize,
double epsilon)
Build a vector with known the sparseness and zero tolerance setting (for advanced use only). |
|
OpenMapRealVector(OpenMapRealVector v)
Copy constructor. |
protected |
OpenMapRealVector(OpenMapRealVector v,
int resize)
Build a resized vector, for use with append. |
|
OpenMapRealVector(RealVector v)
Generic copy constructor. |
| Method Summary | |
|---|---|
OpenMapRealVector |
add(double[] v)
Compute the sum of this and v. |
OpenMapRealVector |
add(OpenMapRealVector v)
Optimized method to add two OpenMapRealVectors. |
OpenMapRealVector |
add(RealVector v)
Compute the sum of this and v. |
OpenMapRealVector |
append(double d)
Construct a vector by appending a double to this vector. |
OpenMapRealVector |
append(double[] a)
Construct a vector by appending a double array to this vector. |
OpenMapRealVector |
append(OpenMapRealVector v)
Optimized method to append a OpenMapRealVector. |
OpenMapRealVector |
append(RealVector v)
Construct a vector by appending a vector to this vector. |
protected void |
checkVectorDimensions(int n)
Check if instance dimension is equal to some expected value. |
OpenMapRealVector |
copy()
Returns a (deep) copy of this. |
double |
dotProduct(double[] v)
Compute the dot product. |
double |
dotProduct(RealVector v)
Compute the dot product. |
OpenMapRealVector |
ebeDivide(double[] v)
Element-by-element division. |
OpenMapRealVector |
ebeDivide(RealVector v)
Element-by-element division. |
OpenMapRealVector |
ebeMultiply(double[] v)
Element-by-element multiplication. |
OpenMapRealVector |
ebeMultiply(RealVector v)
Element-by-element multiplication. |
boolean |
equals(java.lang.Object obj)
Implementation Note: This performs an exact comparison, and as a result it is possible for a.subtract(b} to be the zero vector, while
a.equals(b) == false. |
double[] |
getData()
Returns vector entries as a double array. |
int |
getDimension()
Returns the size of the vector. |
double |
getDistance(double[] v)
Distance between two vectors. |
double |
getDistance(OpenMapRealVector v)
Optimized method to compute distance. |
double |
getDistance(RealVector v)
Distance between two vectors. |
double |
getEntry(int index)
Returns the entry in the specified index. |
double |
getEpsilon()
Get the tolerance for having a value considered zero. |
double |
getL1Distance(double[] v)
Distance between two vectors. |
double |
getL1Distance(OpenMapRealVector v)
Distance between two vectors. |
double |
getL1Distance(RealVector v)
Distance between two vectors. |
double |
getL1Norm()
Returns the L1 norm of the vector. |
double |
getLInfDistance(double[] v)
Distance between two vectors. |
double |
getLInfDistance(RealVector v)
Distance between two vectors. |
double |
getLInfNorm()
Returns the L∞ norm of the vector. |
double |
getNorm()
Returns the L2 norm of the vector. |
double |
getSparcity()
|
OpenMapRealVector |
getSubVector(int index,
int n)
Get a subvector from consecutive elements. |
int |
hashCode()
|
boolean |
isInfinite()
Returns true if any coordinate of this vector is infinite and none are NaN; false otherwise |
boolean |
isNaN()
Returns true if any coordinate of this vector is NaN; false otherwise |
protected boolean |
isZero(double value)
Determine if this value is zero. |
OpenMapRealVector |
mapAbs()
Map the Math.abs(double) function to each entry. |
OpenMapRealVector |
mapAbsToSelf()
Map the Math.abs(double) function to each entry. |
OpenMapRealVector |
mapAcos()
Map the Math.acos(double) function to each entry. |
OpenMapRealVector |
mapAcosToSelf()
Map the Math.acos(double) function to each entry. |
OpenMapRealVector |
mapAdd(double d)
Map an addition operation to each entry. |
OpenMapRealVector |
mapAddToSelf(double d)
Map an addition operation to each entry. |
OpenMapRealVector |
mapAsin()
Map the Math.asin(double) function to each entry. |
OpenMapRealVector |
mapAsinToSelf()
Map the Math.asin(double) function to each entry. |
OpenMapRealVector |
mapAtan()
Map the Math.atan(double) function to each entry. |
OpenMapRealVector |
mapAtanToSelf()
Map the Math.atan(double) function to each entry. |
OpenMapRealVector |
mapCbrt()
Map the Math.cbrt(double) function to each entry. |
OpenMapRealVector |
mapCbrtToSelf()
Map the Math.cbrt(double) function to each entry. |
OpenMapRealVector |
mapCeil()
Map the Math.ceil(double) function to each entry. |
OpenMapRealVector |
mapCeilToSelf()
Map the Math.ceil(double) function to each entry. |
OpenMapRealVector |
mapCos()
Map the Math.cos(double) function to each entry. |
OpenMapRealVector |
mapCosh()
Map the Math.cosh(double) function to each entry. |
OpenMapRealVector |
mapCoshToSelf()
Map the Math.cosh(double) function to each entry. |
OpenMapRealVector |
mapCosToSelf()
Map the Math.cos(double) function to each entry. |
OpenMapRealVector |
mapDivide(double d)
Map a division operation to each entry. |
OpenMapRealVector |
mapDivideToSelf(double d)
Map a division operation to each entry. |
OpenMapRealVector |
mapExp()
Map the Math.exp(double) function to each entry. |
OpenMapRealVector |
mapExpm1()
Map the Math.expm1(double) function to each entry. |
OpenMapRealVector |
mapExpm1ToSelf()
Map the Math.expm1(double) function to each entry. |
OpenMapRealVector |
mapExpToSelf()
Map the Math.exp(double) function to each entry. |
OpenMapRealVector |
mapFloor()
Map the Math.floor(double) function to each entry. |
OpenMapRealVector |
mapFloorToSelf()
Map the Math.floor(double) function to each entry. |
OpenMapRealVector |
mapInv()
Map the 1/x function to each entry. |
OpenMapRealVector |
mapInvToSelf()
Map the 1/x function to each entry. |
OpenMapRealVector |
mapLog()
Map the Math.log(double) function to each entry. |
OpenMapRealVector |
mapLog10()
Map the Math.log10(double) function to each entry. |
OpenMapRealVector |
mapLog10ToSelf()
Map the Math.log10(double) function to each entry. |
OpenMapRealVector |
mapLog1p()
Map the Math.log1p(double) function to each entry. |
OpenMapRealVector |
mapLog1pToSelf()
Map the Math.log1p(double) function to each entry. |
OpenMapRealVector |
mapLogToSelf()
Map the Math.log(double) function to each entry. |
OpenMapRealVector |
mapMultiply(double d)
Map a multiplication operation to each entry. |
OpenMapRealVector |
mapMultiplyToSelf(double d)
Map a multiplication operation to each entry. |
OpenMapRealVector |
mapPow(double d)
Map a power operation to each entry. |
OpenMapRealVector |
mapPowToSelf(double d)
Map a power operation to each entry. |
OpenMapRealVector |
mapRint()
Map the Math.rint(double) function to each entry. |
OpenMapRealVector |
mapRintToSelf()
Map the Math.rint(double) function to each entry. |
OpenMapRealVector |
mapSignum()
Map the Math.signum(double) function to each entry. |
OpenMapRealVector |
mapSignumToSelf()
Map the Math.signum(double) function to each entry. |
OpenMapRealVector |
mapSin()
Map the Math.sin(double) function to each entry. |
OpenMapRealVector |
mapSinh()
Map the Math.sinh(double) function to each entry. |
OpenMapRealVector |
mapSinhToSelf()
Map the Math.sinh(double) function to each entry. |
OpenMapRealVector |
mapSinToSelf()
Map the Math.sin(double) function to each entry. |
OpenMapRealVector |
mapSqrt()
Map the Math.sqrt(double) function to each entry. |
OpenMapRealVector |
mapSqrtToSelf()
Map the Math.sqrt(double) function to each entry. |
OpenMapRealVector |
mapSubtract(double d)
Map a subtraction operation to each entry. |
OpenMapRealVector |
mapSubtractToSelf(double d)
Map a subtraction operation to each entry. |
OpenMapRealVector |
mapTan()
Map the Math.tan(double) function to each entry. |
OpenMapRealVector |
mapTanh()
Map the Math.tanh(double) function to each entry. |
OpenMapRealVector |
mapTanhToSelf()
Map the Math.tanh(double) function to each entry. |
OpenMapRealVector |
mapTanToSelf()
Map the Math.tan(double) function to each entry. |
OpenMapRealVector |
mapUlp()
Map the Math.ulp(double) function to each entry. |
OpenMapRealVector |
mapUlpToSelf()
Map the Math.ulp(double) function to each entry. |
RealMatrix |
outerProduct(double[] v)
Compute the outer product. |
OpenMapRealMatrix |
outerproduct(OpenMapRealVector v)
Optimized method to compute the outer product. |
RealMatrix |
outerProduct(RealVector v)
Compute the outer product. |
OpenMapRealVector |
projection(double[] v)
Find the orthogonal projection of this vector onto another vector. |
RealVector |
projection(RealVector v)
Find the orthogonal projection of this vector onto another vector. |
void |
set(double value)
Set all elements to a single value. |
void |
setEntry(int index,
double value)
Set a single element. |
void |
setEpsilon(double epsilon)
Set the tolerance for having a value considered zero. |
void |
setSubVector(int index,
double[] v)
Set a set of consecutive elements. |
void |
setSubVector(int index,
RealVector v)
Set a set of consecutive elements. |
OpenMapRealVector |
subtract(double[] v)
Compute this minus v. |
OpenMapRealVector |
subtract(OpenMapRealVector v)
Optimized method to subtract OpenMapRealVectors. |
OpenMapRealVector |
subtract(RealVector v)
Compute this minus v. |
double[] |
toArray()
Convert the vector to a double array. |
void |
unitize()
Converts this vector into a unit vector. |
OpenMapRealVector |
unitVector()
Creates a unit vector pointing in the direction of this vector. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_ZERO_TOLERANCE
| Constructor Detail |
|---|
public OpenMapRealVector()
Zero-length vectors may be used to initialized construction of vectors
by data gathering. We start with zero-length and use either the OpenMapRealVector(OpenMapRealVector, int) constructor
or one of the append method (append(double), append(double[]), append(RealVector)) to gather data
into this vector.
public OpenMapRealVector(int dimension)
dimension - size of the vector
public OpenMapRealVector(int dimension,
double epsilon)
dimension - Size of the vectorepsilon - The tolerance for having a value considered zero
protected OpenMapRealVector(OpenMapRealVector v,
int resize)
v - The original vectorresize - The amount to resize it
public OpenMapRealVector(int dimension,
int expectedSize)
dimension - The size of the vectorexpectedSize - The expected number of non-zero entries
public OpenMapRealVector(int dimension,
int expectedSize,
double epsilon)
dimension - The size of the vectorexpectedSize - The expected number of non-zero entriesepsilon - The tolerance for having a value considered zeropublic OpenMapRealVector(double[] values)
values - The set of values to create from
public OpenMapRealVector(double[] values,
double epsilon)
values - The set of values to create fromepsilon - The tolerance for having a value considered zeropublic OpenMapRealVector(java.lang.Double[] values)
values - The set of values to create from
public OpenMapRealVector(java.lang.Double[] values,
double epsilon)
values - The set of values to create fromepsilon - The tolerance for having a value considered zeropublic OpenMapRealVector(OpenMapRealVector v)
v - The instance to copy frompublic OpenMapRealVector(RealVector v)
v - The instance to copy from| Method Detail |
|---|
protected boolean isZero(double value)
value - The value to test
true if this value is zero, false otherwisepublic double getEpsilon()
public void setEpsilon(double epsilon)
epsilon - The test range for testing if a value is zero
public OpenMapRealVector add(RealVector v)
throws java.lang.IllegalArgumentException
add in interface RealVectorv - vector to be added
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector add(OpenMapRealVector v)
throws java.lang.IllegalArgumentException
v - Vector to add with
this with v
java.lang.IllegalArgumentException - If the dimensions don't match
public OpenMapRealVector add(double[] v)
throws java.lang.IllegalArgumentException
add in interface RealVectorv - vector to be added
java.lang.IllegalArgumentException - if v is not the same size as thispublic OpenMapRealVector append(OpenMapRealVector v)
v - vector to append
v to selfpublic OpenMapRealVector append(RealVector v)
append in interface RealVectorv - vector to append to this one.
public OpenMapRealVector append(double d)
append in interface RealVectord - double to append.
public OpenMapRealVector append(double[] a)
append in interface RealVectora - double array to append.
public OpenMapRealVector copy()
copy in interface RealVector
public double dotProduct(RealVector v)
throws java.lang.IllegalArgumentException
dotProduct in interface RealVectorv - vector with which dot product should be computed
java.lang.IllegalArgumentException - if v is not the same size as this
public double dotProduct(double[] v)
throws java.lang.IllegalArgumentException
dotProduct in interface RealVectorv - vector with which dot product should be computed
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector ebeDivide(RealVector v)
throws java.lang.IllegalArgumentException
ebeDivide in interface RealVectorv - vector by which instance elements must be divided
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector ebeDivide(double[] v)
throws java.lang.IllegalArgumentException
ebeDivide in interface RealVectorv - vector by which instance elements must be divided
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector ebeMultiply(RealVector v)
throws java.lang.IllegalArgumentException
ebeMultiply in interface RealVectorv - vector by which instance elements must be multiplied
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector ebeMultiply(double[] v)
throws java.lang.IllegalArgumentException
ebeMultiply in interface RealVectorv - vector by which instance elements must be multiplied
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector getSubVector(int index,
int n)
throws MatrixIndexException
getSubVector in interface RealVectorindex - index of first element.n - number of elements to be retrieved.
MatrixIndexException - if the index is
inconsistent with vector sizepublic double[] getData()
getData in interface RealVectorpublic int getDimension()
getDimension in interface RealVector
public double getDistance(OpenMapRealVector v)
throws java.lang.IllegalArgumentException
v - The vector to compute distance to
this and v
java.lang.IllegalArgumentException - If the dimensions don't match
public double getDistance(RealVector v)
throws java.lang.IllegalArgumentException
This method computes the distance consistent with the L2 norm, i.e. the square root of the sum of elements differences, or euclidian distance.
getDistance in interface RealVectorv - vector to which distance is requested
java.lang.IllegalArgumentException - if v is not the same size as thisRealVector.getL1Distance(RealVector),
RealVector.getLInfDistance(RealVector),
RealVector.getNorm()
public double getDistance(double[] v)
throws java.lang.IllegalArgumentException
This method computes the distance consistent with the L2 norm, i.e. the square root of the sum of elements differences, or euclidian distance.
getDistance in interface RealVectorv - vector to which distance is requested
java.lang.IllegalArgumentException - if v is not the same size as thisRealVector.getL1Distance(double[]),
RealVector.getLInfDistance(double[]),
RealVector.getNorm()
public double getEntry(int index)
throws MatrixIndexException
The index start at 0 and must be lesser than the size,
otherwise a MatrixIndexException is thrown.
getEntry in interface RealVectorindex - index location of entry to be fetched
MatrixIndexException - if the index is not validRealVector.setEntry(int, double)public double getL1Distance(OpenMapRealVector v)
This method computes the distance consistent with L1 norm, i.e. the sum of the absolute values of elements differences.
v - vector to which distance is requested
public double getL1Distance(RealVector v)
throws java.lang.IllegalArgumentException
This method computes the distance consistent with L1 norm, i.e. the sum of the absolute values of elements differences.
getL1Distance in interface RealVectorv - vector to which distance is requested
java.lang.IllegalArgumentException - if v is not the same size as thisRealVector.getDistance(RealVector),
RealVector.getLInfDistance(RealVector),
RealVector.getL1Norm()
public double getL1Distance(double[] v)
throws java.lang.IllegalArgumentException
This method computes the distance consistent with L1 norm, i.e. the sum of the absolute values of elements differences.
getL1Distance in interface RealVectorv - vector to which distance is requested
java.lang.IllegalArgumentException - if v is not the same size as thisRealVector.getDistance(double[]),
RealVector.getLInfDistance(double[]),
RealVector.getL1Norm()public double getL1Norm()
The L1 norm is the sum of the absolute values of elements.
getL1Norm in interface RealVectorRealVector.getNorm(),
RealVector.getLInfNorm(),
RealVector.getL1Distance(RealVector)
public double getLInfDistance(RealVector v)
throws java.lang.IllegalArgumentException
This method computes the distance consistent with L∞ norm, i.e. the max of the absolute values of elements differences.
getLInfDistance in interface RealVectorv - vector to which distance is requested
java.lang.IllegalArgumentException - if v is not the same size as thisRealVector.getDistance(RealVector),
RealVector.getL1Distance(RealVector),
RealVector.getLInfNorm()
public double getLInfDistance(double[] v)
throws java.lang.IllegalArgumentException
This method computes the distance consistent with L∞ norm, i.e. the max of the absolute values of elements differences.
getLInfDistance in interface RealVectorv - vector to which distance is requested
java.lang.IllegalArgumentException - if v is not the same size as thisRealVector.getDistance(double[]),
RealVector.getL1Distance(double[]),
RealVector.getLInfNorm()public double getLInfNorm()
The L∞ norm is the max of the absolute values of elements.
getLInfNorm in interface RealVectorRealVector.getNorm(),
RealVector.getL1Norm(),
RealVector.getLInfDistance(RealVector)public double getNorm()
The L2 norm is the root of the sum of the squared elements.
getNorm in interface RealVectorRealVector.getL1Norm(),
RealVector.getLInfNorm(),
RealVector.getDistance(RealVector)public boolean isInfinite()
isInfinite in interface RealVectorpublic boolean isNaN()
isNaN in interface RealVectorpublic OpenMapRealVector mapAbs()
Math.abs(double) function to each entry.
mapAbs in interface RealVectorpublic OpenMapRealVector mapAbsToSelf()
Math.abs(double) function to each entry.
The instance is changed by this method.
mapAbsToSelf in interface RealVectorpublic OpenMapRealVector mapAcos()
Math.acos(double) function to each entry.
mapAcos in interface RealVectorpublic OpenMapRealVector mapAcosToSelf()
Math.acos(double) function to each entry.
The instance is changed by this method.
mapAcosToSelf in interface RealVectorpublic OpenMapRealVector mapAdd(double d)
mapAdd in interface RealVectord - value to be added to each entry
public OpenMapRealVector mapAddToSelf(double d)
The instance is changed by this method.
mapAddToSelf in interface RealVectord - value to be added to each entry
public OpenMapRealVector mapAsin()
Math.asin(double) function to each entry.
mapAsin in interface RealVectorpublic OpenMapRealVector mapAsinToSelf()
Math.asin(double) function to each entry.
The instance is changed by this method.
mapAsinToSelf in interface RealVectorpublic OpenMapRealVector mapAtan()
Math.atan(double) function to each entry.
mapAtan in interface RealVectorpublic OpenMapRealVector mapAtanToSelf()
Math.atan(double) function to each entry.
The instance is changed by this method.
mapAtanToSelf in interface RealVectorpublic OpenMapRealVector mapCbrt()
Math.cbrt(double) function to each entry.
mapCbrt in interface RealVectorpublic OpenMapRealVector mapCbrtToSelf()
Math.cbrt(double) function to each entry.
The instance is changed by this method.
mapCbrtToSelf in interface RealVectorpublic OpenMapRealVector mapCeil()
Math.ceil(double) function to each entry.
mapCeil in interface RealVectorpublic OpenMapRealVector mapCeilToSelf()
Math.ceil(double) function to each entry.
The instance is changed by this method.
mapCeilToSelf in interface RealVectorpublic OpenMapRealVector mapCos()
Math.cos(double) function to each entry.
mapCos in interface RealVectorpublic OpenMapRealVector mapCosToSelf()
Math.cos(double) function to each entry.
The instance is changed by this method.
mapCosToSelf in interface RealVectorpublic OpenMapRealVector mapCosh()
Math.cosh(double) function to each entry.
mapCosh in interface RealVectorpublic OpenMapRealVector mapCoshToSelf()
Math.cosh(double) function to each entry.
The instance is changed by this method.
mapCoshToSelf in interface RealVectorpublic OpenMapRealVector mapDivide(double d)
mapDivide in interface RealVectord - value to divide all entries by
public OpenMapRealVector mapDivideToSelf(double d)
The instance is changed by this method.
mapDivideToSelf in interface RealVectord - value to divide all entries by
public OpenMapRealVector mapExp()
Math.exp(double) function to each entry.
mapExp in interface RealVectorpublic OpenMapRealVector mapExpToSelf()
Math.exp(double) function to each entry.
The instance is changed by this method.
mapExpToSelf in interface RealVectorpublic OpenMapRealVector mapExpm1()
Math.expm1(double) function to each entry.
mapExpm1 in interface RealVectorpublic OpenMapRealVector mapExpm1ToSelf()
Math.expm1(double) function to each entry.
The instance is changed by this method.
mapExpm1ToSelf in interface RealVectorpublic OpenMapRealVector mapFloor()
Math.floor(double) function to each entry.
mapFloor in interface RealVectorpublic OpenMapRealVector mapFloorToSelf()
Math.floor(double) function to each entry.
The instance is changed by this method.
mapFloorToSelf in interface RealVectorpublic OpenMapRealVector mapInv()
mapInv in interface RealVectorpublic OpenMapRealVector mapInvToSelf()
The instance is changed by this method.
mapInvToSelf in interface RealVectorpublic OpenMapRealVector mapLog()
Math.log(double) function to each entry.
mapLog in interface RealVectorpublic OpenMapRealVector mapLog10()
Math.log10(double) function to each entry.
mapLog10 in interface RealVectorpublic OpenMapRealVector mapLog10ToSelf()
Math.log10(double) function to each entry.
The instance is changed by this method.
mapLog10ToSelf in interface RealVectorpublic OpenMapRealVector mapLog1p()
Math.log1p(double) function to each entry.
mapLog1p in interface RealVectorpublic OpenMapRealVector mapLog1pToSelf()
Math.log1p(double) function to each entry.
The instance is changed by this method.
mapLog1pToSelf in interface RealVectorpublic OpenMapRealVector mapLogToSelf()
Math.log(double) function to each entry.
The instance is changed by this method.
mapLogToSelf in interface RealVectorpublic OpenMapRealVector mapMultiply(double d)
mapMultiply in interface RealVectord - value to multiply all entries by
public OpenMapRealVector mapMultiplyToSelf(double d)
The instance is changed by this method.
mapMultiplyToSelf in interface RealVectord - value to multiply all entries by
public OpenMapRealVector mapPow(double d)
mapPow in interface RealVectord - value to raise all entries to
public OpenMapRealVector mapPowToSelf(double d)
The instance is changed by this method.
mapPowToSelf in interface RealVectord - value to raise all entries to
public OpenMapRealVector mapRint()
Math.rint(double) function to each entry.
mapRint in interface RealVectorpublic OpenMapRealVector mapRintToSelf()
Math.rint(double) function to each entry.
The instance is changed by this method.
mapRintToSelf in interface RealVectorpublic OpenMapRealVector mapSignum()
Math.signum(double) function to each entry.
mapSignum in interface RealVectorpublic OpenMapRealVector mapSignumToSelf()
Math.signum(double) function to each entry.
The instance is changed by this method.
mapSignumToSelf in interface RealVectorpublic OpenMapRealVector mapSin()
Math.sin(double) function to each entry.
mapSin in interface RealVectorpublic OpenMapRealVector mapSinToSelf()
Math.sin(double) function to each entry.
The instance is changed by this method.
mapSinToSelf in interface RealVectorpublic OpenMapRealVector mapSinh()
Math.sinh(double) function to each entry.
mapSinh in interface RealVectorpublic OpenMapRealVector mapSinhToSelf()
Math.sinh(double) function to each entry.
The instance is changed by this method.
mapSinhToSelf in interface RealVectorpublic OpenMapRealVector mapSqrt()
Math.sqrt(double) function to each entry.
mapSqrt in interface RealVectorpublic OpenMapRealVector mapSqrtToSelf()
Math.sqrt(double) function to each entry.
The instance is changed by this method.
mapSqrtToSelf in interface RealVectorpublic OpenMapRealVector mapSubtract(double d)
mapSubtract in interface RealVectord - value to be subtracted to each entry
public OpenMapRealVector mapSubtractToSelf(double d)
The instance is changed by this method.
mapSubtractToSelf in interface RealVectord - value to be subtracted to each entry
public OpenMapRealVector mapTan()
Math.tan(double) function to each entry.
mapTan in interface RealVectorpublic OpenMapRealVector mapTanToSelf()
Math.tan(double) function to each entry.
The instance is changed by this method.
mapTanToSelf in interface RealVectorpublic OpenMapRealVector mapTanh()
Math.tanh(double) function to each entry.
mapTanh in interface RealVectorpublic OpenMapRealVector mapTanhToSelf()
Math.tanh(double) function to each entry.
The instance is changed by this method.
mapTanhToSelf in interface RealVectorpublic OpenMapRealVector mapUlp()
Math.ulp(double) function to each entry.
mapUlp in interface RealVectorpublic OpenMapRealVector mapUlpToSelf()
Math.ulp(double) function to each entry.
The instance is changed by this method.
mapUlpToSelf in interface RealVector
public OpenMapRealMatrix outerproduct(OpenMapRealVector v)
throws java.lang.IllegalArgumentException
v - The vector to comput the outer product on
this and v
java.lang.IllegalArgumentException - If the dimensions don't match
public RealMatrix outerProduct(RealVector v)
throws java.lang.IllegalArgumentException
outerProduct in interface RealVectorv - vector with which outer product should be computed
java.lang.IllegalArgumentException - if v is not the same size as this
public RealMatrix outerProduct(double[] v)
throws java.lang.IllegalArgumentException
outerProduct in interface RealVectorv - vector with which outer product should be computed
java.lang.IllegalArgumentException - if v is not the same size as this
public RealVector projection(RealVector v)
throws java.lang.IllegalArgumentException
projection in interface RealVectorv - vector onto which instance must be projected
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector projection(double[] v)
throws java.lang.IllegalArgumentException
projection in interface RealVectorv - vector onto which instance must be projected
java.lang.IllegalArgumentException - if v is not the same size as this
public void setEntry(int index,
double value)
throws MatrixIndexException
setEntry in interface RealVectorindex - element index.value - new value for the element.
MatrixIndexException - if the index is
inconsistent with vector sizeRealVector.getEntry(int)
public void setSubVector(int index,
RealVector v)
throws MatrixIndexException
setSubVector in interface RealVectorindex - index of first element to be set.v - vector containing the values to set.
MatrixIndexException - if the index is
inconsistent with vector sizeRealVector.setSubVector(int, double[])
public void setSubVector(int index,
double[] v)
throws MatrixIndexException
setSubVector in interface RealVectorindex - index of first element to be set.v - vector containing the values to set.
MatrixIndexException - if the index is
inconsistent with vector sizeRealVector.setSubVector(int, RealVector)public void set(double value)
set in interface RealVectorvalue - single value to set for all elements
public OpenMapRealVector subtract(OpenMapRealVector v)
throws java.lang.IllegalArgumentException
v - The vector to subtract from this
this and v
java.lang.IllegalArgumentException - If the dimensions don't match
public OpenMapRealVector subtract(RealVector v)
throws java.lang.IllegalArgumentException
subtract in interface RealVectorv - vector to be subtracted
java.lang.IllegalArgumentException - if v is not the same size as this
public OpenMapRealVector subtract(double[] v)
throws java.lang.IllegalArgumentException
subtract in interface RealVectorv - vector to be subtracted
java.lang.IllegalArgumentException - if v is not the same size as thispublic OpenMapRealVector unitVector()
The instance is not changed by this method.
unitVector in interface RealVectorpublic void unitize()
The instance itself is changed by this method.
unitize in interface RealVector
protected void checkVectorDimensions(int n)
throws java.lang.IllegalArgumentException
n - expected dimension.
java.lang.IllegalArgumentException - if the dimension is inconsistent with vector sizepublic double[] toArray()
The array is independent from vector data, it's elements are copied.
toArray in interface RealVectorpublic int hashCode()
Implementation Note: This works on exact values, and as a result
it is possible for a.subtract(b) to be the zero vector, while
a.hashCode() != b.hashCode().
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
Implementation Note: This performs an exact comparison, and as a result
it is possible for a.subtract(b} to be the zero vector, while
a.equals(b) == false.
equals in class java.lang.Objectpublic double getSparcity()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||