Creates a tensor with all entries one.

one.tensor(d=NULL,dn=NULL)

Arguments

d

the dimensions of the new tensor

dn

the dimnames of the new tensor

Value

A tensor with dim d and all elements one

Details

$$E_{i_1\ldots i_n}=1$$

See also

Author

K. Gerald van den Boogaart

Examples

one.tensor(c(a=3,b=3,c=3))
#> , , 1
#> 
#>       b
#> a      [,1] [,2] [,3]
#>   [1,]    1    1    1
#>   [2,]    1    1    1
#>   [3,]    1    1    1
#> 
#> , , 2
#> 
#>       b
#> a      [,1] [,2] [,3]
#>   [1,]    1    1    1
#>   [2,]    1    1    1
#>   [3,]    1    1    1
#> 
#> , , 3
#> 
#>       b
#> a      [,1] [,2] [,3]
#>   [1,]    1    1    1
#>   [2,]    1    1    1
#>   [3,]    1    1    1
#> 
#> attr(,"class")
#> [1] "tensor"