public class CombinedVectorByRef extends Object
Constructor and Description |
---|
CombinedVectorByRef(Vector v1,
Vector v2,
Vector... others) |
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)
Deprecated.
|
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.
|
public int size()
Vector
public double get(int i)
Vector
i
- the position of a vector entry@Deprecated public void set(int i, double value)
Vector
i
- the index of the entry to change. The indices are counting from 1, NOT 0.value
- the value to change topublic double[] toArray()
Vector
double[]
.double[]
public Vector deepCopy()
DeepCopyable
this
by the copy
constructor of the class, or just this
if the instance itself is
immutable.public Vector add(Vector that)
Vector
add
in interface Vector
add
in interface AbelianGroup<Vector>
that
- a vectorpublic Vector minus(Vector that)
Vector
minus
in interface Vector
minus
in interface AbelianGroup<Vector>
that
- a vectorpublic Vector multiply(Vector that)
Vector
this
by that
, entry-by-entry.public Vector divide(Vector that)
Vector
this
by that
, entry-by-entry.public Vector add(double c)
Vector
public Vector minus(double c)
Vector
public double innerProduct(Vector that)
Vector
innerProduct
in interface Vector
innerProduct
in interface HilbertSpace<Vector,Real>
that
- a vectorpublic Vector pow(double c)
Vector
public Vector scaled(double c)
Vector
vector.scaled(1. / vector.norm())
public Vector scaled(Real c)
Vector
vector.scaled(1. / vector.norm())
scaled
in interface Vector
scaled
in interface VectorSpace<Vector,Real>
c
- a constantpublic double norm()
Vector
norm
in interface Vector
norm
in interface BanachSpace<Vector,Real>
public double norm(double p)
Vector
Double.POSITIVE_INFINITY
), \(\|v\|_p =
\max|v_i|\).Double.NEGATIVE_INFINITY
), \(\|v\|_p =
\min|v_i|\).norm
in interface Vector
p
- p ≥ 1, or Double.POSITIVE_INFINITY
or
Double.NEGATIVE_INFINITY
public double angle(Vector that)
Vector
this
and that
.
That is,
\[
this \cdot that = \|this\| \times \|that\| \times \cos \theta
\]public Vector opposite()
Vector
opposite
in interface Vector
opposite
in interface AbelianGroup<Vector>
Copyright © 2010-2020 NM FinTech Ltd.. All Rights Reserved.