unigrids {capn} | R Documentation |
Generating unifrom grids
Description
This function generates a grid of multi-dimensional uniform grids.
Usage
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 -th dimension of
, suppose a polynomial approximant
over a bounded interval
is defined by evenly gridded nodes. Then, a
-dimensional
uniform grids can be defined as:
.
This is all combinations of . Two types of results are provided. '
rtype = list
' provides a list
of dimensions wherease '
rtype = grids
' creates a matrix.
Value
A list with elements of Chebyshev nodes or a
matrix of uniform grids
Examples
## 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')
[Package capn version 1.0.0 Index]