public final class Vectors extends Object
Modifier and Type | Field and Description |
---|---|
static VectorFactory<BasicVector> |
BASIC |
static VectorFactory<CompressedVector> |
COMPRESSED |
static VectorFunction |
DEC_FUNCTION
Decreases each element of vectors by
1 . |
static VectorFactory<BasicVector> |
DENSE |
static double |
EPS |
static VectorFactory<?>[] |
FACTORIES |
static VectorFunction |
INC_FUNCTION
Increases each element of vector by
1 . |
static VectorFunction |
INV_FUNCTION
Inverts each element of vector.
|
static VectorPredicate |
NEGATIVE_VECTOR
Checks whether the vector is a
negative
vector.
|
static VectorPredicate |
POSITIVE_VECTOR
Checks whether the vector is a
positive
vector.
|
static int |
ROUND_FACTOR |
static VectorFactory<CompressedVector> |
SPARSE |
static VectorPredicate |
ZERO_VECTOR
Checks whether the vector is a
zero
vector.
|
Constructor and Description |
---|
Vectors() |
Modifier and Type | Method and Description |
---|---|
static VectorProcedure |
asAccumulatorProcedure(VectorAccumulator accumulator)
Creates an accumulator procedure that adapts a vector accumulator for procedure
interface.
|
static VectorFunction |
asConstFunction(double arg)
Creates a const function that evaluates it's argument to given
value . |
static VectorFunction |
asDivFunction(double arg)
Creates a div function that divides it's argument by given
value . |
static VectorFunction |
asMinusFunction(double arg)
Creates a minus function that subtracts given
value from it's argument. |
static VectorFunction |
asModFunction(double arg)
Creates a mod function that calculates the modulus of it's argument and given
value . |
static VectorFunction |
asMulFunction(double arg)
Creates a mul function that multiplies given
value by it's argument. |
static VectorFunction |
asPlusFunction(double arg)
Creates a plus function that adds given
value to it's argument. |
static VectorAccumulator |
asProductAccumulator(double neutral)
Creates a product vector accumulator that calculates the product of all elements in the vector.
|
static VectorAccumulator |
asProductFunctionAccumulator(double neutral,
VectorFunction function)
Creates a product function accumulator, that calculates the product of
all elements in the vector after applying given
function to
each of them. |
static VectorAccumulator |
asSumAccumulator(double neutral)
Creates a sum vector accumulator that calculates the sum of all elements in the vector.
|
static VectorAccumulator |
asSumFunctionAccumulator(double neutral,
VectorFunction function)
Creates a sum function accumulator, that calculates the sum of all
elements in the vector after applying given
function to each of them. |
static VectorAccumulator |
mkEuclideanNormAccumulator()
Makes an Euclidean norm accumulator that allows to use
Vector.fold(org.la4j.vector.functor.VectorAccumulator) method for norm calculation. |
static VectorAccumulator |
mkInfinityNormAccumulator()
Makes an Infinity norm accumulator that allows to use
Vector.fold(org.la4j.vector.functor.VectorAccumulator) method for norm calculation. |
static VectorAccumulator |
mkManhattanNormAccumulator()
Makes a Manhattan norm accumulator that allows to use
Vector.fold(org.la4j.vector.functor.VectorAccumulator) method for norm calculation. |
static VectorAccumulator |
mkMaxAccumulator()
Makes a maximum vector accumulator that accumulates the maximum across vector elements.
|
static VectorAccumulator |
mkMinAccumulator()
Makes a minimum vector accumulator that accumulates the minimum across vector elements.
|
public static final double EPS
public static final int ROUND_FACTOR
public static final VectorFactory<BasicVector> BASIC
public static final VectorFactory<CompressedVector> COMPRESSED
public static final VectorFactory<?>[] FACTORIES
public static final VectorFactory<BasicVector> DENSE
public static final VectorFactory<CompressedVector> SPARSE
public static final VectorPredicate ZERO_VECTOR
public static final VectorPredicate POSITIVE_VECTOR
public static final VectorPredicate NEGATIVE_VECTOR
public static final VectorFunction INC_FUNCTION
1
.public static final VectorFunction DEC_FUNCTION
1
.public static final VectorFunction INV_FUNCTION
public static VectorFunction asConstFunction(double arg)
value
.arg
- a const value_
public static VectorFunction asPlusFunction(double arg)
value
to it's argument.arg
- a value to be added to function's argument_ + _
public static VectorFunction asMinusFunction(double arg)
value
from it's argument.arg
- a value to be subtracted from function's argument_ - _
public static VectorFunction asMulFunction(double arg)
value
by it's argument.arg
- a value to be multiplied by function's argument_ * _
public static VectorFunction asDivFunction(double arg)
value
.arg
- a divisor value_ / _
public static VectorFunction asModFunction(double arg)
value
.arg
- a divisor value_ % _
public static VectorAccumulator asSumAccumulator(double neutral)
neutral
- the neutral valuepublic static VectorAccumulator asProductAccumulator(double neutral)
neutral
- the neutral valuepublic static VectorAccumulator mkMinAccumulator()
public static VectorAccumulator mkMaxAccumulator()
public static VectorAccumulator mkEuclideanNormAccumulator()
Vector.fold(org.la4j.vector.functor.VectorAccumulator)
method for norm calculation.public static VectorAccumulator mkManhattanNormAccumulator()
Vector.fold(org.la4j.vector.functor.VectorAccumulator)
method for norm calculation.public static VectorAccumulator mkInfinityNormAccumulator()
Vector.fold(org.la4j.vector.functor.VectorAccumulator)
method for norm calculation.public static VectorAccumulator asSumFunctionAccumulator(double neutral, VectorFunction function)
function
to each of them.neutral
- the neutral valuefunction
- the vector functionpublic static VectorAccumulator asProductFunctionAccumulator(double neutral, VectorFunction function)
function
to
each of them.neutral
- the neutral valuefunction
- the vector functionpublic static VectorProcedure asAccumulatorProcedure(VectorAccumulator accumulator)
accumulator
- the vector accumulatorCopyright © 2015. All rights reserved.