V
- Vector implementation typepublic abstract class EuclideanVectorSum<V extends EuclideanVector<V>> extends Object implements Supplier<V>, Consumer<V>
Constructor and Description |
---|
EuclideanVectorSum() |
Modifier and Type | Method and Description |
---|---|
void |
accept(V vec)
Add a vector to this instance.
|
abstract EuclideanVectorSum<V> |
add(V vec)
Add a vector to this instance.
|
abstract EuclideanVectorSum<V> |
addScaled(double scale,
V vec)
Add a scaled vector to this instance.
|
public EuclideanVectorSum()
public void accept(V vec)
add(EuclideanVector)
.accept
in interface Consumer<V extends EuclideanVector<V>>
vec
- vector to addpublic abstract EuclideanVectorSum<V> add(V vec)
vec
- vector to addpublic abstract EuclideanVectorSum<V> addScaled(double scale, V vec)
sum.addScale(scale, vec)
will generally produce a better result than
sum.add(vec.multiply(scale))
.scale
- scale factorvec
- vector to scale and addCopyright © 2016–2021 The Apache Software Foundation. All rights reserved.