SavePartition: Saves the computed hat function into a file

Description Usage Arguments Value Author(s) Examples

Description

Function for saving previously computed hat function to file name(string)

Usage

1

Arguments

string

The file name to save the partition

Value

output

The output is 0 if the function was successful, or 1 if no hat function was computed, or 2 if the file cannot be opened.

Author(s)

Gleb Beliakov, Daniela L. Calderon, Deakin University

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
    dim<-3
	left<-c(0,0,0)
	right<-c(5,5,5)

	ranlip.Init(dim, left, right);
	

	num <- 10
	numfine <- 2
	MinLip <- 1

	Fn <- function(x,dim){
		out <- exp(-sum(x*x))
  
		return(out)
	}
	
	ranlip.PrepareHatFunctionAuto(num, numfine, MinLip, Fn);
	
# we don't want to create this file unnecessarily	
	 out<-ranlip.SavePartition("mypartition.txt")
	if(out>0) {print("File cannot be opened.")}  

	
 	ranlip.FreeMem()

ranlip documentation built on June 24, 2021, 9:08 a.m.

Related to SavePartition in ranlip...