Here you can find the source of newArray(int length, double start, double increment)
Parameter | Description |
---|---|
length | The length of the array |
start | The start |
increment | The increment |
public static double[] newArray(int length, double start, double increment)
//package com.java2s; /*----------------------------------------------------------------------------- * GDSC SMLM Software/*w w w . j a v a 2s. co m*/ * * Copyright (C) 2016 Alex Herbert * Genome Damage and Stability Centre * University of Sussex, UK * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. *---------------------------------------------------------------------------*/ public class Main { /** * Create and fill an array * * @param length * The length of the array * @param start * The start * @param increment * The increment * @return The new array */ public static double[] newArray(int length, double start, double increment) { double[] data = new double[length]; for (int i = 0; i < length; i++, start += increment) data[i] = start; return data; } /** * Create and fill an array * * @param length * The length of the array * @param start * The start * @param increment * The increment * @return The new array */ public static int[] newArray(int length, int start, int increment) { int[] data = new int[length]; for (int i = 0; i < length; i++, start += increment) data[i] = start; return data; } }