# NOT RUN {
## ------------------------------------------------
## Method `.number$pop`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(1)
x$is.linked() # TRUE
x$pop()
x$is.linked() # FALSE
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$is.linked`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(1)
x$is.linked() # TRUE
x$pop()
x$is.linked() # FALSE
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$rank`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(matrix(rnorm(9), 3, 3))
x$rank() # 2
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$has.dx`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x1 = number(1)
x1$has.dx() # TRUE
x2 = number(1, dx=FALSE)
x2$has.dx() # FALSE
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$length`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(c(1, 2, 3))
x$length() # 3
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$dim`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(matrix(rnorm(9, 3, 3)))
x$dim() # c(3, 3)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$set.v`
## ------------------------------------------------
modello.init(10, 10, 10, 10)
x = number(1)
x$set.v(2)
x$get.v()
modello.close()
## ------------------------------------------------
## Method `.number$get.v`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(1)
x$set.v(2)
x$get.v()
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$set.dv`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(1)
x$set.dv(1)
x$get.dv()
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$set.slice`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(matrix(0, 3, 3))
print(x$v)
print(x$dv)
x$set.slice(1, 1:3, 1:3)
x$set.slice(2, 1:3, 1:3, dx=TRUE)
print(x$v)
print(x$dv)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$set.flat_slice`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(matrix(0, 3, 3))
print(x$v)
print(x$dv)
x$set.flat_slice(1, 1:9)
x$set.flat_slice(2, 1:9, dx=TRUE)
print(x$v)
print(x$dv)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$get.dv`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(1)
x$set.dv(1)
x$get.dv()
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$slice`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(matrix(rnorm(9), 3, 3))
print(x$v)
y = x$slice(1:2, 1:3)
print(y$v)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$flat_slice`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(matrix(rnorm(9), 3, 3))
print(x$v)
y = x$flat_slice(1:6)
print(y$v)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$contiguous.slice`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(matrix(rnorm(9), 3, 3))
print(x$v)
y = x$slice(1, 2)
print(y$v)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$reshape`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(c(1, 2, 3, 4, 5, 6))
y = x$reshape(c(3, 2))
print(x)
print(x$v)
print(y)
print(y$v)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$drop.dim`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(as.matrix(c(1, 2, 3)))
print(x)
print(x$v)
y = x$drop.dim()
print(y)
print(y$v)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$bind`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x = number(as.matrix(c(1, 2, 3)))
y = number(as.matrix(c(4, 5, 6)))
z = x$bind(y, 2)
print(z)
print(z$v)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$op`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
g = graph.open()
x1 = number(1)
x2 = number(2)
x3 = x1 + x2
graph.close()
print(x3$v)
x1$v = 2
x3$op()
print(x3$v)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$bw.zero`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
g = graph.open()
x1 = number(4)
x2 = number(2)
x3 = x1 ** x2
g = graph.close()
print(x1$dv)
print(x2$dv)
x3$dv = 1
x3$bw()
print(x1$dv)
print(x2$dv)
x3$bw.zero()
print(x1$dv)
print(x2$dv)
modello.close()
# }
# NOT RUN {
## ------------------------------------------------
## Method `.number$bw`
## ------------------------------------------------
# }
# NOT RUN {
modello.init(10, 10, 10, 10)
x1 = number(4)
x2 = number(2)
g = graph.open()
x3 = x1 ** x2
graph.close()
print(x1$dv)
print(x2$dv)
x3$dv = 1
x3$bw()
print(x1$dv)
print(x2$dv)
x3$bw.zero()
print(x1$dv)
print(x2$dv)
modello.close()
# }
Run the code above in your browser using DataLab