RealVector interface with a double array.
| Modifier and Type | Field and Description |
|---|---|
| private double[] | data
Entries of the vector. |
| private static final RealVectorFormat | DEFAULT_FORMAT
Default format. |
| private static final long | serialVersionUID
Serializable version identifier. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | ArrayRealVector(int
Size of the vector size, double All entries will be set with this value. preset)Construct a vector with preset values. |
| public | |
| public | ArrayRealVector(double[]
Data for the new vector. d, boolean if copyArray)true, the input array will be copied,
otherwise it will be referenced.Create a new ArrayRealVector using the input array as the underlying data array. |
| public | ArrayRealVector(double[]
Array. d, int Position of first entry. pos, int Number of entries to copy. size)Construct a vector from part of a array. |
| public | |
| public | ArrayRealVector(Double[]
Array. d, int Position of first entry. pos, int Number of entries to copy. size)Construct a vector from part of an array. |
| public | ArrayRealVector(RealVector
vector to copy. v)Construct a vector from another vector, using a deep copy. |
| public | ArrayRealVector(ArrayRealVector
Vector to copy. v)Construct a vector from another vector, using a deep copy. |
| public | ArrayRealVector(ArrayRealVector
Vector to copy. v, boolean If deep)true perform a deep copy, otherwise perform a
shallow copy.Construct a vector from another vector. |
| public | ArrayRealVector(ArrayRealVector
First vector (will be put in front of the new vector). v1, ArrayRealVector Second vector (will be put at back of the new vector). v2)Construct a vector by appending one vector to another vector. |
| public | ArrayRealVector(ArrayRealVector
First vector (will be put in front of the new vector). v1, RealVector Second vector (will be put at back of the new vector). v2)Construct a vector by appending one vector to another vector. |
| public | ArrayRealVector(RealVector
First vector (will be put in front of the new vector). v1, ArrayRealVector Second vector (will be put at back of the new vector). v2)Construct a vector by appending one vector to another vector. |
| public | ArrayRealVector(ArrayRealVector
First vector (will be put in front of the new vector). v1, double[] Second vector (will be put at back of the new vector). v2)Construct a vector by appending one vector to another vector. |
| public | ArrayRealVector(double[]
First vector (will be put in front of the new vector). v1, ArrayRealVector Second vector (will be put at back of the new vector). v2)Construct a vector by appending one vector to another vector. |
| public | ArrayRealVector(double[]
first vector (will be put in front of the new vector) v1, double[] second vector (will be put at back of the new vector) v2)Construct a vector by appending one vector to another vector. |
| Modifier and Type | Method and Description |
|---|---|
| public ArrayRealVector | add(RealVector
Vector to be added. v)Overrides org. Compute the sum of this vector and |
| public void | addToEntry(int
Index location of entry to be set. index, double Value to add to the vector entry. increment)Overrides org. Change an entry at the specified index. |
| public RealVector | append(RealVector
vector to append to this one. v)Implements abstract org. Construct a new vector by appending a vector to this vector. |
| public ArrayRealVector | Returns: a new vector.Vector to append to this one. v)Construct a vector by appending a vector to this vector. |
| public RealVector | append(double
double to append. in)Implements abstract org. Construct a new vector by appending a double to this vector. |
| protected void | checkVectorDimensions(RealVector
Vector to compare instance with. v)Overrides org. Check if instance and specified vectors have the same dimension. |
| protected void | checkVectorDimensions(int
Expected dimension. n)Overrides org. Check if instance dimension is equal to some expected value. |
| public ArrayRealVector | combine(double
Coefficient of a, double this.Coefficient of b, RealVector y.Vector with which y)this is linearly combined.Overrides org. Returns a new vector representing |
| public ArrayRealVector | combineToSelf(double
Weight of a, double this.Weight of b, RealVector y.Vector with which y)this is linearly combined.Overrides org. Updates |
| public ArrayRealVector | copy()
Implements abstract org. Returns a (deep) copy of this vector. |
| public double | dotProduct(RealVector
Vector with which dot product should be computed v)Overrides org. Compute the dot product of this vector with |
| public ArrayRealVector | ebeDivide(RealVector
Vector by which instance elements must be divided. v)Implements abstract org. Element-by-element division. |
| public ArrayRealVector | ebeMultiply(RealVector
Vector by which instance elements must be multiplied v)Implements abstract org. Element-by-element multiplication. |
| public boolean | equals(Object
Object to test for equality. other)Overrides org. Test for the equality of two real vectors. |
| public double[] | |
| public int | getDimension()
Implements abstract org. Returns the size of the vector. |
| public double | getDistance(RealVector
Vector to which distance is requested. v)Overrides org. Distance between two vectors. |
| public double | getEntry(int
Index location of entry to be fetched. index)Implements abstract org. Return the entry at the specified index. |
| public double | getL1Distance(RealVector
Vector to which distance is requested. v)Overrides org. Distance between two vectors. |
| public double | getL1Norm()
Overrides org. Returns the L1 norm of the vector. |
| public double | getLInfDistance(RealVector
Vector to which distance is requested. v)Overrides org. Distance between two vectors. |
| public double | getLInfNorm()
Overrides org. Returns the L∞ norm of the vector. |
| public double | getNorm()
Overrides org. Returns the L2 norm of the vector. |
| public RealVector | getSubVector(int
index of first element. index, int number of elements to be retrieved. n)Implements abstract org. Get a subvector from consecutive elements. |
| public int | hashCode()
Overrides org. Returns a hash code value for this object. |
| public boolean | Returns: true if any coordinate of this vector is infinite and
none are NaN, false otherwise.Implements abstract org. Check whether any coordinate of this vector is infinite and none
are |
| public boolean | Returns: true if any coordinate of this vector is NaN,
false otherwise.Implements abstract org. Check if any coordinate of this vector is |
| public ArrayRealVector | map(UnivariateFunction
Function to apply to each entry. function)Overrides org. Acts as if implemented as: return copy().mapToSelf(function); |
| public RealVector | mapAddToSelf(double
Value to be added to each entry. d)Overrides org. Add a value to each entry. |
| public RealVector | mapDivideToSelf(double
Value to divide by. d)Overrides org. Divide each entry by the argument. |
| public RealVector | mapMultiplyToSelf(double
Multiplication factor. d)Overrides org. Multiply each entry. |
| public RealVector | mapSubtractToSelf(double
Value to be subtracted. d)Overrides org. Subtract a value from each entry. |
| public ArrayRealVector | mapToSelf(UnivariateFunction
Function to apply to each entry. function)Overrides org. Acts as if it is implemented as:
Entry e = null;
for(Iterator<entry> it = iterator(); it.hasNext(); e = it.next()) {
e.setValue(function.value(e.getValue()));
}
|
| public RealMatrix | outerProduct(RealVector
Vector with which outer product should be computed. v)Overrides org. Compute the outer product. |
| public void | set(double
Single value to set for all elements. value)Overrides org. Set all elements to a single value. |
| public void | setEntry(int
element index. index, double new value for the element. value)Implements abstract org. Set a single element. |
| public void | setSubVector(int
index of first element to be set. index, RealVector vector containing the values to set. v)Implements abstract org. Set a sequence of consecutive elements. |
| public void | setSubVector(int
Index of first element to be set. index, double[] Vector containing the values to set. v)Set a set of consecutive elements. |
| public ArrayRealVector | subtract(RealVector
Vector to be subtracted. v)Overrides org. Subtract |
| public double[] | toArray()
Overrides org. Convert the vector to an array of |
| public String | |
| public double | walkInDefaultOrder(final RealVectorPreservingVisitor
the visitor to be used to process the entries of this
vector visitor)Overrides org. Visits (but does not alter) all entries of this vector in default order (increasing index). |
| public double | walkInDefaultOrder(final RealVectorPreservingVisitor
visitor to be used to process the entries of this vector visitor, final int the index of the first entry to be visited start, final int the index of the last entry to be visited (inclusive) end)Overrides org. Visits (but does not alter) some entries of this vector in default order (increasing index). |
| public double | walkInDefaultOrder(final RealVectorChangingVisitor
the visitor to be used to process and modify the entries
of this vector visitor)Overrides org. Visits (and possibly alters) all entries of this vector in default order (increasing index). |
| public double | walkInDefaultOrder(final RealVectorChangingVisitor
visitor to be used to process the entries of this vector visitor, final int the index of the first entry to be visited start, final int the index of the last entry to be visited (inclusive) end)Overrides org. Visits (and possibly alters) some entries of this vector in default order (increasing index). |
| public double | walkInOptimizedOrder(final RealVectorPreservingVisitor
the visitor to be used to process the entries of this
vector visitor)Overrides org. Visits (but does not alter) all entries of this vector in optimized order. |
| public double | walkInOptimizedOrder(final RealVectorPreservingVisitor
visitor to be used to process the entries of this vector visitor, final int the index of the first entry to be visited start, final int the index of the last entry to be visited (inclusive) end)Overrides org. Visits (but does not alter) some entries of this vector in optimized order. |
| public double | walkInOptimizedOrder(final RealVectorChangingVisitor
the visitor to be used to process the entries of this
vector visitor)Overrides org. Visits (and possibly alters) all entries of this vector in optimized order. |
| public double | walkInOptimizedOrder(final RealVectorChangingVisitor
visitor to be used to process the entries of this vector visitor, final int the index of the first entry to be visited start, final int the index of the last entry to be visited (inclusive) end)Overrides org. Visits (and possibly change) some entries of this vector in optimized order. |