knotoptim: Optimization of knot appearance

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Optimization of knot appearance using user-definable objective functions

Usage

1
2
3
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.

Value

Returns a knot object

Author(s)

Robin K. S. Hankin

See Also

symmetry_object, badness

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## 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 May 1, 2019, 9:10 p.m.