/** * 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; }
/** * 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; }