Java Array Divide div(final int[] result, final int[] vector, final int[] scale)

Here you can find the source of div(final int[] result, final int[] vector, final int[] scale)

Description

Divides a vector by param using given result int[], result = vector / scale

License

Open Source License

Parameter

Parameter Description
result vector for the result, may be vector (in-place)
vector input vector
scale 3 component scale constant for each vector component

Return

result vector for chaining

Declaration

public static int[] div(final int[] result, final int[] vector, final int[] scale) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//  w  w  w . ja v a  2s .c  o  m
     * Divides a vector by param using given result int[], result = vector /
     * scale
     *
     * @param result vector for the result, may be vector (in-place)
     * @param vector input vector
     * @param scale 3 component scale constant for each vector component
     * @return result vector for chaining
     */
    public static int[] div(final int[] result, final int[] vector, final int[] scale) {
        for (int i = 0; i < result.length; i++) {
            result[i] = vector[i] / scale[i];
        }
        return result;
    }
}

Related

  1. arrayDivide(double[] a, double[] b)
  2. arrayDivide(double[] d1, double denominator)
  3. arrayDivision(double[] array, double number)
  4. div(double a, double[] b)
  5. div(float[] items, int offset, int length, float divisor)
  6. div(float[] items, int offset, int length, float divisorX, float divisorY)
  7. div(float[] nums, float n)
  8. div(float[] nums, int n)