Last data update: 2014.03.03

R: Set a S4 manifold object
setManifoldR Documentation

Set a S4 manifold object

Description

The function sets an object of class manifold.

Usage

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.

See Also

setProcess.

Examples

# 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)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(FieldSim)
Loading required package: rgl
Loading required package: RColorBrewer
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/FieldSim/setManifold.Rd_%03d_medium.png", width=480, height=480)
> ### Name: setManifold
> ### Title: Set a S4 manifold object
> ### Aliases: setManifold
> 
> ### ** Examples
> 
> # 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)
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
> 
> #Example 2: The "line" manifold
> line<-setManifold("line")
> str(line)
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
> 
> #Example 3: The "plane" manifold
> plane<-setManifold("plane")
> str(plane)
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
> 
> #Example 4: The "sphere" manifold
> sphere<-setManifold("sphere")
> str(sphere)
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
> 
> #Example 5: The "hyperboloid" manifold
> hyper<-setManifold("hyperboloid")
> str(hyper)
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
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>