unigrids: Generating unifrom grids

Description Usage Arguments Details Value Examples

View source: R/definefuns.R

Description

This function generates a grid of multi-dimensional uniform grids.

Usage

1
unigrids(nnodes, lb, ub, rtype = NULL)

Arguments

nnodes

An array of numbers of nodes

lb

An array of lower bounds

ub

An array of upper bounds

rtype

A type of results; default is NULL that returns a list class; if rtype = list, returns a list class; if rtype = grid, returns a matrix class.

Details

For the i-th dimension of i = 1, 2, \cdots, d, suppose a polynomial approximant s_{i} over a bounded interval [a_{i},b_{i}] is defined by evenly gridded nodes. Then, a d-dimensional uniform grids can be defined as:

\mathbf{S} = ≤ft\{ (s_{1},s_{2},\cdots,s_{d}) \vert a_{i} ≤q s_{1} ≤q b_{i}, i = 1, 2, \cdots, d \right\} .

This is all combinations of s_{i}. Two types of results are provided. 'rtype = list' provides a list of d dimensions wherease 'rtype = grids' creates a ≤ft( \displaystyle ∏_{i=1}^{d} n_{i} \right) \times d matrix.

Value

A list with d elements of Chebyshev nodes or a ≤ft( \displaystyle ∏_{i=1}^{d} n_{i} \right) \times d matrix of uniform grids

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Uniform grids with two-dimension
unigrids(c(5,3), c(1,1), c(2,3))
## Returns the same results
unigrids(c(5,3), c(1,1), c(2,3), rtype='list')
## Returns a matrix grids with the same domain
unigrids(c(5,3), c(1,1), c(2,3), rtype='grid')
## Uniform grid with one-dimension
unigrids(5,1,2)
## Uniform grids with three stock
unigrids(c(3,4,5),c(1,1,1),c(2,3,4),rtype='grid')

capn documentation built on May 1, 2019, 11:15 p.m.

Related to unigrids in capn...