number: Create New Number

Description Usage Arguments Value Author(s) Examples

Description

S3 method for creating new numbers.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## S3 method for class 'integer'
number(x, dx = TRUE, ...)

## S3 method for class 'numeric'
number(x, dx = TRUE, scalar = FALSE, ...)

## S3 method for class 'array'
number(x, dx = TRUE, ...)

number(x, ...)

Arguments

x

integer, numeric, or array

dx

if TRUE to the number is attributed a derivative

...

further arguments, actually ignored

scalar

if TRUE the number is implemented as scalar (rank = 0)

Value

Returns a reference object of class 'number'

Author(s)

Filippo Monari

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
modello.init(n.numbers=10, n.nodes=10, n.graphs=10, n.opts=10)
x = number(integer(3))
print(x)
print(x$v)
modello.close()
modello.init(n.numbers=10, n.nodes=10, n.graphs=10, n.opts=10)
x1 = number(1, scalar=TRUE)
print(x1)
print(x1$v)
x2 = number(1)
print(x2)
print(x2$v)
x3 = number(c(1, 2, 3))
print(x3)
print(x3$v)
modello.close()
modello.init(n.numbers=10, n.nodes=10, n.graphs=10, n.opts=10)
x = number(matrix(rnorm(9), 3, 3))
print(x)
print(x$v)
modello.close()

modello documentation built on Feb. 2, 2021, 9:06 a.m.

Related to number in modello...