Class CollectionConverters

java.lang.Object
org.episteme.core.mathematics.util.CollectionConverters

public class CollectionConverters extends Object
Utility class for converting between collections of primitives and Episteme types.

Provides collection conversion methods for:

  • List<Double> to List<Real>
  • List<Real> to List<Double>

Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • toReal

      public static List<Real> toReal(List<Double> list)
      Converts a List<Double> to List<Real>.
      Parameters:
      list - the input List of Double objects
      Returns:
      List of Real values
    • toDouble

      public static List<Double> toDouble(List<Real> list)
      Converts a List<Real> to List<Double>.
      Parameters:
      list - the input List of Real values
      Returns:
      List of Double objects
    • toDoubleArray

      public static double[] toDoubleArray(List<Real> list)
      Converts a List<Real> to primitive double array.
      Parameters:
      list - the input List of Real values
      Returns:
      array of primitive double values
    • fromDoubleArray

      public static List<Real> fromDoubleArray(double[] arr)
      Converts a primitive double array to List<Real>.
      Parameters:
      arr - the input double array
      Returns:
      List of Real values