public class Weights extends Object
Modifier and Type | Method and Description |
---|---|
Weights |
apply(Function<Double,Double> operator)
|
boolean |
equals(Object o) |
static Weights |
fromSetCount(int count)
Creates equal
Weights for a number of input sets count with a weight of one. |
double |
getWeight(int index)
Retrieve the weight at
index . |
int |
hashCode() |
Weights |
multiply(double multiplier)
Creates a new
Weights object that contains all weights multiplied by multiplier |
Weights |
multiply(int multiplier)
Creates a new
Weights object that contains all weights multiplied by multiplier |
static Weights |
of(double... weights)
|
static Weights |
of(int... weights)
|
int |
size() |
double[] |
toArray() |
List<Double> |
toList() |
public static Weights of(int... weights)
weights
- must not be null.Weights
for weights
.public static Weights of(double... weights)
weights
- must not be null.Weights
for weights
.public static Weights fromSetCount(int count)
Weights
for a number of input sets count
with a weight of one.count
- number of input sets. Must be greater or equal to zero.Weights
for a number of input sets with a weight of one.public Weights multiply(int multiplier)
Weights
object that contains all weights multiplied by multiplier
multiplier
- multiplier used to multiply each weight with.Weights
for a number of input sets with a weight of one.public Weights multiply(double multiplier)
Weights
object that contains all weights multiplied by multiplier
multiplier
- multiplier used to multiply each weight with.Weights
for a number of input sets with a weight of one.public Weights apply(Function<Double,Double> operator)
operator
- operator function.Weights
with DoubleUnaryOperator
applied.public double getWeight(int index)
index
.index
- the weight index.index
.IndexOutOfBoundsException
- if the index is out of rangepublic int size()
public double[] toArray()
public List<Double> toList()
List
containing all of the weights in this list in proper sequence (from first to last element).Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.