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

How to use
PrimitiveSubgraphPartition
in
cc.redberry.core.graph

Best Java code snippets using cc.redberry.core.graph.PrimitiveSubgraphPartition (Showing top 11 results out of 315)

origin: cc.redberry/physics

public It(int gamma, int gamma5, Product product, IndexType matrixType, Indicator<GraphType> filter) {
  this.gamma = gamma;
  this.gamma5 = gamma5;
  this.product = product;
  this.content = product.getContent();
  this.matrixType = matrixType;
  this.partition
      = PrimitiveSubgraphPartition.calculatePartition(this.content, matrixType);
  this.filter = filter;
}
origin: cc.redberry/core

/**
 * Creates partition of graph (or equivalently the product of indexed tensors) specified by {@link ProductContent}
 * taking into account edges (dummy indices) of specified {@link IndexType}. This method returns an array of all its
 * sub-graphs of types specified by {@link GraphType}.
 *
 * @param p    {@link ProductContent} representing the graph
 * @param type type of edges to be taken into account in partition
 * @since 1.1
 */
public static PrimitiveSubgraph[] calculatePartition(ProductContent p, IndexType type) {
  return new PrimitiveSubgraphPartition(p, type).partition;
}
origin: cc.redberry/core

private PrimitiveSubgraph[] calculatePartition() {
  List<PrimitiveSubgraph> subgraphs = new ArrayList<>();
  for (int pivot = 0; pivot < size; ++pivot)
    if (pc.get(pivot).getIndices().size(type) != 0 && !used.get(pivot))
      subgraphs.add(calculateComponent(pivot));
  return subgraphs.toArray(new PrimitiveSubgraph[subgraphs.size()]);
}
origin: cc.redberry/core

left = right = getLinks(pivot);
  return processGraph(pivot);
    return processGraph(pivot);
    return new PrimitiveSubgraph(GraphType.Cycle, deque2array(positions));
    left = getLinks(leftPivot);
      return processGraph(pivot);
    return new PrimitiveSubgraph(GraphType.Cycle, deque2array(positions));
  left = getLinks(leftPivot);
  right = getLinks(rightPivot);
return new PrimitiveSubgraph(GraphType.Line, deque2array(positions));
origin: cc.redberry/core

/**
 * Creates partition of graph (or equivalently the product of indexed tensors) specified by {@link ProductContent}
 * taking into account edges (dummy indices) of specified {@link IndexType}.
 *
 * @param productContent {@link ProductContent} representing the graph
 * @param type           type of edges to be taken into account in partition
 */
public PrimitiveSubgraphPartition(ProductContent productContent, IndexType type) {
  this.pc = productContent;
  this.fcs = pc.getStructureOfContractions();
  this.size = pc.size();
  this.type = type;
  this.used = new BitArray(size);
  this.partition = calculatePartition();
}
origin: cc.redberry/core

/**
 * Creates a partition of graph (or equivalently the product of indexed tensors) specified by {@link Product} taking
 * into account edges (dummy indices) of specified {@link IndexType}. This method returns an array of all its
 * sub-graphs of types specified by {@link GraphType}. <b>Note</b>, that only indexed part of specified product
 * (i.e. its {@link ProductContent}) will be taken into account. So the positions of sub-graphs elements in {@link
 * PrimitiveSubgraph} may not be equal to the positions of tensors in product (since it can e.g. have a symbolic
 * part), but strictly corresponds to the positions of tensors in its {@link ProductContent}, i.e. in the indexed
 * part of the product.
 *
 * @param p    {@link Product} representing the graph
 * @param type type of edges to be taken into account in partition
 * @return the partition of graph, i.e. an array of all its sub-graphs of types specified by {@link GraphType}
 * @since 1.1
 */
public static PrimitiveSubgraph[] calculatePartition(Product p, IndexType type) {
  return new PrimitiveSubgraphPartition(p.getContent(), type).partition;
}
origin: cc.redberry/core

void printData() {
  ArrayList<SubgraphContainer> subgraphs = new ArrayList<>();
  for (IndexType type : matrixTypes) {
    PrimitiveSubgraph[] sgs = PrimitiveSubgraphPartition.calculatePartition(getContent(), type);
    out0:
    for (PrimitiveSubgraph sg : sgs) {
origin: cc.redberry/core

private static Tensor inverseOrderInProduct(Product product, IndexType type) {
  ProductContent pc = product.getContent();
  PrimitiveSubgraph[] subgraphs = PrimitiveSubgraphPartition.calculatePartition(pc, type);
  Tensor[] data = pc.getDataCopy();
  boolean somethingDone = false;
origin: cc.redberry/physics

private Tensor expandDiracStructures(final Tensor t) {
  FromChildToParentIterator iterator = new FromChildToParentIterator(t);
  Tensor current;
  while ((current = iterator.next()) != null) {
    if (!(current instanceof Product))
      continue;
    //early termination
    if (!containsGammaOr5Matrices(current))
      continue;
    Product product = (Product) current;
    //positions of matrices
    PrimitiveSubgraph[] partition
        = PrimitiveSubgraphPartition.calculatePartition(product.getContent(), matrixType);
    //traces (expand brackets)
    boolean containsTraces = false;
    traces:
    for (PrimitiveSubgraph subgraph : partition) {
      if (subgraph.getGraphType() != GraphType.Cycle)
        continue traces;
      //expand each cycle
      containsTraces = true;
    }
    if (containsTraces)
      iterator.set(multiply(product.getIndexlessSubProduct(),
          expandAndEliminate.transform(product.getDataSubProduct())));
  }
  return iterator.result();
}
origin: cc.redberry/physics

ProductContent productContent = product.getContent();
PrimitiveSubgraph[] subgraphs
    = PrimitiveSubgraphPartition.calculatePartition(productContent, matrixType);
origin: cc.redberry/physics

= PrimitiveSubgraphPartition.calculatePartition(pc, matrixType);
cc.redberry.core.graphPrimitiveSubgraphPartition

Javadoc

This class represents a partition of graph into sub-graphs of types specified in GraphType. Such a partition takes into account links (dummy indices) of single IndexType (specified as parameter).

Most used methods

  • calculatePartition
    Creates partition of graph (or equivalently the product of indexed tensors) specified by ProductCont
  • <init>
    Creates partition of graph (or equivalently the product of indexed tensors) specified by ProductCont
  • calculateComponent
  • deque2array
  • getLinks
  • processGraph

Popular in Java

  • Making http requests using okhttp
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • BoxLayout (javax.swing)
  • Option (scala)
  • Best plugins for Eclipse
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