Here you can find the source of minus(double a[], double b)
Parameter | Description |
---|---|
a | the vector |
b | the number |
public static double[] minus(double a[], double b)
//package com.java2s; //License from project: Open Source License public class Main { /**/* www . java 2 s . c o m*/ * Creates a new vector by subtracting the given real number from the given vector. * @param a the vector * @param b the number * @return the result of subtracting the given real number from the given vector */ public static double[] minus(double a[], double b) { double[] c = new double[a.length]; for (int i = 0; i < c.length; i++) { c[i] = a[i] - b; } return c; } /** * Creates a new vector by subtracting the second vector from the first vector. * @param a the first vector * @param b the second vector * @return the result of subtracting the second vector from the first vector */ public static double[] minus(double a[], double b[]) { double[] c = new double[a.length]; for (int i = 0; i < c.length; i++) { c[i] = a[i] - b[i]; } return c; } /** * Creates a new vector by subtracting the given real number from the given vector. * @param a the vector * @param b the number * @return the result of subtracting the given real number from the given vector */ public static int[] minus(int a[], int b) { int[] c = new int[a.length]; for (int i = 0; i < c.length; i++) { c[i] = a[i] - b; } return c; } /** * Creates a new vector by subtracting the second vector from the first vector. * @param a the first vector * @param b the second vector * @return the result of subtracting the second vector from the first vector */ public static int[] minus(int a[], int b[]) { int[] c = new int[a.length]; for (int i = 0; i < c.length; i++) { c[i] = a[i] - b[i]; } return c; } }