diff --git a/prism/src/explicit/Utils.java b/prism/src/explicit/Utils.java index 07a6b90f..47e5c4a4 100644 --- a/prism/src/explicit/Utils.java +++ b/prism/src/explicit/Utils.java @@ -165,6 +165,42 @@ public class Utils return arrayNew; } + /** + * Copy a double array. + * @param array The array to be cloned + * @param copy The destination array (should exist and be same size) + */ + public static void copyDoubleArray(double array[], double copyTo[]) + { + int i, n; + // Do nothing for null pointers + if (array == null) + return; + // Otherwise copy + n = array.length; + for (i = 0; i < n; i++) { + copyTo[i] = array[i]; + } + } + + /** + * Copy an integer array. + * @param array The array to be cloned + * @param copy The destination array (should exist and be same size) + */ + public static void copyIntArray(int array[], int copyTo[]) + { + int i, n; + // Do nothing for null pointers + if (array == null) + return; + // Otherwise copy + n = array.length; + for (i = 0; i < n; i++) { + copyTo[i] = array[i]; + } + } + /** * Test if two double arrays are equal. */