Tabnine Logo
ParseManager
Code IndexAdd Tabnine to your IDE (free)

How to use
ParseManager
in
cc.redberry.core.parser

Best Java code snippets using cc.redberry.core.parser.ParseManager (Showing top 10 results out of 315)

origin: cc.redberry/core

/**
 * Allows to parse expressions with repeated indices of the same variance (like T_aa or T_a*T^a which results in T^a_a
 * and T^a*T_a respactively)
 *
 * @param b allow or not to parse repeated indices with same variance
 */
public void setParserAllowsSameVariance(boolean b) {
  parseManager.getParser().setAllowSameVariance(b);
}
origin: cc.redberry/core

/**
 * @param expression string expression
 * @return tensor
 */
public Tensor parse(String expression) {
  return parse(expression, defaultTensorPreprocessors, defaultParserPreprocessors);
}
origin: cc.redberry/core

/**
 * Resets all definitions.
 */
public synchronized void reset() {
  resetTensorNames();
  parseManager.reset();
}
origin: cc.redberry/core

/**
 * Creates context from the settings
 *
 * @param contextSettings settings
 * @see ContextSettings
 */
public Context(ContextSettings contextSettings) {
  this.parseManager = new ParseManager(contextSettings.getParser());
  this.converterManager = contextSettings.getConverterManager();
  this.nameManager = new NameManager(contextSettings.getNameManagerSeed(),
      contextSettings.getKronecker(), contextSettings.getMetricName());
  this.defaultOutputFormat = contextSettings.getDefaultOutputFormat();
  EnumSet<IndexType> metricTypes = EnumSet.noneOf(IndexType.class);
  EnumSet<IndexType> matrixTypes = EnumSet.allOf(IndexType.class);
  for (IndexType type : contextSettings.getMetricTypes()) {
    matrixTypes.remove(type);
    metricTypes.add(type);
    this.metricTypesBits.set(type.getType());
  }
  this.metricTypes = Collections.unmodifiableSet(metricTypes);
  this.matrixTypes = Collections.unmodifiableSet(matrixTypes);
}
origin: cc.redberry/core

/**
 * Returns whether repeated indices of the same variance are allowed to be parsed
 *
 * @return whether repeated indices of the same variance are allowed to be parsed
 */
public boolean getParserAllowsSameVariance() {
  return parseManager.getParser().isAllowSameVariance();
}
origin: cc.redberry/core

/**
 * @param expression         string expression
 * @param nodesPreprocessors AST transformers
 * @return tensor
 */
public Tensor parse(String expression, ParseTokenTransformer... nodesPreprocessors) {
  return parse(expression, new Transformation[0], nodesPreprocessors);
}
origin: cc.redberry/physics

public SchoutenIdentities4(SimpleTensor leviCivita) {
  this.leviCivita = leviCivita;
  ChangeIndicesTypesAndTensorNames tokenTransformer = new ChangeIndicesTypesAndTensorNames(TypesAndNamesTransformer.Utils.and(
      TypesAndNamesTransformer.Utils.changeName(new String[]{"e"}, new String[]{leviCivita.getStringName()}),
      TypesAndNamesTransformer.Utils.changeType(IndexType.LatinLower, IndicesUtils.getTypeEnum(leviCivita.getIndices().get(0)))));
  this.schouten1 = new Tensor[schoutenCombinations1.length];
  for (int i = 0; i < schouten1.length; i++)
    schouten1[i] = tokenTransformer.transform(CC.current().getParseManager().getParser().parse(schoutenCombinations1[i])).toTensor();
  this.schouten2 = new Tensor[schoutenCombinations2.length];
  for (int i = 0; i < schouten2.length; i++)
    schouten2[i] = tokenTransformer.transform(CC.current().getParseManager().getParser().parse(schoutenCombinations2[i])).toTensor();
  this.schouten3 = new Tensor[schoutenCombinations3.length];
  for (int i = 0; i < schouten3.length; i++)
    schouten3[i] = tokenTransformer.transform(CC.current().getParseManager().getParser().parse(schoutenCombinations3[i])).toTensor();
  allSchouten = new Tensor[][]{schouten1, schouten2, schouten3};
}
origin: cc.redberry/core

/**
 * Converts string expression into tensor.
 *
 * @param expression string to be parsed
 * @return result of parsing
 * @throws cc.redberry.core.parser.ParserException if expression does not satisfy correct Redberry
 *                                                 input notation for tensors
 */
public static Tensor parse(String expression) {
  return CC.current().getParseManager().parse(expression);
}
origin: cc.redberry/physics

protected AbstractTransformationWithGammas(DiracOptions options) {
  checkNotation(options.gammaMatrix, options.gamma5, options.leviCivita);
  if (!options.created)
    options.triggerCreate();
  this.gammaName = options.gammaMatrix.getName();
  this.gamma5Name = options.gamma5 == null ? Integer.MIN_VALUE : options.gamma5.getName();
  final IndexType[] types = TraceUtils.extractTypesFromMatrix(options.gammaMatrix);
  this.metricType = types[0];
  this.matrixType = types[1];
  this.tokenTransformer = createTokenTransformer(metricType, matrixType, options.gammaMatrix, options.gamma5, options.leviCivita);
  this.expandAndEliminate = options.expandAndEliminate;
  this.traceOfOne = (Expression) tokenTransformer.transform(CC.current().getParseManager().getParser().parse("d^a'_a'=" + options.traceOfOne)).toTensor();
  this.deltaTrace = (Expression) tokenTransformer.transform(CC.current().getParseManager().getParser().parse("d^a_a=" + options.dimension)).toTensor();
}
origin: cc.redberry/core

/**
 * Converts string expression into tensor, additionally transforming AST according to specified
 * AST transformers.
 *
 * @param expression    string to be parsed
 * @param preprocessors AST transformers
 * @return result of parsing
 * @throws cc.redberry.core.parser.ParserException if expression does not satisfy correct Redberry
 *                                                 input notation for tensors
 */
public static Tensor parse(String expression, ParseTokenTransformer... preprocessors) {
  return CC.current().getParseManager().parse(expression, preprocessors);
}
cc.redberry.core.parserParseManager

Most used methods

  • getParser
  • <init>
  • parse
  • reset
    Clears all defaults

Popular in Java

  • Start an intent from android
  • getResourceAsStream (ClassLoader)
  • getExternalFilesDir (Context)
  • runOnUiThread (Activity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Reference (javax.naming)
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Option (scala)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now