Java Array Multiply multiply(float[] v1, float[] v2)

Here you can find the source of multiply(float[] v1, float[] v2)

Description

multiply

License

Open Source License

Declaration

public static void multiply(float[] v1, float[] v2) 

Method Source Code

//package com.java2s;
/*/*from   ww  w . j  a v a  2  s.c  o  m*/
 * Copyright (c) 2008-2013 Maksim Khadkevich and Fondazione Bruno Kessler.
 *
 * This file is part of MART.
 * MART is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2, as published
 * by the Free Software Foundation.
 *
 * MART is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with MART; if not, write to the Free Software Foundation,
 * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

public class Main {
    public static void multiply(float[] v1, float[] v2) {
        if (v1.length != v2.length) {
            throw new IllegalArgumentException(
                    "Arrays lengths are different");
        }
        for (int i = 0; i < v1.length; i++) {
            v1[i] = v1[i] * v2[i];
        }
    }
}

Related

  1. multiply(float[] array, float factor)
  2. multiply(float[] array, int multiplier)
  3. multiply(float[] in, float f)
  4. multiply(float[] mat, float[] mat2, float[] dest)
  5. multiply(float[] v, double factor)
  6. multiply(long[] x, long[] y, long[] z)
  7. multiply(long[] x, long[] y, long[] z)
  8. multiply(long[] x, long[] y, long[] z)
  9. multiply(String[] strings, String placeholder, String[] replacements)