mrfi() creates an object of class mrfi based on a distance rule and optionally a list of relative positions. The argument max_norm and norm_type can be used to automatically include all positions within a "range" defined by the norm type chosen and distance using that norm.

A list of relative positions may also be included to specify sparse interaction structures, for example.

mrfi(max_norm = 1, norm_type = "1", positions = NULL)

Arguments

max_norm

a numeric value. All points with norm \(\le\) max_dist are included.

norm_type

a character indicating the norm type used. Possible values are "m", "1", "2", etc. See norm for details.

positions

a list of numeric vectors of length 2. Each vector corresponds to a relative position included.

Value

A mrfi object.

Note

If a position in positions is already included due to the max_norm and norm_type specification, the second ocurrence is ignored. The same is valid for repeated or opposite positions in positions.

See also

A paper with detailed description of the package can be found at https://arxiv.org/abs/2006.00383

Examples

mrfi(1)
#> 2 interacting positions. #> rx ry #> 1 0 #> 0 1
mrfi(2)
#> 6 interacting positions. #> rx ry #> 1 0 #> 2 0 #> -1 1 #> 0 1 #> 1 1 ... and 1 more.
mrfi(2, norm_type = "m")
#> 12 interacting positions. #> rx ry #> 1 0 #> 2 0 #> -2 1 #> -1 1 #> 0 1 ... and 7 more.
mrfi(1, positions = list(c(4,4), c(-4,4)))
#> 4 interacting positions. #> rx ry #> 1 0 #> 0 1 #> 4 4 #> -4 4
#Repeated positions are handled automatically mrfi(1, positions = list(c(1,0), c(2,0)))
#> 3 interacting positions. #> rx ry #> 1 0 #> 0 1 #> 2 0