Learn R Programming

modello (version 0.1.1)

number.integer: Create New Number

Description

S3 method for creating new numbers.

Usage

# S3 method for integer
number(x, dx = TRUE, ...)

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

# S3 method for 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'

Examples

Run this code
# NOT RUN {
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()
# }

Run the code above in your browser using DataLab