RcppArmadillo-Functions | R Documentation |
These four functions are created when
RcppArmadillo.package.skeleton()
is invoked to create a
skeleton packages.
rcpparma_hello_world()
rcpparma_outerproduct(x)
rcpparma_innerproduct(x)
rcpparma_bothproducts(x)
x |
a numeric vector |
These are example functions which should be largely self-explanatory. Their main benefit is to demonstrate how to write a function using the Armadillo C++ classes, and to have to such a function accessible from R.
rcpparma_hello_world()
does not return a value, but displays a
message to the console.
rcpparma_outerproduct()
returns a numeric matrix computed as the
outer (vector) product of x
.
rcpparma_innerproduct()
returns a double computer as the inner
(vector) product of x
.
rcpparma_bothproducts()
returns a list with both the outer and
inner products.
Dirk Eddelbuettel
See the documentation for Armadillo, and RcppArmadillo, for more details.
x <- sqrt(1:4)
rcpparma_innerproduct(x)
rcpparma_outerproduct(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.