Java Utililty Methods List Product

List of utility methods to do List Product

Description

The list of methods to do List Product are organized into topic(s).

Method

DoubledotProduct(List v1, List v2)
dot Product
if (v1.size() != v2.size())
    throw new IllegalArgumentException("Vectors must be of equal length.");
Double result = 0.0;
for (int i = 0; i < v1.size(); i++) {
    result = result + (v1.get(i) * v2.get(i));
return result;
NumberdotProductValue(List oper1, List oper2)
dot Product Value
return adjuestedDotProductValue(oper1, 0.0, oper2, 0.0);
ListgetProductsFromString(List projects)
get Products From String
return projects;
Listproduct(List> lists)
product
List<String[]> results = new ArrayList<>();
product(results, lists, 0, new String[lists.size()]);
return results;
floatscalarProduct(List a, List b)
Scalar product of two vectors Be careful: Null entries are treated as 0!
float sum = 0;
for (int i = 0; i < a.size() && i < b.size(); i++) {
    if (a.get(i) != null && b.get(i) != null) {
        sum += a.get(i) * b.get(i);
return sum;
ListscalerProduct(final List doubleList, final double scalerFactor)
scaler Product
if (doubleList == null)
    throw new NullPointerException("The list is null. Aborting ...");
List<Double> outList = new ArrayList<>();
for (double d : doubleList) {
    outList.add(scalerFactor * d);
return outList;