readRule | R Documentation |
readRule
reads a quadrature-rule from a text file
readRule(file = NULL)
file |
file name of the text file containing the quadrature rule |
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
Returns an object of class 'customRule', which can be used for creating a 'NIGrid' (createNIGrid
)
createNIGrid
## Not run: myRule <- readRule(file="midpoint_rule.txt")
## Not run: nw <- createNIGrid(d=1, type = myRule.txt, level = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.