Documentation of 'cc.redberry.core.context.CC' Java class
CC
cc.redberry.core.context

Class CC



  • public final class CC
    extends java.lang.Object
    Redberry current context. This class statically delegates common useful methods from Redberry context of current session.
    Since:
    1.0
    See Also:
    Context
    • Method Detail

      • current

        public static Context current()
        Returns the current context of Redberry session.
        Returns:
        the current context of Redberry session.
      • isMetric

        public static boolean isMetric(byte type)
        Returns true if metric is defined for specified index type.
        Parameters:
        type - index type
        Returns:
        true if metric is defined for specified index type
      • isMetric

        public static boolean isMetric(IndexType type)
        Returns true if metric is defined for specified index type.
        Parameters:
        type - index type
        Returns:
        true if metric is defined for specified index type
      • getNameDescriptor

        public static NameDescriptor getNameDescriptor(int name)
        Returns NameDescriptor corresponding to the specified int nameId.
        Parameters:
        name - integer name of tensor
        Returns:
        corresponding NameDescriptor
      • getNameManager

        public static NameManager getNameManager()
        Returns the name manager (namespace) of current session.
        Returns:
        the name manager (namespace) of current session.
      • getIndexConverterManager

        public static IndexConverterManager getIndexConverterManager()
        Returns index converter manager of current session.
        Returns:
        index converter manager of current session
      • getDefaultOutputFormat

        public static OutputFormat getDefaultOutputFormat()
        Returns current default output format.
        Returns:
        current default output format
      • getMetricTypes

        public static java.util.Set<IndexType> getMetricTypes()
        Returns all metric types.
        Returns:
        all metric types
      • getMatrixTypes

        public static java.util.Set<IndexType> getMatrixTypes()
        Returns all matrix types.
        Returns:
        all matrix types
      • setDefaultOutputFormat

        public static void setDefaultOutputFormat(OutputFormat defaultOutputFormat)
        Sets the default output format.

        After this step, all expressions will be printed according to the specified output format.

        Parameters:
        defaultOutputFormat - output format
      • resetTensorNames

        public static void resetTensorNames()
        This method resets all tensor names in the namespace.

        Any tensor created before this method call becomes invalid, and must not be used! This method is mainly used in unit tests, so avoid invocations of this method in general computations.

      • resetTensorNames

        public static void resetTensorNames(long seed)
        This method resets all tensor names in the namespace and sets a specified seed to the NameManager. If this method is invoked with constant seed before any interactions with Redberry, further behaviour of Redberry will be fully deterministic from run to run (order of summands and multipliers will be fixed, computation time will be pretty constant, hash codes will be the same).

        Any tensor created before this method call becomes invalid, and must not be used! This method is mainly used in unit tests, so avoid invocations of this method in general computations.

      • generateNewSymbol

        public static SimpleTensor generateNewSymbol()
        Generates a new symbol which never used before during current session.
        Returns:
        new symbol which never used before during current session
      • getRandomGenerator

        public static org.apache.commons.math3.random.RandomGenerator getRandomGenerator()
        Returns random generator used by Redberry in current session.
        Returns:
        random generator used by Redberry in current session

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.