readRule: reads a quadrature-rule from a text file

Description Usage Arguments Details Value See Also Examples

Description

readRule reads a quadrature-rule from a text file

Usage

1

Arguments

file

file name of the text file containing the quadrature rule

Details

The text file containing the quadrature rule has to be formatted in the following way:

The first line have to declare the domain initial.domain a b, where a and b denotes the lower and upper-bound for the integration domain. This can be either a number or '-Inf'/'Inf' (for example initial.domain 0 1 or initial.domain 0 Inf)

Every following line contains one single node and weight belonging to one level of the rule (format: 'level' 'node' 'weight'). This example shows the use for the "midpoint-rule" (levels: 1 - 3).

> initial.domain 0 1

> 1 0.5 1

> 2 0.25 0.5

> 2 0.75 0.5

> 3 0.166666666666667 0.333333333333333

> 3 0.5 0.333333333333333

> 3 0.833333333333333 0.333333333333333

Value

Returns an object of class 'customRule', which can be used for creating a 'NIGrid' (createNIGrid)

See Also

createNIGrid

Examples

1
2
## Not run: myRule <- readRule(file="midpoint_rule.txt")
## Not run: nw <- createNIGrid(d=1, type = myRule.txt, level = 2)

weiserc/mvQuad documentation built on May 4, 2019, 4:18 a.m.