Skip to contents

Computes both ascending and descending gradient trajectories from a grid point.

Usage

compute.gradient.trajectory(i, j, f.grid)

Arguments

i

Row index of starting point

j

Column index of starting point

f.grid

Matrix of function values

Value

List containing:

ascending.path

Matrix of (i,j) coordinates along ascending path

descending.path

Matrix of (i,j) coordinates along descending path

local.max

Coordinates of destination local maximum

local.min

Coordinates of destination local minimum

Examples

if (FALSE) { # \dontrun{
grid <- create.grid(30)
f <- function(x, y) -((x-0.5)^2 + (y-0.5)^2)
f.grid <- evaluate.function.on.grid(f, grid)
traj <- compute.gradient.trajectory(15, 15, f.grid)
str(traj)
} # }