# setManifold: Set a S4 manifold object In FieldSim: Random Fields (and Bridges) Simulations

## Description

The function sets an object of class manifold.

## Usage

 `1` ```setManifold(name,atlas,gridtype,distance,origin) ```

## Arguments

 `name` name of the manifold (type character); `atlas` atlas of the manifold (type matrix); `gridtype` is the grid type (a character string) to plotting; `distance` distance on the manifold (type function); `origin` origin of the manifold (type matrix).

## Value

An object of class manifold with the 5 slots name, atlas, gridtype, distance and origin.

## Author(s)

Alexandre Brouste (http://perso.univ-lemans.fr/~abrouste/) and Sophie Lambert-Lacroix (http://membres-timc.imag.fr/Sophie.Lambert/).

## References

A. Brouste, J. Istas and S. Lambert-Lacroix (2010). On simulation of manifold indexed fractional Gaussian fields.

`setProcess`.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27``` ```# Load FieldSim library library(FieldSim) # Example 1: User manifold name1<-"plane1" mesh<-seq(from=0,to=1,length=16) atlas1<-rbind(rep(mesh,each=16),rep(mesh,16)) d1<-function(xi,xj){return(sqrt(t(xi-xj)%*%(xi-xj)))} origin1<-rbind(0,0) manifold1<-setManifold(name=name1, atlas=atlas1, distance=d1, origin=origin1) str(manifold1) #Example 2: The "line" manifold line<-setManifold("line") str(line) #Example 3: The "plane" manifold plane<-setManifold("plane") str(plane) #Example 4: The "sphere" manifold sphere<-setManifold("sphere") str(sphere) #Example 5: The "hyperboloid" manifold hyper<-setManifold("hyperboloid") str(hyper) ```

### Example output

```Loading required package: rgl
Warning messages:
1: In rgl.init(initValue, onlyNULL) : RGL: unable to open X11 display
2: 'rgl_init' failed, running with rgl.useNULL = TRUE
call: fun(...)
Formal class 'manifold' [package "FieldSim"] with 5 slots
..@ name    : chr "plane1"
..@ atlas   : num [1:2, 1:256] 0 0 0 0.0667 0 ...
..@ gridtype: chr "user"
..@ distance:function (xi, xj)
..@ origin  : num [1:2, 1] 0 0
Formal class 'manifold' [package "FieldSim"] with 5 slots
..@ name    : chr "line"
..@ atlas   : num [1, 1:257] 0 1 0.5 0.25 0.75 0.125 0.375 0.625 0.875 0.0625 ...
..@ gridtype: chr "visualization"
..@ distance:function (xi, xj)
..@ origin  : num [1, 1] 0
Formal class 'manifold' [package "FieldSim"] with 5 slots
..@ name    : chr "plane"
..@ atlas   : num [1:2, 1:289] 0 0 0 1 1 0 1 1 0.5 0.5 ...
..@ gridtype: chr "visualization"
..@ distance:function (xi, xj)
..@ origin  : num [1:2, 1] 0 0
Formal class 'manifold' [package "FieldSim"] with 5 slots
..@ name    : chr "sphere"
..@ atlas   : num [1:3, 1:600] -0.74 -0.74 NaN -0.74 -0.576 ...
..@ gridtype: chr "visualization"
..@ distance:function (xi, xj)
..@ origin  : num [1:3, 1] 1 0 0
Formal class 'manifold' [package "FieldSim"] with 5 slots
..@ name    : chr "hyperboloid"
..@ atlas   : num [1:3, 1:256] -3 -3 4.36 -3 -2.6 ...
..@ gridtype: chr "visualization"
..@ distance:function (xi, xj)
..@ origin  : num [1:3, 1] 0 0 1
```

FieldSim documentation built on May 29, 2017, 2:10 p.m.