@Shareable public class UnitVectorNormalizer extends AbstractVectorNormalizer implements Serializable
Constructor and Description |
---|
UnitVectorNormalizer()
Create a unit vector normalizer with a tolerance of 1.0e-6.
|
UnitVectorNormalizer(double t)
Create a unit vector normalizer a specified tolerance around 0.
|
Modifier and Type | Method and Description |
---|---|
VectorTransformation |
makeTransformation(SparseVector reference)
Create a vector transformation that normalizes and denormalizes vectors
with respect to the specified entity.
|
normalize
@Inject public UnitVectorNormalizer()
public UnitVectorNormalizer(double t)
t
- The error tolerance for 0-checking.public VectorTransformation makeTransformation(SparseVector reference)
VectorNormalizer
If the reference vector is empty, the returned transformation should be the identity transform. Results are undefined if the reference vector is not complete or contains NaN values.
If the normalization needs to retain a copy of the sparse vector, it will take an immutable copy.
makeTransformation
in interface VectorNormalizer
reference
- The reference vector.