dual-class | R Documentation |

The method `initialize`

sets the initial values of a new object of the class `dual`

.

The function `dual`

generates an object of class `dual`

for the representation of dual numbers.

The function `is.dual`

returns `TRUE`

if `x`

is of the class `dual`

. It retuns `FALSE`

otherwise.

The method `show`

shows the content of a `dual`

object.

```
dual(f, grad)
## S4 method for signature 'dual'
initialize(.Object, f = numeric(0), grad = numeric(0))
dual(f, grad)
is.dual(x)
## S4 method for signature 'dual'
show(object)
```

`f` |
a single numeric value denoting the "Real" component of the dual number. |

`grad` |
a numeric vector rappresenting the "Dual" components of the dual number. |

`.Object` |
an object of class |

`x` |
an object of class |

`object` |
an object of class |

an object of the class `dual`

.

a logical value indicating if the object is of the class `dual`

or not.

`f`

a single numeric value denoting the "Real" component of the dual number

`grad`

a numeric vector rappresenting the "Dual" components of the dual number

```
x <- dual(3, 0:1)
library(dual)
x <- new("dual", f = 1, grad = 1)
is.dual(3)
is.dual(x)
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.