T
- the type of the field elementspublic interface FieldVector<T extends FieldElement<T>>
vector element indexing is 0-based -- e.g., getEntry(0)
returns the first element of the vector.
The various mapXxx
and mapXxxToSelf
methods operate
on vectors element-wise, i.e. they perform the same operation (adding a scalar,
applying a function ...) on each element in turn. The mapXxx
versions create a new vector to hold the result and do not change the instance.
The mapXxxToSelf
versions use the instance itself to store the
results, so the instance is changed by these methods. In both cases, the result
vector is returned by the methods, this allows to use the fluent API
style, like this:
RealVector result = v.mapAddToSelf(3.0).mapTanToSelf().mapSquareToSelf();
Modifier and Type | Method and Description |
---|---|
FieldVector<T> |
add(FieldVector<T> v)
Compute the sum of this and v.
|
FieldVector<T> |
add(T[] v)
Compute the sum of this and v.
|
FieldVector<T> |
append(FieldVector<T> v)
Construct a vector by appending a vector to this vector.
|
FieldVector<T> |
append(T d)
Construct a vector by appending a T to this vector.
|
FieldVector<T> |
append(T[] a)
Construct a vector by appending a T array to this vector.
|
FieldVector<T> |
copy()
Returns a (deep) copy of this.
|
T |
dotProduct(FieldVector<T> v)
Compute the dot product.
|
T |
dotProduct(T[] v)
Compute the dot product.
|
FieldVector<T> |
ebeDivide(FieldVector<T> v)
Element-by-element division.
|
FieldVector<T> |
ebeDivide(T[] v)
Element-by-element division.
|
FieldVector<T> |
ebeMultiply(FieldVector<T> v)
Element-by-element multiplication.
|
FieldVector<T> |
ebeMultiply(T[] v)
Element-by-element multiplication.
|
T[] |
getData()
Returns vector entries as a T array.
|
int |
getDimension()
Returns the size of the vector.
|
T |
getEntry(int index)
Returns the entry in the specified index.
|
Field<T> |
getField()
Get the type of field elements of the vector.
|
FieldVector<T> |
getSubVector(int index,
int n)
Get a subvector from consecutive elements.
|
FieldVector<T> |
mapAdd(T d)
Map an addition operation to each entry.
|
FieldVector<T> |
mapAddToSelf(T d)
Map an addition operation to each entry.
|
FieldVector<T> |
mapDivide(T d)
Map a division operation to each entry.
|
FieldVector<T> |
mapDivideToSelf(T d)
Map a division operation to each entry.
|
FieldVector<T> |
mapInv()
Map the 1/x function to each entry.
|
FieldVector<T> |
mapInvToSelf()
Map the 1/x function to each entry.
|
FieldVector<T> |
mapMultiply(T d)
Map a multiplication operation to each entry.
|
FieldVector<T> |
mapMultiplyToSelf(T d)
Map a multiplication operation to each entry.
|
FieldVector<T> |
mapSubtract(T d)
Map a subtraction operation to each entry.
|
FieldVector<T> |
mapSubtractToSelf(T d)
Map a subtraction operation to each entry.
|
FieldMatrix<T> |
outerProduct(FieldVector<T> v)
Compute the outer product.
|
FieldMatrix<T> |
outerProduct(T[] v)
Compute the outer product.
|
FieldVector<T> |
projection(FieldVector<T> v)
Find the orthogonal projection of this vector onto another vector.
|
FieldVector<T> |
projection(T[] v)
Find the orthogonal projection of this vector onto another vector.
|
void |
set(T value)
Set all elements to a single value.
|
void |
setEntry(int index,
T value)
Set a single element.
|
void |
setSubVector(int index,
FieldVector<T> v)
Set a set of consecutive elements.
|
void |
setSubVector(int index,
T[] v)
Set a set of consecutive elements.
|
FieldVector<T> |
subtract(FieldVector<T> v)
Compute this minus v.
|
FieldVector<T> |
subtract(T[] v)
Compute this minus v.
|
T[] |
toArray()
Convert the vector to a T array.
|
Field<T> getField()
FieldVector<T> copy()
FieldVector<T> add(FieldVector<T> v) throws java.lang.IllegalArgumentException
v
- vector to be addedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> add(T[] v) throws java.lang.IllegalArgumentException
v
- vector to be addedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> subtract(FieldVector<T> v) throws java.lang.IllegalArgumentException
v
- vector to be subtractedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> subtract(T[] v) throws java.lang.IllegalArgumentException
v
- vector to be subtractedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> mapAdd(T d)
d
- value to be added to each entryFieldVector<T> mapAddToSelf(T d)
The instance is changed by this method.
d
- value to be added to each entryFieldVector<T> mapSubtract(T d)
d
- value to be subtracted to each entryFieldVector<T> mapSubtractToSelf(T d)
The instance is changed by this method.
d
- value to be subtracted to each entryFieldVector<T> mapMultiply(T d)
d
- value to multiply all entries byFieldVector<T> mapMultiplyToSelf(T d)
The instance is changed by this method.
d
- value to multiply all entries byFieldVector<T> mapDivide(T d)
d
- value to divide all entries byFieldVector<T> mapDivideToSelf(T d)
The instance is changed by this method.
d
- value to divide all entries byFieldVector<T> mapInv()
FieldVector<T> mapInvToSelf()
The instance is changed by this method.
FieldVector<T> ebeMultiply(FieldVector<T> v) throws java.lang.IllegalArgumentException
v
- vector by which instance elements must be multipliedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> ebeMultiply(T[] v) throws java.lang.IllegalArgumentException
v
- vector by which instance elements must be multipliedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> ebeDivide(FieldVector<T> v) throws java.lang.IllegalArgumentException
v
- vector by which instance elements must be dividedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> ebeDivide(T[] v) throws java.lang.IllegalArgumentException
v
- vector by which instance elements must be dividedjava.lang.IllegalArgumentException
- if v is not the same size as thisT[] getData()
T dotProduct(FieldVector<T> v) throws java.lang.IllegalArgumentException
v
- vector with which dot product should be computedjava.lang.IllegalArgumentException
- if v is not the same size as thisT dotProduct(T[] v) throws java.lang.IllegalArgumentException
v
- vector with which dot product should be computedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> projection(FieldVector<T> v) throws java.lang.IllegalArgumentException
v
- vector onto which instance must be projectedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldVector<T> projection(T[] v) throws java.lang.IllegalArgumentException
v
- vector onto which instance must be projectedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldMatrix<T> outerProduct(FieldVector<T> v) throws java.lang.IllegalArgumentException
v
- vector with which outer product should be computedjava.lang.IllegalArgumentException
- if v is not the same size as thisFieldMatrix<T> outerProduct(T[] v) throws java.lang.IllegalArgumentException
v
- vector with which outer product should be computedjava.lang.IllegalArgumentException
- if v is not the same size as thisT getEntry(int index) throws MatrixIndexException
The index start at 0 and must be lesser than the size,
otherwise a MatrixIndexException
is thrown.
index
- index location of entry to be fetchedMatrixIndexException
- if the index is not validsetEntry(int, FieldElement)
void setEntry(int index, T value) throws MatrixIndexException
index
- element index.value
- new value for the element.MatrixIndexException
- if the index is
inconsistent with vector sizegetEntry(int)
int getDimension()
FieldVector<T> append(FieldVector<T> v)
v
- vector to append to this one.FieldVector<T> append(T d)
d
- T to append.FieldVector<T> append(T[] a)
a
- T array to append.FieldVector<T> getSubVector(int index, int n) throws MatrixIndexException
index
- index of first element.n
- number of elements to be retrieved.MatrixIndexException
- if the index is
inconsistent with vector sizevoid setSubVector(int index, FieldVector<T> v) throws MatrixIndexException
index
- index of first element to be set.v
- vector containing the values to set.MatrixIndexException
- if the index is
inconsistent with vector sizesetSubVector(int, FieldElement[])
void setSubVector(int index, T[] v) throws MatrixIndexException
index
- index of first element to be set.v
- vector containing the values to set.MatrixIndexException
- if the index is
inconsistent with vector sizesetSubVector(int, FieldVector)
void set(T value)
value
- single value to set for all elementsT[] toArray()
The array is independent from vector data, it's elements are copied.
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"