.. default-domain:: chpl .. module:: Butterfly Butterfly ========= **Usage** .. code-block:: chapel use Butterfly; .. function:: proc combinations(_n: integral, _k: integral) Calculates the maximum number of inclusions that the AdjListHyperGraph object can contain without duplicates :returns: an integer representing the number of possible combinations .. method:: proc AdjListHyperGraphImpl.vertexHasNeighbor(v, e) Checks if the given vertex and edge are neighbors :arg v: ID of vertex to check :type v: int(64) :arg e: ID of edge to check :type e: int(64) :returns: True if the vertex and edge are neighbors or false if vertex and edge are not neighbors :rtype: boolean .. function:: proc getVertexButterflies(graph: AdjListHyperGraph) Counts the number of 4-cycles for each vertex and stores that number as an int(64) in an array under the ID of that vertex :returns: An array of range 0..N where N is the highest vertex ID int the AdjListHyperGraph object :rtype: array of int(64) .. itermethod:: iter AdjListHyperGraphImpl.getAdjacentVertices(v) Yields all vertices that share a neighboring edge with this vertex :arg v: ID of the target vertex :type v: int(64) :yields: All vertices that share at least one neighboring edge with this vertex :ytype: array of int(64) .. itermethod:: iter AdjListHyperGraphImpl.getAdjacentVertices(v, param tag) Yields all vertices that share a neighboring edge with this vertex :arg v: ID of the target vertex :type v: int(64) :yields: All vertices that share at least one neighboring edge with this vertex :ytype: array of int(64) .. method:: proc AdjListHyperGraphImpl.areAdjacentVertices(v, w) Checks if two vertices share a common neighboring edge :arg v: first vertex to compare neighborlists :type v: int(64) :arg w: second vertex to compare neighborlists :type w: int(64) :returns: boolean value indicating the truth of the two input vertices sharing an edge neighbor :rtype: boolean .. method:: proc AdjListHyperGraphImpl.getInclusionNumButterflies(v, e) Calculates the number of 4-cycles that contain the inclusion defined by the given vertex and edge :arg v: the vertex contained in the inclusion to be tested :type v: vDescType :arg e: the edge contained in the inclusion to be tested :type e: eDescType :returns: the number of 4 cylces containing the given inclusion :rtype: int(64) .. method:: proc AdjListHyperGraphImpl.getInclusionNumCaterpillars(v, e) Calculates the number of 3 cycles that contains the inclusion defined by the given vertex and edge :arg v: the vertex contained within the inclusion to be tested :type v: vDescType :arg e: the edge contained within the inclusion to be tested :type e: eDescType :returns: the number of 3 cycles containing the given inclusion :rtype: int(64) .. method:: proc AdjListHyperGraphImpl.getInclusionMetamorphCoef(v, e) Calculates the metamorphosis coefficient of the inclusion defined by the given vertex and edge :arg v: the vertex contained within the inclusion to be tested :type v: vDescType :arg e: the edge contained within the inclusion to be tested :type e: eDescType :returns: the metamorphosis coefficient of the tested inclusion :rtype: real(64) .. method:: proc AdjListHyperGraphImpl.getVertexMetamorphCoefs() Calcuates the metamorphosis coefficient for every vertex in the AdjListHyperGraph object :returns: an array of metamorphosis coefficients where the index of each value is the ID of the associated vertex :rtype: real .. method:: proc AdjListHyperGraphImpl.getEdgeMetamorphCoefs() Calcuates the metamorphosis coefficient for every edge in the AdjListHyperGraph object :returns: an array of metamorphosis coefficients where the index of each value is the ID of the associated edge :rtype: real .. itermethod:: iter AdjListHyperGraphImpl.verticesWithDegree(value: int(64)) Fetches all vertices that have the degree queried :arg value: The desired degree :type value: any numeric type that can be cast as int(64) :yields: Vertices with desired degree :ytype: vDescType .. itermethod:: iter AdjListHyperGraphImpl.verticesWithDegree(value: int(64), param tag: iterKind) Fetches all vertices that have the degree queried :arg value: The desired degree :type value: any numeric type that can be cast as int(64) :yields: Vertices with the desired degree :ytype: vDescType .. itermethod:: iter AdjListHyperGraphImpl.edgesWithDegree(value: int(64)) Fetches all edges that have the degree queried :arg value: The desired degree :type value: any numeric type that can be cast as int(64) :yields: Edges with the desired degree :ytype: eDescType .. itermethod:: iter AdjListHyperGraphImpl.edgesWithDegree(value: int(64), param tag: iterKind) Fetches all edges that have the degree queried :arg value: The desired degree :type value: any numeric type that can be cast as int(64) :yields: Edges with the desired degree :ytype: eDescType .. method:: proc AdjListHyperGraphImpl.getVertexPerDegreeMetamorphosisCoefficients() Calcuates the per degree metamorphosis coefficient for the vertices in the AdjListHyperGraph object :returns: a list of range 1..n where n is the value of the highest existing degree of all vertices in the AdjListHyperGraph object :rtype: array of int(64) .. method:: proc AdjListHyperGraphImpl.getEdgePerDegreeMetamorphosisCoefficients() Calcuates the per degree metamorphosis coefficient for the edges in the AdjListHyperGraph object :returns: a list of range 1..n where n is the value of the highest existing degree of all edges in the AdjListHyperGraph object :rtype: array of int(64) .. function:: proc getEdgeButterflies(graph: AdjListHyperGraph) Counts the number of 4-cycles for each edge and stores that number as an int(64) in an array under the ID of that edge :returns: An array of range 0..N where N is the highest edge ID int the AdjListHyperGraph object :rtype: array of int(64) .. function:: proc getVertexCaterpillars(graph: AdjListHyperGraph) Calcuates the number of 3-cycles that include each vertex :returns: An array of range 0..n where n is the highest ID of all vertices in the AdjListHyperGraph object :rtype: array of int(64) .. function:: proc getEdgeCaterpillars(graph: AdjListHyperGraph) Calculates the number of 3-cycles that include each edge :returns: An array of range 0..n where n is the highest ID of all edges in the AdjListHyperGraph object :rtype: array of int(64)