knotoptim: Optimization of knot appearance

knotoptimR Documentation

Optimization of knot appearance

Description

Optimization of knot appearance using user-definable objective functions

Usage

knotoptim(svg, weights=1, symobj=NULL,
  Mver = NULL, xver = NULL, Mhor = NULL, xhor = NULL, Mrot = NULL,
  mcdonalds = FALSE, celtic = FALSE, ou, prob = 0, useNLM=TRUE, ...)

Arguments

svg

Name of an svg file to read

Mver, xver, Mhor, xhor, Mrot, mcdonalds, celtic

Arguments passed to symmetry_object(), specifying the symmetry of the knot

symobj

A symmetry object

ou

An overunder object

prob

The probability of plotting a knotplot; this is slow so don't make this too big

weights

A vector of weights, defaulting to all ones, passed to badness()

useNLM

Boolean, with default TRUE meaning to use nlm() and FALSE meaning to use optim()

...

Further arguments passed to nlm()

Details

Function knotoptim() is a generic optimization routine that starts from an svg file and minimizes the knot's badness().

The weights argument is documented more fully at badness.Rd.

Value

Returns a knot object

Author(s)

Robin K. S. Hankin

See Also

symmetry_object, badness

Examples


## Not run:     #takes too long
knotoptim(
      svg = system.file("4_1_first_draft.svg",package="knotR"),
     Mver = rbind(c(2,3),c(9,7),c(10,6),c(1,4),c(5,11)),
     xver = 8,   # node on vertical axis
     ou   = rbind( c(1,5), c(9,2), c(4,8),c(6,11)),
     prob = 0.1,
  iterlim = 100, print.level=2)

## End(Not run)

knotR documentation built on June 22, 2024, 6:56 p.m.