Tabnine Logo
ParseTokenTransformer.transform
Code IndexAdd Tabnine to your IDE (free)

How to use
transform
method
in
cc.redberry.core.parser.ParseTokenTransformer

Best Java code snippets using cc.redberry.core.parser.ParseTokenTransformer.transform (Showing top 5 results out of 315)

origin: cc.redberry/physics

DiracSimplify1(DiracOptions options) {
  super(options, IDENTITY);
  ParseToken[] ss = {s1, s2, s3, s4};
  this.subs = new Expression[ss.length];
  for (int i = 0; i < ss.length; ++i)
    subs[i] = (Expression) deltaTrace.transform(tokenTransformer.transform(ss[i]).toTensor());
}
origin: cc.redberry/core

/**
 * @param expression          string expression
 * @param tensorPreprocessors transformation
 * @param nodesPreprocessors  AST transformers
 * @return tensor
 */
public Tensor parse(String expression, Transformation[] tensorPreprocessors, ParseTokenTransformer[] nodesPreprocessors) {
  ParseToken node = parser.parse(expression);
  for (ParseTokenTransformer tr : nodesPreprocessors)
    node = tr.transform(node);
  Tensor t = node.toTensor();
  for (Transformation tr : tensorPreprocessors)
    if (tr != t)
      t = tr.transform(t);
  return t;
}
origin: cc.redberry/core

/**
 * @param expression          string expression
 * @param tensorPreprocessors transformation
 * @param nodesPreprocessors  AST transformers
 * @return tensor
 */
public Tensor parse(String expression, List<Transformation> tensorPreprocessors, List<ParseTokenTransformer> nodesPreprocessors) {
  ParseToken node = parser.parse(expression);
  for (ParseTokenTransformer tr : nodesPreprocessors)
    node = tr.transform(node);
  Tensor t = node.toTensor();
  for (Transformation tr : tensorPreprocessors)
    if (tr != t)
      t = tr.transform(t);
  return t;
}
origin: cc.redberry/physics

private Tensor traceWith5(Tensor product, int numberOfGammas) {
  if (traceOf4GammasWith5 == null) {
    traceOf4GammasWith5 = (Expression) tokenTransformer.transform(traceOf4GammasWith5Token).toTensor();
    chiholmKahaneIdentity = (Expression) tokenTransformer.transform(chiholmKahaneToken).toTensor();
    chiholmKahaneIdentityReversed = (Expression) tokenTransformer.transform(chiholmKahaneTokenReversed).toTensor();
    chiholmKahaneIdentityReversed = (Expression) deltaTrace.transform(chiholmKahaneIdentityReversed);
  }
  if (numberOfGammas == 5)//including one gama5
    product = traceOf4GammasWith5.transform(product);
  else {
    product = chiholmKahaneIdentityReversed.transform(product);
    //no gamma5 leaved
    product = getTraceSubstitution(numberOfGammas + 1).transform(product);
  }
  product = expandAndEliminate.transform(product);
  product = deltaTrace.transform(product);
  product = traceOfOne.transform(product);
  if (simplifyLeviCivita != null) {
    product = simplifyLeviCivita.transform(product);
    product = deltaTrace.transform(product);
    product = traceOfOne.transform(product);
  }
  return product;
}
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();
}
cc.redberry.core.parserParseTokenTransformertransform

Javadoc

Transforms specified AST node.

Popular methods of ParseTokenTransformer

    Popular in Java

    • Making http post requests using okhttp
    • setContentView (Activity)
    • setRequestProperty (URLConnection)
    • orElseThrow (Optional)
      Return the contained value, if present, otherwise throw an exception to be created by the provided s
    • FlowLayout (java.awt)
      A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
    • EOFException (java.io)
      Thrown when a program encounters the end of a file or stream during an input operation.
    • MalformedURLException (java.net)
      This exception is thrown when a program attempts to create an URL from an incorrect specification.
    • Timestamp (java.sql)
      A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
    • Get (org.apache.hadoop.hbase.client)
      Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
    • Reflections (org.reflections)
      Reflections one-stop-shop objectReflections scans your classpath, indexes the metadata, allows you t
    • Top plugins for Android Studio
    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