Here you can find the source of negate(double[] a)
public static double[] negate(double[] a)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w.j a v a 2 s. c o m * Returns a new array that contains the negated values of the given array. */ public static double[] negate(double[] a) { double[] n = new double[a.length]; for (int i = 0; i < a.length; i++) { n[i] = -a[i]; } return n; } }