Skip to contents

Generates a comprehensive summary of a gradient flow basin complex, including detailed information about extrema, basins, basin overlaps, and cell complex structure.

Usage

# S3 method for class 'basin_cx'
summary(object, ...)

Arguments

object

An object of class "basin_cx" as created by create.basin.cx.

...

Additional arguments (currently unused).

Value

An object of class "summary.basin_cx" containing:

n_extrema

Total number of local extrema

n_minima

Number of local minima

n_maxima

Number of local maxima

minima

Data frame of local minima information

maxima

Data frame of local maxima information

n_ascending_basins

Number of merged ascending basins (minima)

n_descending_basins

Number of merged descending basins (maxima)

ascending_basin_sizes

Summary statistics of ascending basin sizes

descending_basin_sizes

Summary statistics of descending basin sizes

minima_info

Detailed information about each minimum basin including vertex, label, size, and function value

maxima_info

Detailed information about each maximum basin including vertex, label, size, and function value

ascending_basins_jaccard_index

Matrix of Jaccard indices between pairs of ascending basins

descending_basins_jaccard_index

Matrix of Jaccard indices between pairs of descending basins

cells_summary

Summary of cell complex structure

messages

Any messages generated during basin complex creation

Details

The summary method computes several key statistics and relationships:

Extrema Analysis: Counts and details of all local minima and maxima in the original function.

Basin Statistics: For both ascending (minimum) and descending (maximum) basins, provides counts, size distributions, and detailed information including the representative vertex, label, size (number of vertices), and function value.

Basin Overlap: Computes Jaccard indices between all pairs of basins of the same type. The Jaccard index measures the overlap between two basins as the ratio of their intersection size to their union size, ranging from 0 (no overlap) to 1 (complete overlap).

Cell Complex: Summarizes the structure of cells representing intersections between basins.

See also

create.basin.cx for creating basin complex objects, print.basin_cx for basic basin complex information, print.summary.basin_cx for printing summary objects

Examples

basin_cx <- list(
  basins = list(
    ascending = list(
      m1 = list(vertex = 2L, value = 0.7, vertices = c(1L, 2L)),
      m2 = list(vertex = 5L, value = 1.1, vertices = c(4L, 5L))
    ),
    descending = list(
      M1 = list(vertex = 3L, value = 3.2, vertices = c(2L, 3L, 4L))
    )
  ),
  local_extrema = data.frame(
    vertex_index = c(2L, 5L, 3L),
    label = c("m1", "m2", "M1"),
    is_maximum = c(0, 0, 1),
    fn_value = c(0.7, 1.1, 3.2)
  ),
  original_y = c(2.5, 0.7, 3.2, 1.8, 1.1),
  cells = list(
    asc_desc_cells = list(c1 = list(vertices = c(2L, 3L))),
    asc_asc_cells = list(),
    desc_desc_cells = list()
  )
)
class(basin_cx) <- "basin_cx"

basin_summary <- summary(basin_cx)
basin_summary$minima_info
basin_summary$cells_summary$total_cells