Skip to contents

Applies a specified harmonic extension method to a local subgraph around an extremum. This function interfaces with C++ implementations of various harmonic extension algorithms.

Usage

apply.harmonic.extension(
  subgraph,
  method = c("weighted_mean", "harmonic_iterative", "harmonic_eigen",
    "biharmonic_harmonic", "boundary_smoothed"),
  max_iterations = 100,
  tolerance = 1e-06,
  sigma = 1,
  record_iterations = TRUE,
  verbose = FALSE
)

Arguments

subgraph

A subgraph object created by extract.extrema.subgraphs

method

Character string specifying the smoothing method:

"weighted_mean"

Weighted mean hop disk extension

"harmonic_iterative"

Iterative harmonic extension

"harmonic_eigen"

Eigen-based harmonic extension

"biharmonic_harmonic"

Hybrid biharmonic-harmonic extension

"boundary_smoothed"

Boundary smoothed harmonic extension

max_iterations

Integer maximum number of iterations for iterative methods (default: 100)

tolerance

Numeric convergence tolerance (default: 1e-6)

sigma

Numeric parameter for weighted mean method (default: 1.0)

record_iterations

Logical whether to record intermediate states (default: TRUE)

verbose

Logical whether to print progress information (default: FALSE)

Value

A list containing:

original

Original function values

smoothed

Smoothed function values after harmonic extension

iterations

List of function values at each iteration (if record_iterations = TRUE)

method

Method used for smoothing

extremum_info

Information about the extremum

convergence_info

List with convergence information:

  • iterations_performed: Number of iterations

  • final_change: Maximum change in final iteration

  • converged: Whether convergence was achieved

Examples

if (FALSE) { # \dontrun{
# Assumes subgraph was created by extract.extrema.subgraphs
result <- apply.harmonic.extension(subgraph, method = "harmonic_eigen")
} # }