Java List Product scalerProduct(final List doubleList, final double scalerFactor)

Here you can find the source of scalerProduct(final List doubleList, final double scalerFactor)

Description

scaler Product

License

Open Source License

Declaration

public static List<Double> scalerProduct(final List<Double> doubleList, final double scalerFactor) 

Method Source Code

//package com.java2s;
/* *********************************************************************** *
 * project: org.matsim.*//w ww .j  a v a  2 s  .  c om
 *                                                                         *
 * *********************************************************************** *
 *                                                                         *
 * copyright       : (C) 2014 by the members listed in the COPYING,        *
 *                   LICENSE and WARRANTY file.                            *
 * email           : info at matsim dot org                                *
 *                                                                         *
 * *********************************************************************** *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *   See also COPYING, LICENSE and WARRANTY file                           *
 *                                                                         *
 * *********************************************************************** */

import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<Double> scalerProduct(final List<Double> doubleList, final double scalerFactor) {
        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;
    }
}

Related

  1. dotProduct(List v1, List v2)
  2. dotProductValue(List oper1, List oper2)
  3. getProductsFromString(List projects)
  4. product(List> lists)
  5. scalarProduct(List a, List b)