Java Array Multiply multiply(double[] a, double v)

Here you can find the source of multiply(double[] a, double v)

Description

Multiplies a constant to all elements in the array.

License

Apache License

Parameter

Parameter Description
a the vector.
v the constant.

Declaration

public static void multiply(double[] a, double v) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from   ww  w . j av  a 2  s  . c  om*/
     * Multiplies a constant to all elements in the array.
     * 
     * @param a the vector.
     * @param v the constant.
     */
    public static void multiply(double[] a, double v) {
        for (int i = 0; i < a.length; i++) {
            a[i] *= v;
        }
    }
}

Related

  1. mult(float[] nums, float n)
  2. mult(float[] nums, float n)
  3. multiply(byte[] a, byte b)
  4. multiply(double factor, double[] vector)
  5. multiply(double[] a, double m)
  6. multiply(double[] a, double[] b)
  7. multiply(double[] a, double[] b)
  8. multiply(double[] a, double[] b)
  9. multiply(double[] array, double multiplier)