Class Episteme

java.lang.Object
org.episteme.core.Episteme

public final class Episteme extends Object
The central entry point and configuration dashboard for the Episteme library.

This class provides static methods to configure global settings, such as computation modes (CPU/GPU), precision settings, and other library-wide preferences.

Usage Example

// Configure for high-performance GPU computing
Episteme.setComputeMode(ComputeMode.CUDA);

// Configure floating-point precision
Episteme.setFloatPrecision(); // 32-bit float - faster
Episteme.setDoublePrecision(); // 64-bit double - more precise

// Configure integer precision
Episteme.setIntPrecision(); // 32-bit int - faster on most GPUs
Episteme.setLongPrecision(); // 64-bit long - larger range
* @author Silvere Martin-Michiellot
Since:
1.0
Author:
Gemini AI (Google DeepMind)
  • Field Details

    • VERSION

      public static String VERSION
      The version string (e.g., "5.0.0-SNAPSHOT")
    • BUILD_DATE

      public static String BUILD_DATE
      The build date (e.g., "2025-12-29")
    • AUTHORS

      public static final String[] AUTHORS
      The authors of Episteme
  • Method Details

    • getProperty

      public static String getProperty(String key)
      Gets a global configuration property from episteme.properties.
      Parameters:
      key - the property key
      Returns:
      the property value or null
    • getProperty

      public static String getProperty(String key, String defaultValue)
      Gets a global configuration property with default.
      Parameters:
      key - the property key
      defaultValue - definition value
      Returns:
      the property value
    • savePreferences

      public static void savePreferences()
      Saves current settings to user preferences.
    • loadPreferences

      public static void loadPreferences()
      Loads settings from user preferences.
    • getProviderRegistry

      public static ProviderRegistry getProviderRegistry()
      Gets the global provider registry.
    • computeParallel

      public static <T> T computeParallel(Supplier<T> task)
      Executes a computation potentially in parallel using a shared thread pool.
    • checkCancelled

      public static void checkCancelled()
      Checks if the current computation context has been cancelled.
      Throws:
      RuntimeException - if cancelled
    • checkCurrentCancelled

      public static void checkCurrentCancelled()
      Synonym for checkCancelled to match legacy API.
    • configureForPerformance

      public static void configureForPerformance()
      Configures the library for maximum performance.
    • configureForPrecision

      public static void configureForPrecision()
      Configures the library for maximum precision.
    • isGpuAvailable

      public static boolean isGpuAvailable()
      Returns true if a GPU is likely available.
    • isND4JAvailable

      public static boolean isND4JAvailable()
      Checks if ND4J is available in the classpath or as a backend.
    • isSparkAvailable

      public static boolean isSparkAvailable()
      Checks if Apache Spark is available in the classpath or as a backend.
    • getAvailableBackends

      public static Collection<String> getAvailableBackends()
      Returns a collection of available compute backend names.
      Returns:
      collection of backend names (e.g., "Java CPU", "CUDA-JCublas")
    • getNumericalConfiguration

      public static NumericalConfiguration getNumericalConfiguration()
      Returns the numerical configuration for the current thread.
    • getConfigurationReport

      public static String getConfigurationReport()
      Returns a report of the current configuration and capabilities.
      Returns:
      a string describing the current state
    • getComputeMode

      public static ComputeMode getComputeMode()
      Returns the current computation mode.
    • setComputeMode

      public static void setComputeMode(ComputeMode mode)
      Sets the computation mode.
    • setFloatPrecision

      public static void setFloatPrecision()
      Sets 32-bit float precision.
    • setDoublePrecision

      public static void setDoublePrecision()
      Sets 64-bit double precision.
    • getFloatPrecisionMode

      public static NumericalConfiguration.FloatPrecision getFloatPrecisionMode()
      Returns the float precision mode.
    • setIntPrecision

      public static void setIntPrecision()
      Sets 32-bit integer precision.
    • setLongPrecision

      public static void setLongPrecision()
      Sets 64-bit long precision.
    • getIntPrecisionMode

      public static NumericalConfiguration.IntPrecision getIntPrecisionMode()
      Returns the integer precision mode.
    • setMathContext

      public static void setMathContext(MathContext context)
      Sets the default MathContext.
    • getMathContext

      public static MathContext getMathContext()
      Gets the current MathContext.
    • getBackendId

      public static String getBackendId(String type)
      Returns the generic current backend for a type.
    • setBackendId

      public static void setBackendId(String type, String id)
      Sets the backend for the specified type.
    • getMathBackendId

      public static String getMathBackendId()
    • setMathBackendId

      public static void setMathBackendId(String id)
    • getTensorBackendId

      public static String getTensorBackendId()
    • setTensorBackendId

      public static void setTensorBackendId(String id)
    • getMapBackendId

      public static String getMapBackendId()
    • setMapBackendId

      public static void setMapBackendId(String id)
    • getPlottingBackend2D

      public static PlottingBackend getPlottingBackend2D()
    • setPlottingBackend2D

      public static void setPlottingBackend2D(PlottingBackend backend)
    • getPlottingBackend3D

      public static PlottingBackend getPlottingBackend3D()
    • setPlottingBackend3D

      public static void setPlottingBackend3D(PlottingBackend backend)
    • isBackendAvailable

      public static boolean isBackendAvailable(String type, String idPart)
      Checks if a backend is available by type or ID part.
    • main

      public static void main(String[] args)
      Main entry point for CLI usage and configuration verification.
      Parameters:
      args - command line arguments