Skip to contents

Reconstructs a complete gradient trajectory through a cell (m_i, M_j) passing through a specified interior vertex. The trajectory consists of an ascending segment from m_i to the interior vertex, followed by a descending segment from the interior vertex to M_j.

Usage

extract.cell.trajectory(basins.obj, min.vertex, max.vertex, interior.vertex)

Arguments

basins.obj

Basins object with terminal extrema

min.vertex

Minimum vertex m_i (1-based)

max.vertex

Maximum vertex M_j (1-based)

interior.vertex

Vertex in cell (m_i, M_j) (1-based)

Value

List with components:

  • ascending.segment: Trajectory from m_i to interior.vertex

  • descending.segment: Trajectory from interior.vertex to M_j

  • complete.trajectory: Full path from m_i through interior.vertex to M_j

  • y.values: Function values along complete trajectory

  • is.monotone: Logical indicating if trajectory is monotone

Examples

if (FALSE) { # \dontrun{
# Extract trajectory through cell (5, 10) passing through vertex 15
traj.info <- extract.cell.trajectory(basins, 
                                      min.vertex = 5, 
                                      max.vertex = 10, 
                                      interior.vertex = 15)

# Check monotonicity
if (!traj.info$is.monotone) {
  warning("Trajectory is not monotone - may contain spurious extrema")
}

# Plot trajectory
plot(seq_along(traj.info$y.values), traj.info$y.values, 
     type = "b", xlab = "Position", ylab = "Function value")
} # }