public interface Vector extends HilbertSpace<Vector,Real>, DeepCopyable
set(int, double).
Other operations that "change" the vector actually creates a new and independent copy.| Modifier and Type | Method and Description |
|---|---|
Vector |
add(double c)
Add a constant to all entries in this vector.
|
Vector |
add(Vector that)
\(this + that\)
|
double |
angle(Vector that)
Measure the angle, \(\theta\), between
this and that. |
Vector |
deepCopy()
The implementation returns an instance created from
this by the copy
constructor of the class, or just this if the instance itself is
immutable. |
Vector |
divide(Vector that)
Divide
this by that, entry-by-entry. |
double |
get(int i)
Get the value at position i.
|
double |
innerProduct(Vector that)
Inner product in the Euclidean space is the dot product.
|
Vector |
minus(double c)
Subtract a constant from all entries in this vector.
|
Vector |
minus(Vector that)
\(this - that\)
|
Vector |
multiply(Vector that)
Multiply
this by that, entry-by-entry. |
double |
norm()
Compute the length or magnitude or Euclidean norm of a vector, namely, \(\|v\|\).
|
double |
norm(double p)
Gets the \(L^p\)-norm \(\|v\|_p\) of this vector.
|
Vector |
opposite()
Get the opposite of this vector.
|
Vector |
pow(double c)
Take the exponentiation of all entries in this vector, entry-by-entry.
|
Vector |
scaled(double c)
Scale this vector by a constant, entry-by-entry.
|
Vector |
scaled(Real c)
Scale this vector by a constant, entry-by-entry.
|
void |
set(int i,
double value)
Change the value of an entry in this vector.
|
int |
size()
Get the length of this vector.
|
double[] |
toArray()
Cast this vector into a 1D
double[]. |
Vector |
ZERO()
Get a 0-vector that has the same length as this vector.
|
int size()
double get(int i)
i - the position of a vector entryvoid set(int i,
double value)
i - the index of the entry to change. The indices are counting from 1, NOT 0.value - the value to change toVector add(Vector that)
add in interface AbelianGroup<Vector>that - a vectorVector minus(Vector that)
minus in interface AbelianGroup<Vector>that - a vectorVector multiply(Vector that)
this by that, entry-by-entry.that - a vectorVector divide(Vector that)
this by that, entry-by-entry.that - a vectorVector add(double c)
c - a constantVector minus(double c)
c - a constantdouble innerProduct(Vector that)
innerProduct in interface HilbertSpace<Vector,Real>that - a vectorVector pow(double c)
c - a constantVector scaled(double c)
vector.scaled(1. / vector.norm())
c - a constantVector scaled(Real c)
vector.scaled(1. / vector.norm())
scaled in interface VectorSpace<Vector,Real>c - a constantdouble norm()
norm in interface BanachSpace<Vector,Real>double norm(double p)
Double.POSITIVE_INFINITY), \(\|v\|_p =
\max|v_i|\).Double.NEGATIVE_INFINITY), \(\|v\|_p =
\min|v_i|\).p - p ≥ 1, or Double.POSITIVE_INFINITY or
Double.NEGATIVE_INFINITYdouble angle(Vector that)
this and that.
That is,
\[
this \cdot that = \|this\| \times \|that\| \times \cos \theta
\]angle in interface HilbertSpace<Vector,Real>that - a vectorthis and thatVector opposite()
opposite in interface AbelianGroup<Vector>Vector ZERO()
ZERO in interface AbelianGroup<Vector>double[] toArray()
double[].double[]Vector deepCopy()
DeepCopyablethis by the copy
constructor of the class, or just this if the instance itself is
immutable.deepCopy in interface DeepCopyableCopyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.