org.encog.util
Class EngineArray
- java.lang.Object
-
- org.encog.util.EngineArray
-
public final class EngineArray extends java.lang.ObjectSome array functions used by Encog.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static double[]add(double[] d, double[] m)static voidarrayAdd(double[][] target, double[][] h)static byte[]arrayCopy(byte[] input)Copy a byte array.static voidarrayCopy(byte[] source, int sourcePos, byte[] target, int targetPos, int length)static double[]arrayCopy(double[] input)Copy a double array.static double[][]arrayCopy(double[][] source)Copy a 2D double array.static voidarrayCopy(double[] src, double[] dst)Completely copy one array into another.static voidarrayCopy(double[] source, float[] target)Copy an array of floats to an array of doubles.static voidarrayCopy(double[] source, int sourcePos, double[] target, int targetPos, int length)Copy an array of doubles.static voidarrayCopy(float[] source, double[] target)Copy an array of floats to an array of doubles.static int[]arrayCopy(int[] input)Copy an int array.static voidarrayCopy(int[] src, int[] dst)Completely copy one array into another.static voidarrayCopy(int[] source, int sourcePos, int[] target, int targetPos, int length)static booleancontains(int[] array, int target)static java.lang.Double[]doubleToObject(double[] array)Convert an array of double primitives to Double objects.static doubleeuclideanDistance(double[] p1, double[] p2)static voidfill(boolean[] a, boolean b)static voidfill(double[][] sigma, int value)static voidfill(double[] array, double value)Fill a double array.static voidfill(float[] array, float value)Fill a float array.static voidfill(int[] a, int value)static intfindStringInArray(java.lang.String[] search, java.lang.String searchFor)Search for a string in an array.static intindexOfLargest(double[] data)static java.lang.Stringlist2string(java.util.List<java.lang.String> list)static double[]listToDouble(java.util.Collection<?> list)Convert the collection to an array list of doubles.static doublemax(double[] weights)static intmax(int[] data)static intmaxIndex(double[] data)static intmaxIndex(int[] data)static doublemean(double[] data)static doublemean(int[] data)static doublemin(double[] weights)static intmin(int[] data)static double[]objectToDouble(java.lang.Double[] array)Convert an array of Double objects to double primitives.static java.lang.Stringreplace(java.lang.String str, java.lang.String searchFor, java.lang.String replace)static doublesdev(int[] data)static java.util.List<java.lang.String>string2list(java.lang.String str)static double[]subtract(double[] a, double[] b)static doublevectorProduct(double[] a, double[] b)Calculate the product of two vectors (a scalar value).
-
-
-
Method Detail
-
arrayCopy
public static double[] arrayCopy(double[] input)
Copy a double array.- Parameters:
input- The array to copy.- Returns:
- The result of the copy.
-
arrayCopy
public static byte[] arrayCopy(byte[] input)
Copy a byte array.- Parameters:
input- The array to copy.- Returns:
- The result of the copy.
-
arrayCopy
public static void arrayCopy(double[] src, double[] dst)Completely copy one array into another.- Parameters:
src- Source array.dst- Destination array.
-
arrayCopy
public static void arrayCopy(double[] source, float[] target)Copy an array of floats to an array of doubles.- Parameters:
source- The source array.target- The target array.
-
arrayCopy
public static void arrayCopy(double[] source, int sourcePos, double[] target, int targetPos, int length)Copy an array of doubles.- Parameters:
source- The source.sourcePos- The source index.target- The target.targetPos- The target index.length- The length.
-
arrayCopy
public static double[][] arrayCopy(double[][] source)
Copy a 2D double array.- Parameters:
source- The source.- Returns:
- The copied array.
-
arrayCopy
public static void arrayCopy(float[] source, double[] target)Copy an array of floats to an array of doubles.- Parameters:
source- The source array.target- The target array.
-
arrayCopy
public static int[] arrayCopy(int[] input)
Copy an int array.- Parameters:
input- The array to copy.- Returns:
- The result of the copy.
-
arrayCopy
public static void arrayCopy(int[] src, int[] dst)Completely copy one array into another.- Parameters:
src- Source array.dst- Destination array.
-
doubleToObject
public static java.lang.Double[] doubleToObject(double[] array)
Convert an array of double primitives to Double objects.- Parameters:
array- The primitive array.- Returns:
- The object array.
-
fill
public static void fill(double[] array, double value)Fill a double array.- Parameters:
array- The array to fill.value- What to fill the array with.
-
fill
public static void fill(float[] array, float value)Fill a float array.- Parameters:
array- The array to fill.value- What to fill the array with.
-
findStringInArray
public static int findStringInArray(java.lang.String[] search, java.lang.String searchFor)Search for a string in an array.- Parameters:
search- Where to search.searchFor- What we are looking for.- Returns:
- The index that the string occurs at.
-
listToDouble
public static double[] listToDouble(java.util.Collection<?> list)
Convert the collection to an array list of doubles.- Parameters:
list- The list to convert.- Returns:
- The array of doubles.
-
objectToDouble
public static double[] objectToDouble(java.lang.Double[] array)
Convert an array of Double objects to double primitives.- Parameters:
array- An array of Double objects.- Returns:
- An array of double primitives.
-
vectorProduct
public static double vectorProduct(double[] a, double[] b)Calculate the product of two vectors (a scalar value).- Parameters:
a- First vector to multiply.b- Second vector to multiply.- Returns:
- The product of the two vectors (a scalar value).
-
indexOfLargest
public static int indexOfLargest(double[] data)
-
min
public static double min(double[] weights)
-
max
public static double max(double[] weights)
-
contains
public static boolean contains(int[] array, int target)
-
maxIndex
public static int maxIndex(double[] data)
-
maxIndex
public static int maxIndex(int[] data)
-
max
public static int max(int[] data)
-
min
public static int min(int[] data)
-
mean
public static double mean(int[] data)
-
sdev
public static double sdev(int[] data)
-
euclideanDistance
public static double euclideanDistance(double[] p1, double[] p2)
-
fill
public static void fill(double[][] sigma, int value)
-
fill
public static void fill(boolean[] a, boolean b)
-
add
public static double[] add(double[] d, double[] m)
-
subtract
public static double[] subtract(double[] a, double[] b)
-
mean
public static double mean(double[] data)
-
fill
public static void fill(int[] a, int value)
-
replace
public static java.lang.String replace(java.lang.String str, java.lang.String searchFor, java.lang.String replace)
-
arrayCopy
public static void arrayCopy(byte[] source, int sourcePos, byte[] target, int targetPos, int length)
-
arrayCopy
public static void arrayCopy(int[] source, int sourcePos, int[] target, int targetPos, int length)
-
arrayAdd
public static void arrayAdd(double[][] target, double[][] h)
-
string2list
public static java.util.List<java.lang.String> string2list(java.lang.String str)
-
list2string
public static java.lang.String list2string(java.util.List<java.lang.String> list)
-
-
DMelt 3.0 © DataMelt by jWork.ORG