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

Class NameManager



  • public final class NameManager
    extends java.lang.Object
    Object of this class represents a namespace of simple tensor and tensor fields in Redberry. It is responsible for generation of unique name descriptors (NameDescriptor) and integer identifiers for simple tensors and fields from raw data. These identifiers are the same for tensors with the same mathematical nature. They are generated randomly in order to obtain the uniform distribution through Redberry session. Each session of Redberry holds only one instance of this class, it can be obtained through CC.getNameManager().
    Since:
    1.0
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      NameDescriptor generateNewSymbolDescriptor()
      Returns a descriptor for symbol which was not already parsed.
      java.lang.String getKroneckerName()
      Returns string representation of Kronecker delta name
      java.lang.String getMetricName()
      Returns string representation of metric tensor name
      NameDescriptor getNameDescriptor(int nameId)
      Returns the name descriptor of the specified unique identifier of simple tensor.
      org.apache.commons.math3.random.RandomGenerator getRandomGenerator() 
      long getSeed()
      Returns the seed of the random generator used in name manager.
      boolean isKroneckerOrMetric(int name)
      Returns true if specified identifier is identifier of metric or Kronecker tensor
      NameDescriptor mapNameDescriptor(java.lang.String sname, StructureOfIndices... structureOfIndices)
      This method returns the existing name descriptor of simple tensor from the raw data if it contains in the namespace or constructs and puts to namespace new instance of name descriptor otherwise.
      void setKroneckerName(java.lang.String name)
      Sets the default Kronecker tensor name.
      void setMetricName(java.lang.String name)
      Sets the default metric tensor name.
      int size() 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_VAR_SYMBOL_PREFIX

        public static final java.lang.String DEFAULT_VAR_SYMBOL_PREFIX
        See Also:
        Constant Field Values
    • Method Detail

      • isKroneckerOrMetric

        public boolean isKroneckerOrMetric(int name)
        Returns true if specified identifier is identifier of metric or Kronecker tensor
        Parameters:
        name - unique simple tensor identifier
        Returns:
        true if specified identifier is identifier of metric or Kronecker tensor
      • getKroneckerName

        public java.lang.String getKroneckerName()
        Returns string representation of Kronecker delta name
        Returns:
        string representation of Kronecker delta name
      • getMetricName

        public java.lang.String getMetricName()
        Returns string representation of metric tensor name
        Returns:
        string representation of metric tensor name
      • setKroneckerName

        public void setKroneckerName(java.lang.String name)
        Sets the default Kronecker tensor name. After this step, Kronecker tensor will be printed with the specified string name.
        Parameters:
        name - string representation of Kronecker tensor name
      • setMetricName

        public void setMetricName(java.lang.String name)
        Sets the default metric tensor name. After this step, metric tensor will be printed with the specified string name.
        Parameters:
        name - string representation of metric tensor name
      • mapNameDescriptor

        public NameDescriptor mapNameDescriptor(java.lang.String sname,
                                                StructureOfIndices... structureOfIndices)
        This method returns the existing name descriptor of simple tensor from the raw data if it contains in the namespace or constructs and puts to namespace new instance of name descriptor otherwise.
        Parameters:
        sname - string name of tensor
        structureOfIndices - structure of tensor indices (first element in array) and structure of indices of arguments (in case of tensor field)
        Returns:
        name descriptor corresponding to the specified information of tensor
      • getNameDescriptor

        public NameDescriptor getNameDescriptor(int nameId)
        Returns the name descriptor of the specified unique identifier of simple tensor.
        Parameters:
        nameId - unique identifier of simple tensor
        Returns:
        name descriptor of the specified unique identifier of simple tensor
      • generateNewSymbolDescriptor

        public NameDescriptor generateNewSymbolDescriptor()
        Returns a descriptor for symbol which was not already parsed.
        Returns:
        a descriptor for symbol which was not already parsed
      • size

        public int size()
      • getSeed

        public long getSeed()
        Returns the seed of the random generator used in name manager.
        Returns:
        seed of the random generator
      • getRandomGenerator

        public org.apache.commons.math3.random.RandomGenerator getRandomGenerator()

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.