Class OperationContext

java.lang.Object
org.episteme.core.technical.algorithm.OperationContext

public final class OperationContext extends Object
Describes the context of a numerical operation for provider selection.

Instead of purely priority-based selection, OperationContext allows AlgorithmProvider.score(OperationContext) to make informed decisions based on data characteristics.

OperationContext ctx = new OperationContext.Builder()
    .dataSize(1_000_000)
    .addHint(OperationContext.Hint.DENSE)
    .build();

LinearAlgebraProvider best = ProviderSelector.select(
    LinearAlgebraProvider.class, ctx);
Since:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Field Details

  • Method Details

    • getDataSize

      public long getDataSize()
      Number of elements in the primary operand.
    • getHints

      public Set<OperationContext.Hint> getHints()
      Unmodifiable set of operation hints.
    • hasHint

      public boolean hasHint(OperationContext.Hint hint)
      Whether a specific hint is present.
    • getDimensionality

      public int getDimensionality()
      Dimensionality of the data (e.g., rows for matrix).
    • isCancelled

      public boolean isCancelled()
      Returns true if this operation has been cancelled.
    • setCancelled

      public void setCancelled(boolean cancelled)
      Sets the cancellation state of this operation.