Class Episteme
java.lang.Object
org.episteme.core.Episteme
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidChecks if the current computation context has been cancelled.static voidSynonym for checkCancelled to match legacy API.static <T> TcomputeParallel(Supplier<T> task) Executes a computation potentially in parallel using a shared thread pool.static voidConfigures the library for maximum performance.static voidConfigures the library for maximum precision.static Collection<String> Returns a collection of available compute backend names.static StringgetBackendId(String type) Returns the generic current backend for a type.static ComputeModeReturns the current computation mode.static StringReturns a report of the current configuration and capabilities.Returns the float precision mode.Returns the integer precision mode.static Stringstatic Stringstatic MathContextGets the current MathContext.static NumericalConfigurationReturns the numerical configuration for the current thread.static PlottingBackendstatic PlottingBackendstatic StringgetProperty(String key) Gets a global configuration property from episteme.properties.static StringgetProperty(String key, String defaultValue) Gets a global configuration property with default.static ProviderRegistryGets the global provider registry.static Stringstatic booleanisBackendAvailable(String type, String idPart) Checks if a backend is available by type or ID part.static booleanReturns true if a GPU is likely available.static booleanChecks if ND4J is available in the classpath or as a backend.static booleanChecks if Apache Spark is available in the classpath or as a backend.static voidLoads settings from user preferences.static voidMain entry point for CLI usage and configuration verification.static voidSaves current settings to user preferences.static voidsetBackendId(String type, String id) Sets the backend for the specified type.static voidsetComputeMode(ComputeMode mode) Sets the computation mode.static voidSets 64-bit double precision.static voidSets 32-bit float precision.static voidSets 32-bit integer precision.static voidSets 64-bit long precision.static voidstatic voidstatic voidsetMathContext(MathContext context) Sets the default MathContext.static voidsetPlottingBackend2D(PlottingBackend backend) static voidsetPlottingBackend3D(PlottingBackend backend) static void
-
Field Details
-
VERSION
The version string (e.g., "5.0.0-SNAPSHOT") -
BUILD_DATE
The build date (e.g., "2025-12-29") -
AUTHORS
The authors of Episteme
-
-
Method Details
-
getProperty
-
getProperty
-
savePreferences
public static void savePreferences()Saves current settings to user preferences. -
loadPreferences
public static void loadPreferences()Loads settings from user preferences. -
getProviderRegistry
Gets the global provider registry. -
computeParallel
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
Returns a collection of available compute backend names.- Returns:
- collection of backend names (e.g., "Java CPU", "CUDA-JCublas")
-
getNumericalConfiguration
Returns the numerical configuration for the current thread. -
getConfigurationReport
Returns a report of the current configuration and capabilities.- Returns:
- a string describing the current state
-
getComputeMode
Returns the current computation mode. -
setComputeMode
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
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
Returns the integer precision mode. -
setMathContext
Sets the default MathContext. -
getMathContext
Gets the current MathContext. -
getBackendId
-
setBackendId
-
getMathBackendId
-
setMathBackendId
-
getTensorBackendId
-
setTensorBackendId
-
getMapBackendId
-
setMapBackendId
-
getPlottingBackend2D
-
setPlottingBackend2D
-
getPlottingBackend3D
-
setPlottingBackend3D
-
isBackendAvailable
-
main
Main entry point for CLI usage and configuration verification.- Parameters:
args- command line arguments
-