Package de.gsi.math
Class ArrayUtils
- java.lang.Object
-
- de.gsi.math.ArrayUtils
-
public final class ArrayUtils extends java.lang.ObjectUtility class containing only static functions used to manipulate arrays.- Author:
- rstein, braeun
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double[]convertToDouble(boolean[] array)static double[]convertToDouble(boolean[] array, double scale)static double[]convertToDouble(byte[] array)static double[]convertToDouble(byte[] array, double scale)static double[]convertToDouble(float[] array)static double[]convertToDouble(float[] array, double scale)static double[]convertToDouble(int[] array)static double[]convertToDouble(int[] array, double scale)static double[]convertToDouble(long[] array)static double[]convertToDouble(long[] array, double scale)static double[]convertToDouble(short[] array)static double[]convertToDouble(short[] array, double scale)static double[]createArray(double offset, double scale, int size)Creates an array of values x = i * scale + offsetstatic voidfillArray(boolean[] array, boolean value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(byte[] array, byte value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(double[] array, double value)fast filling of an array with a default value
initialize a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(double[] array, int indexStart, int indexStop, double value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(float[] array, float value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(float[] array, int indexStart, int indexStop, float value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(int[] array, int value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(long[] array, long value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic voidfillArray(short[] array, short value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic <T> voidfillArray(T[] array, int indexStart, int indexStop, T value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashionstatic <T> voidfillArray(T[] array, T value)fast filling of an array with a default value
initialize a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion
-
-
-
Method Detail
-
convertToDouble
public static double[] convertToDouble(boolean[] array)
-
convertToDouble
public static double[] convertToDouble(boolean[] array, double scale)
-
convertToDouble
public static double[] convertToDouble(byte[] array)
-
convertToDouble
public static double[] convertToDouble(byte[] array, double scale)
-
convertToDouble
public static double[] convertToDouble(float[] array)
-
convertToDouble
public static double[] convertToDouble(float[] array, double scale)
-
convertToDouble
public static double[] convertToDouble(int[] array)
-
convertToDouble
public static double[] convertToDouble(int[] array, double scale)
-
convertToDouble
public static double[] convertToDouble(long[] array)
-
convertToDouble
public static double[] convertToDouble(long[] array, double scale)
-
convertToDouble
public static double[] convertToDouble(short[] array)
-
convertToDouble
public static double[] convertToDouble(short[] array, double scale)
-
createArray
public static double[] createArray(double offset, double scale, int size)Creates an array of values x = i * scale + offset- Parameters:
offset- the offset valuescale- the scale valuesize- the size of the created array- Returns:
- array of values
-
fillArray
public static void fillArray(boolean[] array, boolean value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- input arrayvalue- value to fill each element
-
fillArray
public static void fillArray(byte[] array, byte value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- input arrayvalue- value to fill each element
-
fillArray
public static void fillArray(double[] array, double value)fast filling of an array with a default value
initialize a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- to be initializedvalue- the value for each to be set element
-
fillArray
public static void fillArray(double[] array, int indexStart, int indexStop, double value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- to be initialisedindexStart- the first index to be setindexStop- the last index to be setvalue- the value for each to be set element
-
fillArray
public static void fillArray(float[] array, float value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- input arrayvalue- value to fill each element
-
fillArray
public static void fillArray(float[] array, int indexStart, int indexStop, float value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- to be initialisedindexStart- the first index to be setindexStop- the last index to be setvalue- the value for each to be set element
-
fillArray
public static void fillArray(int[] array, int value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- input arrayvalue- value to fill each element
-
fillArray
public static void fillArray(long[] array, long value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- input arrayvalue- value to fill each element
-
fillArray
public static void fillArray(short[] array, short value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Parameters:
array- input arrayvalue- value to fill each element
-
fillArray
public static <T> void fillArray(T[] array, int indexStart, int indexStop, T value)fast filling of an array with a default value
initialise a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Type Parameters:
T- element type- Parameters:
array- to be initialisedindexStart- the first index to be setindexStop- the last index to be setvalue- the value for each to be set element
-
fillArray
public static <T> void fillArray(T[] array, T value)fast filling of an array with a default value
initialize a smaller piece of the array and use the System.arraycopy call to fill in the rest of the array in an expanding binary fashion- Type Parameters:
T- element type- Parameters:
array- to be initializedvalue- the value for each to be set element
-
-