Here you can find the source of arrayScale(final Double[] first, final double scale)
Parameter | Description |
---|---|
first | First array: a |
scale | constant: c |
public static Double[] arrayScale(final Double[] first, final double scale)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w ww .ja va 2s . co m*/ * Scales the elements of the arrays with a contstant. * * @param first First array: a * @param scale constant: c * @return new array with elements e: e_i = a_i *c */ public static Double[] arrayScale(final Double[] first, final double scale) { final Double[] toret = new Double[first.length]; for (int i = 0; i < first.length; i++) { toret[i] = first[i] * scale; } return toret; } }