From c7e41e73e4160afba42e6fa51537102d44b42717 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:31:49 -0400 Subject: [PATCH 01/11] Updated URL --- DESCRIPTION | 6 +++--- README.md | 23 +++++++++++++++++++---- _pkgdown.yml | 4 ++-- inst/CITATION | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 224f094..1bfcd51 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -7,11 +7,11 @@ Encoding: UTF-8 Authors@R: person(given = "James", family = "Howard", email = "jh@jameshoward.us", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-4530-1547")) -URL: https://howardjp.github.io/cmna/ -BugReports: https://github.com/howardjp/cmna/issues +URL: https://jameshoward.us/cmna +BugReports: https://github.com/k3jph/cmna-pkg/issues Description: Provides the source and examples for James P. Howard, II, "Computational Methods for Numerical Analysis with R," - , a book on numerical + , a book on numerical methods in R. License: BSD_2_clause + file LICENSE LazyLoad: no diff --git a/README.md b/README.md index d3d66af..c649bb5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Computational Methods for Numerical Analysis -[![Build Status](https://img.shields.io/travis/howardjp/cmna.svg)](https://travis-ci.org/howardjp/cmna) -[![Coverage Status](https://img.shields.io/coveralls/github/howardjp/cmna.svg)](https://coveralls.io/github/howardjp/cmna?branch=master) +[![Build Status](https://travis-ci.org/k3jph/cmna-pkg.svg?branch=master)](https://travis-ci.org/k3jph/cmna-pkg) +[![Coverage Status](https://coveralls.io/repos/github/k3jph/cmna-pkg/badge.svg?branch=develop)](https://coveralls.io/github/k3jph/cmna-pkg?branch=develop) +[![codecov](https://codecov.io/gh/k3jph/cmna-pkg/branch/master/graph/badge.svg)](https://codecov.io/gh/k3jph/cmna-pkg) [![Downloads from the RStudio CRAN mirror](https://cranlogs.r-pkg.org/badges/cmna)](https://cran.r-project.org/package=cmna) [![Package DOI](https://img.shields.io/badge/Package_DOI-10.5281%2Fzenodo.3249230-blue.svg)](https://doi.org/10.5281/zenodo.3249230) [![Book DOI](https://img.shields.io/badge/Book_DOI-10.1201%2F9781315120195-blue.svg)](https://doi.org/10.1201/9781315120195) @@ -9,6 +10,20 @@ This is the R package to support _Computational Methods for Numerical Analysis with R_ by James P. Howard, II. +_Computational Methods for Numerical Analysis with R_ is an overview +of traditional numerical analysis topics presented using R. This +guide shows how common functions from linear algebra, interpolation, +numerical integration, optimization, and differential equations can +be implemented in pure R code. Every algorithm described is given +with a complete function implementation in R, along with examples +to demonstrate the function and its use. + +_Computational Methods for Numerical Analysis with R_ with R is +intended for those who already know R, but are interested in learning +more about how the underlying algorithms work. As such, it is +suitable for statisticians, economists, and engineers, and others +with a computational and numerical background. + ## Algorithms included * Elementary and Example Algorithms @@ -120,6 +135,7 @@ Analysis with R_ by James P. Howard, II. * testthat * roxygen2 +* markdown ## Contribution guidelines @@ -129,6 +145,5 @@ Analysis with R_ by James P. Howard, II. ## For more information -* [Website for CMNA](https://howardjp.github.io/cmna/) +* [Website for CMNA](https://jameshoward.us/cmna/) * James P. Howard, II <> - diff --git a/_pkgdown.yml b/_pkgdown.yml index fdb4c6b..79ac71e 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -1,4 +1,4 @@ -url: https://howardjp.github.io/cmna/ +url: https://jameshoward.us/cmna-pkg destination: docs home: @@ -6,7 +6,7 @@ home: - text: CMNA Page href: https://jameshoward.us/cmna - text: The Book - href: https://www.taylorfrancis.com/books/9781315120195 + href: https://taylorfrancis.com/books/9781315120195 authors: James P. Howard, II: diff --git a/inst/CITATION b/inst/CITATION index b56a0d2..9e84cf7 100644 --- a/inst/CITATION +++ b/inst/CITATION @@ -3,6 +3,6 @@ bibentry(bibtype = "Book", author = "James P. Howard", year = 2017, publisher = "Chapman and Hall/CRC", - address = "Boca Raton, Florida", + address = "New York", series = "Numerical Analysis and Scientific Computing Series", url = "https://jameshoward.us/cmna") From 227353826e6906178405159ee235e7e81dcf06d7 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:32:24 -0400 Subject: [PATCH 02/11] Added pkgdown GitHub Action --- .github/workflows/pkgdown.yaml | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/pkgdown.yaml diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..4bd22a9 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,49 @@ +on: + push: + branches: develop + +name: pkgdown + +jobs: + pkgdown: + runs-on: macOS-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - uses: actions/checkout@v2 + + - uses: r-lib/actions/setup-r@master + + - uses: r-lib/actions/setup-pandoc@master + + - name: Query dependencies + run: | + install.packages('remotes') + saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) + writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") + shell: Rscript {0} + + - name: Cache R packages + uses: actions/cache@v1 + with: + path: ${{ env.R_LIBS_USER }} + key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} + restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- + + - name: Install dependencies + run: | + install.packages("remotes") + remotes::install_deps(dependencies = TRUE) + remotes::install_dev("pkgdown") + shell: Rscript {0} + + - name: Generate documentation + run: devtools::document() + shell: Rscript {0} + + - name: Install package + run: R CMD INSTALL . + + - name: Deploy package + run: pkgdown::deploy_to_branch(new_process = FALSE) + shell: Rscript {0} From 37092940f229493d40eb0b430a593e422738f533 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:34:10 -0400 Subject: [PATCH 03/11] pseudo-remove NAMESPACE --- NAMESPACE | 85 ------------------------------------------------------- 1 file changed, 85 deletions(-) diff --git a/NAMESPACE b/NAMESPACE index f6b2c70..e651b94 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,86 +1 @@ # Generated by roxygen2: do not edit by hand - -export(adamsbashforth) -export(adaptint) -export(betterpoly) -export(bilinear) -export(bisection) -export(bvpexample) -export(bvpexample10) -export(cbezier) -export(cgmmatrix) -export(choleskymatrix) -export(cubicspline) -export(detmatrix) -export(discmethod) -export(euler) -export(eulersys) -export(fibonacci) -export(findiff) -export(findiff2) -export(gauss.hermite) -export(gauss.laguerre) -export(gauss.legendre) -export(gaussint) -export(gaussseidel) -export(gd) -export(gdls) -export(giniquintile) -export(goldsectmax) -export(goldsectmin) -export(gradasc) -export(graddsc) -export(heat) -export(hillclimbing) -export(himmelblau) -export(horner) -export(invmatrix) -export(isPrime) -export(jacobi) -export(kahansum) -export(linterp) -export(longdiv) -export(lumatrix) -export(mcint) -export(mcint2) -export(midpt) -export(midptivp) -export(naivediv) -export(naivepoly) -export(naivesum) -export(newton) -export(nn) -export(nthroot) -export(polyinterp) -export(pwiselinterp) -export(pwisesum) -export(qbezier) -export(quadratic) -export(quadratic2) -export(rdiff) -export(refmatrix) -export(replacerow) -export(resizeImageBL) -export(resizeImageNN) -export(rhorner) -export(romberg) -export(rrefmatrix) -export(rungekutta4) -export(sa) -export(scalerow) -export(secant) -export(shellmethod) -export(simp) -export(simp38) -export(solvematrix) -export(swaprows) -export(symdiff) -export(trap) -export(tridiagmatrix) -export(tspsa) -export(vecnorm) -export(wave) -export(wilkinson) -importFrom(stats,rnorm) -importFrom(stats,runif) -importFrom(utils,tail) From 6ec263268591d7cbcfc729ba9e1bed77da6b8fe7 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:36:54 -0400 Subject: [PATCH 04/11] updates for copyrights --- COPYRIGHT.md | 2 +- inst/COPYRIGHTS | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/COPYRIGHT.md b/COPYRIGHT.md index 518a377..928f25f 100644 --- a/COPYRIGHT.md +++ b/COPYRIGHT.md @@ -1,7 +1,7 @@ Simplified BSD License ====================== -_Copyright © 2016-2019, James P. Howard, II <>_ +_Copyright © 2016-2020, James P. Howard, II <>_ _All rights reserved._ Redistribution and use in source and binary forms, with or without diff --git a/inst/COPYRIGHTS b/inst/COPYRIGHTS index c89348b..ed9eeb6 100644 --- a/inst/COPYRIGHTS +++ b/inst/COPYRIGHTS @@ -1,4 +1,4 @@ -## Copyright (c) 2016-2017, James P. Howard, II +## Copyright (c) 2016-2020, James P. Howard, II ## ## Redistribution and use in source and binary forms, with or without ## modification, are permitted provided that the following conditions are From 625d94fcff2afe56fe68deb3c89423cef8959426 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:38:13 -0400 Subject: [PATCH 05/11] Updates to Travis --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 7c7f770..d2d45df 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,14 @@ r: r_packages: - testthat - covr + - markdown + - roxygen2 + - devtools + +before_script: + - Rscript -e 'devtools::document()' after_success: - Rscript -e 'covr::coveralls()' + - Rscript -e 'library(covr); codecov()' + From 46c110e2040becd5f372a4c772d88203ab573fff Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:38:38 -0400 Subject: [PATCH 06/11] Updates for ignore files --- .Rbuildignore | 9 ++++++--- .gitignore | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index baa9882..ad7727b 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,7 +1,10 @@ ^.*\.Rproj$ ^\.Rproj\.user$ .travis.yml -data-raw -docs COPYRIGHT.md -^_pkgdown.yml$ \ No newline at end of file +^.github +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^\.github$ +^data-raw$ diff --git a/.gitignore b/.gitignore index 807ea25..09a72cb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .Rproj.user .Rhistory .RData +inst/doc From c1fb15a30437cf7fad2a5d17ce4bc863fb24e104 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:41:31 -0400 Subject: [PATCH 07/11] Added devtools and markdown to suggests --- DESCRIPTION | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 1bfcd51..596d0b7 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -16,6 +16,8 @@ Description: Provides the source and examples for James P. Howard, II, License: BSD_2_clause + file LICENSE LazyLoad: no Suggests: - testthat + testthat, + devtools, + markdown RoxygenNote: 6.1.1 Depends: R (>= 2.10) From aef8f33608b5333a44f9e6b07f12acbcdba2b101 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:48:23 -0400 Subject: [PATCH 08/11] man pages will now be autogenerated --- man/adaptint.Rd | 54 ---------------------------------- man/bezier.Rd | 48 ------------------------------ man/bilinear.Rd | 52 --------------------------------- man/bisection.Rd | 44 ---------------------------- man/bvp.Rd | 37 ----------------------- man/choleskymatrix.Rd | 35 ---------------------- man/cmna-package.Rd | 30 ------------------- man/cubicspline.Rd | 48 ------------------------------ man/detmatrix.Rd | 33 --------------------- man/division.Rd | 44 ---------------------------- man/fibonacci.Rd | 35 ---------------------- man/findiff.Rd | 44 ---------------------------- man/gaussint.Rd | 52 --------------------------------- man/gdls.Rd | 42 -------------------------- man/giniquintile.Rd | 44 ---------------------------- man/goldsect.Rd | 48 ------------------------------ man/gradient.Rd | 59 ------------------------------------- man/heat.Rd | 40 ------------------------- man/hillclimbing.Rd | 42 -------------------------- man/himmelblau.Rd | 20 ------------- man/horner.Rd | 65 ----------------------------------------- man/invmatrix.Rd | 34 --------------------- man/isPrime.Rd | 37 ----------------------- man/iterativematrix.Rd | 59 ------------------------------------- man/ivp.Rd | 47 ----------------------------- man/ivpsys.Rd | 36 ----------------------- man/linterp.Rd | 44 ---------------------------- man/lumatrix.Rd | 34 --------------------- man/mcint.Rd | 51 -------------------------------- man/midpt.Rd | 51 -------------------------------- man/newton.Rd | 44 ---------------------------- man/nn.Rd | 37 ----------------------- man/nthroot.Rd | 40 ------------------------- man/polyinterp.Rd | 42 -------------------------- man/pwiselinterp.Rd | 52 --------------------------------- man/quadratic.Rd | 45 ---------------------------- man/refmatrix.Rd | 51 -------------------------------- man/resizeImage.Rd | 31 -------------------- man/revolution-solid.Rd | 46 ----------------------------- man/romberg.Rd | 53 --------------------------------- man/rowops.Rd | 54 ---------------------------------- man/sa.Rd | 45 ---------------------------- man/secant.Rd | 41 -------------------------- man/simp.Rd | 51 -------------------------------- man/simp38.Rd | 51 -------------------------------- man/summation.Rd | 45 ---------------------------- man/trap.Rd | 51 -------------------------------- man/tridiagmatrix.Rd | 35 ---------------------- man/vecnorm.Rd | 33 --------------------- man/wave.Rd | 41 -------------------------- man/wilkinson.Rd | 32 -------------------- 51 files changed, 2229 deletions(-) delete mode 100644 man/adaptint.Rd delete mode 100644 man/bezier.Rd delete mode 100644 man/bilinear.Rd delete mode 100644 man/bisection.Rd delete mode 100644 man/bvp.Rd delete mode 100644 man/choleskymatrix.Rd delete mode 100644 man/cmna-package.Rd delete mode 100644 man/cubicspline.Rd delete mode 100644 man/detmatrix.Rd delete mode 100644 man/division.Rd delete mode 100644 man/fibonacci.Rd delete mode 100644 man/findiff.Rd delete mode 100644 man/gaussint.Rd delete mode 100644 man/gdls.Rd delete mode 100644 man/giniquintile.Rd delete mode 100644 man/goldsect.Rd delete mode 100644 man/gradient.Rd delete mode 100644 man/heat.Rd delete mode 100644 man/hillclimbing.Rd delete mode 100644 man/himmelblau.Rd delete mode 100644 man/horner.Rd delete mode 100644 man/invmatrix.Rd delete mode 100644 man/isPrime.Rd delete mode 100644 man/iterativematrix.Rd delete mode 100644 man/ivp.Rd delete mode 100644 man/ivpsys.Rd delete mode 100644 man/linterp.Rd delete mode 100644 man/lumatrix.Rd delete mode 100644 man/mcint.Rd delete mode 100644 man/midpt.Rd delete mode 100644 man/newton.Rd delete mode 100644 man/nn.Rd delete mode 100644 man/nthroot.Rd delete mode 100644 man/polyinterp.Rd delete mode 100644 man/pwiselinterp.Rd delete mode 100644 man/quadratic.Rd delete mode 100644 man/refmatrix.Rd delete mode 100644 man/resizeImage.Rd delete mode 100644 man/revolution-solid.Rd delete mode 100644 man/romberg.Rd delete mode 100644 man/rowops.Rd delete mode 100644 man/sa.Rd delete mode 100644 man/secant.Rd delete mode 100644 man/simp.Rd delete mode 100644 man/simp38.Rd delete mode 100644 man/summation.Rd delete mode 100644 man/trap.Rd delete mode 100644 man/tridiagmatrix.Rd delete mode 100644 man/vecnorm.Rd delete mode 100644 man/wave.Rd delete mode 100644 man/wilkinson.Rd diff --git a/man/adaptint.Rd b/man/adaptint.Rd deleted file mode 100644 index d095e32..0000000 --- a/man/adaptint.Rd +++ /dev/null @@ -1,54 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/adaptint.R -\name{adaptint} -\alias{adaptint} -\title{Adaptive Integration} -\usage{ -adaptint(f, a, b, n = 10, tol = 1e-06) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the a-bound of integration} - -\item{b}{the b-bound of integration} - -\item{n}{the maximum recursive depth} - -\item{tol}{the maximum error tolerance} -} -\value{ -the value of the integral -} -\description{ -Adaptive integration -} -\details{ -The \code{adaptint} function uses Romberg's rule to calculate the -integral of the function \code{f} over the interval from \code{a} -to \code{b}. The parameter \code{n} sets the number of intervals -to use when evaluating. Additional options are passed to the -function \code{f} when evaluating. -} -\examples{ -f <- function(x) { sin(x)^2 + log(x) } -adaptint(f, 1, 10, n = 4) -adaptint(f, 1, 10, n = 5) -adaptint(f, 1, 10, n = 10) - -} -\seealso{ -Other integration: \code{\link{gaussint}}, - \code{\link{giniquintile}}, \code{\link{mcint}}, - \code{\link{midpt}}, \code{\link{revolution-solid}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{simp}}, \code{\link{trap}} - -Other newton-cotes: \code{\link{giniquintile}}, - \code{\link{midpt}}, \code{\link{romberg}}, - \code{\link{simp38}}, \code{\link{simp}}, - \code{\link{trap}} -} -\concept{adaptive} -\concept{integration} -\concept{newton-cotes} diff --git a/man/bezier.Rd b/man/bezier.Rd deleted file mode 100644 index 6c40291..0000000 --- a/man/bezier.Rd +++ /dev/null @@ -1,48 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bezier.R -\name{bezier} -\alias{bezier} -\alias{qbezier} -\alias{cbezier} -\title{Bezier curves} -\usage{ -qbezier(x, y, t) - -cbezier(x, y, t) -} -\arguments{ -\item{x}{a vector of x values} - -\item{y}{a vector of y values} - -\item{t}{a vector of t values for which the curve will be computed} -} -\value{ -a list composed of an x-vector and a y-vector -} -\description{ -Find the quadratic and cubic Bezier curve for the given points -} -\details{ -\code{qbezier} finds the quadratic Bezier curve for the -given three points and \code{cbezier} finds the cubic Bezier curve -for the given four points. The curve will be computed at all values -in the vector \code{t} and a list of x and y values returned. -} -\examples{ -x <- c(1, 2, 3) -y <- c(2, 3, 5) -f <- qbezier(x, y, seq(0, 1, 1/100)) - -x <- c(-1, 1, 0, -2) -y <- c(-2, 2, -1, -1) -f <- cbezier(x, y, seq(0, 1, 1/100)) - -} -\seealso{ -Other interp: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{linterp}}, - \code{\link{nn}}, \code{\link{polyinterp}}, - \code{\link{pwiselinterp}} -} -\concept{interp} diff --git a/man/bilinear.Rd b/man/bilinear.Rd deleted file mode 100644 index b76e07b..0000000 --- a/man/bilinear.Rd +++ /dev/null @@ -1,52 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bilinear.R -\name{bilinear} -\alias{bilinear} -\title{Bilinear interpolation} -\usage{ -bilinear(x, y, z, newx, newy) -} -\arguments{ -\item{x}{vector of two x values representing \code{x_1} and \code{x_2}} - -\item{y}{vector of two y values representing \code{y_1} and \code{y_2}} - -\item{z}{2x2 matrix if \code{z} values} - -\item{newx}{vector of new \code{x} values to interpolate} - -\item{newy}{vector of new \code{y} values to interpolate} -} -\value{ -a vector of interpolated z values at (\code{x}, \code{y}) -} -\description{ -Finds a bilinear interpolation bounded by four points -} -\details{ -\code{bilinear} finds a bilinear interpolation bounded by four corners -} -\examples{ -x <- c(2, 4) -y <- c(4, 7) -z <- matrix(c(81, 84, 85, 89), nrow = 2) -newx <- c(2.5, 3, 3.5) -newy <- c(5, 5.5, 6) -bilinear(x, y, z, newx, newy) - -} -\seealso{ -Other interp: \code{\link{bezier}}, - \code{\link{cubicspline}}, \code{\link{linterp}}, - \code{\link{nn}}, \code{\link{polyinterp}}, - \code{\link{pwiselinterp}} - -Other algebra: \code{\link{cubicspline}}, - \code{\link{division}}, \code{\link{fibonacci}}, - \code{\link{horner}}, \code{\link{isPrime}}, - \code{\link{linterp}}, \code{\link{nthroot}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} -\concept{interp} diff --git a/man/bisection.Rd b/man/bisection.Rd deleted file mode 100644 index af96618..0000000 --- a/man/bisection.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bisection.R -\name{bisection} -\alias{bisection} -\title{The Bisection Method} -\usage{ -bisection(f, a, b, tol = 0.001, m = 100) -} -\arguments{ -\item{f}{function to locate a root for} - -\item{a}{the a bound of the search region} - -\item{b}{the b bound of the search region} - -\item{tol}{the error tolerance} - -\item{m}{the maximum number of iterations} -} -\value{ -the real root found -} -\description{ -Use the bisection method to find real roots -} -\details{ -The bisection method functions by repeatedly halving the interval -between \code{a} and \code{b} and will return when the -interval between them is less than \code{tol}, the error tolerance. -However, this implementation also stops if after \code{m} -iterations. -} -\examples{ -f <- function(x) { x^3 - 2 * x^2 - 159 * x - 540} -bisection(f, 0, 10) - -} -\seealso{ -Other optimz: \code{\link{goldsect}}, - \code{\link{gradient}}, \code{\link{hillclimbing}}, - \code{\link{newton}}, \code{\link{sa}}, - \code{\link{secant}} -} -\concept{optimz} diff --git a/man/bvp.Rd b/man/bvp.Rd deleted file mode 100644 index bb10f9d..0000000 --- a/man/bvp.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bvp.R -\name{bvp} -\alias{bvp} -\alias{bvpexample} -\alias{bvpexample10} -\title{Boundary value problems} -\usage{ -bvpexample(x) - -bvpexample10(x) -} -\arguments{ -\item{x}{proposed initial \code{x}-value} -} -\value{ -a data frame of \code{x} and \code{y} values -} -\description{ -solve boundary value problems for ordinary differential equations -} -\details{ -The \code{euler} method implements the Euler method for solving -differential equations. The code{midptivp} method solves initial -value problems using the second-order Runge-Kutta method. The -\code{rungekutta4} method is the fourth-order Runge-Kutta method. -} -\examples{ -bvpexample(-2) -bvpexample(-1) -bvpexample(0) -bvpexample(1) -bvpexample(2) -## (bvp.b <- bisection(bvpexample, 0, 1)) -## (bvp.s <- secant(bvpexample, 0)) - -} diff --git a/man/choleskymatrix.Rd b/man/choleskymatrix.Rd deleted file mode 100644 index e661478..0000000 --- a/man/choleskymatrix.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cholesky.R -\name{choleskymatrix} -\alias{choleskymatrix} -\title{Cholesky Decomposition} -\usage{ -choleskymatrix(m) -} -\arguments{ -\item{m}{a matrix} -} -\value{ -the matrix L -} -\description{ -Decompose a matrix into the Cholesky -} -\details{ -\code{choleskymatrix} decomposes the matrix \code{m} into the LU -decomposition, such that m == L %*% L*. -} -\examples{ -(A <- matrix(c(5, 1, 2, 1, 9, 3, 2, 3, 7), 3)) -(L <- choleskymatrix(A)) -t(L) \%*\% L - -} -\seealso{ -Other linear: \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{invmatrix}}, \code{\link{iterativematrix}}, - \code{\link{lumatrix}}, \code{\link{refmatrix}}, - \code{\link{rowops}}, \code{\link{tridiagmatrix}}, - \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/cmna-package.Rd b/man/cmna-package.Rd deleted file mode 100644 index 623358d..0000000 --- a/man/cmna-package.Rd +++ /dev/null @@ -1,30 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cmna.R -\docType{package} -\name{cmna-package} -\alias{cmna} -\alias{cmna-package} -\title{Computational Methods for Numerical Analysis} -\description{ -Provides the source and examples for \emph{Computational Methods for -Numerical Analysis with R}. -} -\details{ -This package provides a suite of simple implementations of standard -methods from numerical analysis. The collection is designed to -accompany \emph{Computational Methods for Numerical Analysis with R} -by James P. Howard, II. Together, these functions provide methods to -support linear algebra, interpolation, integration, root finding, -optimization, and differential equations. -} -\seealso{ -Useful links: -\itemize{ - \item \url{https://howardjp.github.io/cmna/} - \item Report bugs at \url{https://github.com/howardjp/cmna/issues} -} - -} -\author{ -James P. Howard, II -} diff --git a/man/cubicspline.Rd b/man/cubicspline.Rd deleted file mode 100644 index 88410c3..0000000 --- a/man/cubicspline.Rd +++ /dev/null @@ -1,48 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cubicspline.R -\name{cubicspline} -\alias{cubicspline} -\title{Natural cubic spline interpolation} -\usage{ -cubicspline(x, y) -} -\arguments{ -\item{x}{a vector of x values} - -\item{y}{a vector of y values} -} -\value{ -a list of coefficient vectors -} -\description{ -Finds a piecewise linear function that interpolates the data points -} -\details{ -\code{cubicspline} finds a piecewise cubic spline function that -interpolates the data points. For each x-y ordered pair. The function will -return a list of four vectors representing the coefficients. -} -\examples{ -x <- c(1, 2, 3) -y <- c(2, 3, 5) -f <- cubicspline(x, y) - -x <- c(-1, 1, 0, -2) -y <- c(-2, 2, -1, -1) -f <- cubicspline(x, y) - -} -\seealso{ -Other interp: \code{\link{bezier}}, \code{\link{bilinear}}, - \code{\link{linterp}}, \code{\link{nn}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}} - -Other algebra: \code{\link{bilinear}}, - \code{\link{division}}, \code{\link{fibonacci}}, - \code{\link{horner}}, \code{\link{isPrime}}, - \code{\link{linterp}}, \code{\link{nthroot}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} -\concept{interp} diff --git a/man/detmatrix.Rd b/man/detmatrix.Rd deleted file mode 100644 index 561aa32..0000000 --- a/man/detmatrix.Rd +++ /dev/null @@ -1,33 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/detmatrix.R -\name{detmatrix} -\alias{detmatrix} -\title{Calculate the determinant of the matrix} -\usage{ -detmatrix(m) -} -\arguments{ -\item{m}{a matrix} -} -\value{ -the determinant -} -\description{ -Calculate the determinant of the matrix -} -\details{ -\code{detmatrix} calculates the determinant of the matrix given. -} -\examples{ -A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -detmatrix(A) - -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{gdls}}, \code{\link{invmatrix}}, - \code{\link{iterativematrix}}, \code{\link{lumatrix}}, - \code{\link{refmatrix}}, \code{\link{rowops}}, - \code{\link{tridiagmatrix}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/division.Rd b/man/division.Rd deleted file mode 100644 index 58f22ac..0000000 --- a/man/division.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/naivediv.R -\name{division} -\alias{division} -\alias{naivediv} -\alias{longdiv} -\title{Algorithms for divisions} -\usage{ -naivediv(m, n) - -longdiv(m, n) -} -\arguments{ -\item{m}{the dividend} - -\item{n}{the divisor} -} -\value{ -the quotient and remainder as a list -} -\description{ -Algorithms for division that provide a quotient and remainder. -} -\details{ -The \code{naivediv} divides \code{m} by \code{n} by using repeated -division. The \code{longdiv} function uses the long division -algorithm in binary. -} -\examples{ -a <- floor(runif(1, 1, 1000)) -b <- floor(runif(1, 1, 100)) -naivediv(a, b) -longdiv(a, b) - -} -\seealso{ -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{fibonacci}}, - \code{\link{horner}}, \code{\link{isPrime}}, - \code{\link{linterp}}, \code{\link{nthroot}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} diff --git a/man/fibonacci.Rd b/man/fibonacci.Rd deleted file mode 100644 index 7c729c9..0000000 --- a/man/fibonacci.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/fibonacci.R -\name{fibonacci} -\alias{fibonacci} -\title{Fibonacci numbers} -\usage{ -fibonacci(n) -} -\arguments{ -\item{n}{n} -} -\value{ -the sequence element -} -\description{ -Return the n-th Fibonacci number -} -\details{ -This function is recursively implements the famous Fibonacci -sequence. The function returns the \code{n}th member of the -sequence. -} -\examples{ -fibonacci(10) - -} -\seealso{ -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{horner}}, \code{\link{isPrime}}, - \code{\link{linterp}}, \code{\link{nthroot}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} diff --git a/man/findiff.Rd b/man/findiff.Rd deleted file mode 100644 index 41b55ee..0000000 --- a/man/findiff.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/findiff.R -\name{findiff} -\alias{findiff} -\alias{symdiff} -\alias{findiff2} -\alias{rdiff} -\title{Finite Differences} -\usage{ -findiff(f, x, h = x * sqrt(.Machine$double.eps)) - -symdiff(f, x, h = x * .Machine$double.eps^(1/3)) - -findiff2(f, x, h) - -rdiff(f, x, n = 10, h = 1e-04) -} -\arguments{ -\item{f}{function to differentiate} - -\item{x}{the \code{x}-value to differentiate at} - -\item{h}{the step-size for evaluation} - -\item{n}{the maximum number of convergence steps in \code{rdiff}} -} -\value{ -the value of the derivative -} -\description{ -Finite differences formulas -} -\details{ -The \code{findiff} formula uses the finite differences formula to -find the derivative of \code{f} at \code{x}. The value of \code{h} -is the step size of the evaluation. The function \code{findiff2} -provides the second derivative. -} -\examples{ -findiff(sin, pi, 1e-3) -symdiff(sin, pi, 1e-3) - -} -\concept{differentiation} diff --git a/man/gaussint.Rd b/man/gaussint.Rd deleted file mode 100644 index 057e569..0000000 --- a/man/gaussint.Rd +++ /dev/null @@ -1,52 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gaussint.R -\name{gaussint} -\alias{gaussint} -\alias{gauss.legendre} -\alias{gauss.laguerre} -\alias{gauss.hermite} -\title{Gaussian integration method driver} -\usage{ -gaussint(f, x, w) - -gauss.legendre(f, m = 5) - -gauss.laguerre(f, m = 5) - -gauss.hermite(f, m = 5) -} -\arguments{ -\item{f}{function to integrate} - -\item{x}{list of evaluation points} - -\item{w}{list of weights} - -\item{m}{number of evaluation points} -} -\value{ -the value of the integral -} -\description{ -Use the Gaussian method to evaluate integrals -} -\details{ -The \code{gaussint} function uses the Gaussian integration to -evaluate an integral. The function itself is a driver and expects -the integration points and associated weights as options. -} -\examples{ -w = c(1, 1) -x = c(-1 / sqrt(3), 1 / sqrt(3)) -f <- function(x) { x^3 + x + 1 } -gaussint(f, x, w) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{giniquintile}}, \code{\link{mcint}}, - \code{\link{midpt}}, \code{\link{revolution-solid}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{simp}}, \code{\link{trap}} -} -\concept{integration} diff --git a/man/gdls.Rd b/man/gdls.Rd deleted file mode 100644 index 06c8135..0000000 --- a/man/gdls.Rd +++ /dev/null @@ -1,42 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gdls.R -\name{gdls} -\alias{gdls} -\title{Least squares with graident descent} -\usage{ -gdls(A, b, alpha = 0.05, tol = 1e-06, m = 1e+05) -} -\arguments{ -\item{A}{a square matrix representing the coefficients of a linear system} - -\item{b}{a vector representing the right-hand side of the linear system} - -\item{alpha}{the learning rate} - -\item{tol}{the expected error tolerance} - -\item{m}{the maximum number of iterations} -} -\value{ -the modified matrix -} -\description{ -Solve least squares with graident descent -} -\details{ -\code{gdls} solves a linear system using gradient descent. -} -\examples{ -head(b <- iris$Sepal.Length) -head(A <- matrix(cbind(1, iris$Sepal.Width, iris$Petal.Length, iris$Petal.Width), ncol = 4)) -gdls(A, b, alpha = 0.05, m = 10000) - -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{invmatrix}}, - \code{\link{iterativematrix}}, \code{\link{lumatrix}}, - \code{\link{refmatrix}}, \code{\link{rowops}}, - \code{\link{tridiagmatrix}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/giniquintile.Rd b/man/giniquintile.Rd deleted file mode 100644 index a216baa..0000000 --- a/man/giniquintile.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/giniquintile.R -\name{giniquintile} -\alias{giniquintile} -\title{Gini coefficients} -\usage{ -giniquintile(L) -} -\arguments{ -\item{L}{vector of percentages at 20th, 40th, 60th, and 80th -percentiles} -} -\value{ -the estimated Gini coefficient -} -\description{ -Calculate the Gini coefficient from quintile data -} -\details{ -Calculate the Gini coefficient given the quintile data. -} -\examples{ -L <- c(4.3, 9.8, 15.4, 22.7) -giniquintile(L) - -} -\references{ -Leon Gerber, "A Quintile Rule for the Gini Coefficient", -\emph{Mathematics Magazine}, 80:2, April 2007. -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{mcint}}, - \code{\link{midpt}}, \code{\link{revolution-solid}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{simp}}, \code{\link{trap}} - -Other newton-cotes: \code{\link{adaptint}}, - \code{\link{midpt}}, \code{\link{romberg}}, - \code{\link{simp38}}, \code{\link{simp}}, - \code{\link{trap}} -} -\concept{integration} -\concept{newton-cotes} diff --git a/man/goldsect.Rd b/man/goldsect.Rd deleted file mode 100644 index c8944f2..0000000 --- a/man/goldsect.Rd +++ /dev/null @@ -1,48 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/goldsect.R -\name{goldsect} -\alias{goldsect} -\alias{goldsectmin} -\alias{goldsectmax} -\title{Golden Section Search} -\usage{ -goldsectmin(f, a, b, tol = 0.001, m = 100) - -goldsectmax(f, a, b, tol = 0.001, m = 100) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the a bound of the search region} - -\item{b}{the b bound of the search region} - -\item{tol}{the error tolerance} - -\item{m}{the maximum number of iterations} -} -\value{ -the \code{x} value of the minimum found -} -\description{ -Use golden section search to find local extrema -} -\details{ -The golden section search method functions by repeatedly dividing the interval -between \code{a} and \code{b} and will return when the -interval between them is less than \code{tol}, the error tolerance. -However, this implementation also stop if after \code{m} -iterations. -} -\examples{ -f <- function(x) { x^2 - 3 * x + 3 } -goldsectmin(f, 0, 5) - -} -\seealso{ -Other optimz: \code{\link{bisection}}, - \code{\link{gradient}}, \code{\link{hillclimbing}}, - \code{\link{newton}}, \code{\link{sa}}, - \code{\link{secant}} -} -\concept{optimz} diff --git a/man/gradient.Rd b/man/gradient.Rd deleted file mode 100644 index 8c669ba..0000000 --- a/man/gradient.Rd +++ /dev/null @@ -1,59 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gradesc.R -\name{gradient} -\alias{gradient} -\alias{graddsc} -\alias{gradasc} -\alias{gd} -\title{Gradient descent} -\usage{ -graddsc(fp, x, h = 0.001, tol = 1e-04, m = 1000) - -gradasc(fp, x, h = 0.001, tol = 1e-04, m = 1000) - -gd(fp, x, h = 100, tol = 1e-04, m = 1000) -} -\arguments{ -\item{fp}{function representing the derivative of \code{f}} - -\item{x}{an initial estimate of the minima} - -\item{h}{the step size} - -\item{tol}{the error tolerance} - -\item{m}{the maximum number of iterations} -} -\value{ -the \code{x} value of the minimum found -} -\description{ -Use gradient descent to find local minima -} -\details{ -Gradient descent can be used to find local minima of functions. It -will return an approximation based on the step size \code{h} and -\code{fp}. The \code{tol} is the error tolerance, \code{x} is the -initial guess at the minimum. This implementation also stops after -\code{m} iterations. -} -\examples{ -fp <- function(x) { x^3 + 3 * x^2 - 1 } -graddsc(fp, 0) - -f <- function(x) { (x[1] - 1)^2 + (x[2] - 1)^2 } -fp <-function(x) { - x1 <- 2 * x[1] - 2 - x2 <- 8 * x[2] - 8 - - return(c(x1, x2)) -} -gd(fp, c(0, 0), 0.05) -} -\seealso{ -Other optimz: \code{\link{bisection}}, - \code{\link{goldsect}}, \code{\link{hillclimbing}}, - \code{\link{newton}}, \code{\link{sa}}, - \code{\link{secant}} -} -\concept{optimz} diff --git a/man/heat.Rd b/man/heat.Rd deleted file mode 100644 index af89d03..0000000 --- a/man/heat.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/heat.R -\name{heat} -\alias{heat} -\title{Heat Equation via Forward-Time Central-Space} -\usage{ -heat(u, alpha, xdelta, tdelta, n) -} -\arguments{ -\item{u}{the initial values of u} - -\item{alpha}{the thermal diffusivity coefficient} - -\item{xdelta}{the change in \code{x} at each step in \code{u}} - -\item{tdelta}{the time step} - -\item{n}{the number of steps to take} -} -\value{ -a matrix of u values at each time step -} -\description{ -solve heat equation via forward-time central-space method -} -\details{ -The \code{heat} solves the heat equation using the forward-time -central-space method in one-dimension. -} -\examples{ -alpha <- 1 -x0 <- 0 -xdelta <- .05 -x <- seq(x0, 1, xdelta) -u <- sin(x^4 * pi) -tdelta <- .001 -n <- 25 -z <- heat(u, alpha, xdelta, tdelta, n) - -} diff --git a/man/hillclimbing.Rd b/man/hillclimbing.Rd deleted file mode 100644 index e8d67ad..0000000 --- a/man/hillclimbing.Rd +++ /dev/null @@ -1,42 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/hillclimbing.R -\name{hillclimbing} -\alias{hillclimbing} -\title{Hill climbing} -\usage{ -hillclimbing(f, x, h = 1, m = 1000) -} -\arguments{ -\item{f}{function representing the derivative of \code{f}} - -\item{x}{an initial estimate of the minimum} - -\item{h}{the step size} - -\item{m}{the maximum number of iterations} -} -\value{ -the \code{x} value of the minimum found -} -\description{ -Use hill climbing to find the global minimum -} -\details{ -Hill climbing -} -\examples{ -f <- function(x) { - (x[1]^2 + x[2] - 11)^2 + (x[1] + x[2]^2 - 7)^2 -} -hillclimbing(f, c(0,0)) -hillclimbing(f, c(-1,-1)) -hillclimbing(f, c(10,10)) - -} -\seealso{ -Other optimz: \code{\link{bisection}}, - \code{\link{goldsect}}, \code{\link{gradient}}, - \code{\link{newton}}, \code{\link{sa}}, - \code{\link{secant}} -} -\concept{optimz} diff --git a/man/himmelblau.Rd b/man/himmelblau.Rd deleted file mode 100644 index 0d22969..0000000 --- a/man/himmelblau.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/himmelblau.R -\name{himmelblau} -\alias{himmelblau} -\title{Himmelblau Function} -\usage{ -himmelblau(x) -} -\arguments{ -\item{x}{a vector of \code{x}-values} -} -\value{ -the value of the function at \code{x}. -} -\description{ -Generate the Himmelblau function -} -\details{ -Generate the Himmelblau function -} diff --git a/man/horner.Rd b/man/horner.Rd deleted file mode 100644 index 0274622..0000000 --- a/man/horner.Rd +++ /dev/null @@ -1,65 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/horner.R -\name{horner} -\alias{horner} -\alias{rhorner} -\alias{naivepoly} -\alias{betterpoly} -\title{Horner's rule} -\usage{ -horner(x, coefs) - -rhorner(x, coefs) - -naivepoly(x, coefs) - -betterpoly(x, coefs) -} -\arguments{ -\item{x}{a vector of x values to evaluate the polynomial} - -\item{coefs}{vector of coefficients of x} -} -\value{ -the value of the function at \code{x} -} -\description{ -Use Horner's rule to evaluate a polynomial -} -\details{ -This function implements Horner's rule for fast polynomial -evaluation. The implementation expects \code{x} to be a vector of x -values at which to evaluate the polynomial. The parameter \code{coefs} -is a vector of coefficients of \emph{x}. The vector order is such -that the first element is the constant term, the second element is -the coefficient of \emph{x}, the so forth to the highest degreed -term. Terms with a 0 coefficient should have a 0 element in the -vector. - -The function \code{rhorner} implements the the Horner algorithm -recursively. - -The function \code{naivepoly} implements a polynomial evaluator using -the straightforward algebraic approach. - -The function \code{betterpoly} implements a polynomial evaluator using -the straightforward algebraic approach with cached \emph{x} terms. -} -\examples{ -b <- c(2, 10, 11) -x <- 5 -horner(x, b) -b <- c(-1, 0, 1) -x <- c(1, 2, 3, 4) -horner(x, b) -rhorner(x, b) -} -\seealso{ -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{fibonacci}}, \code{\link{isPrime}}, - \code{\link{linterp}}, \code{\link{nthroot}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} diff --git a/man/invmatrix.Rd b/man/invmatrix.Rd deleted file mode 100644 index e5f0e74..0000000 --- a/man/invmatrix.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/invmatrix.R -\name{invmatrix} -\alias{invmatrix} -\title{Invert a matrix} -\usage{ -invmatrix(m) -} -\arguments{ -\item{m}{a matrix} -} -\value{ -the inverted matrix -} -\description{ -Invert the matrix using Gaussian elimination -} -\details{ -\code{invmatrix} invertse the given matrix using Gaussian elimination -and returns the result. -} -\examples{ -A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -refmatrix(A) - -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{iterativematrix}}, \code{\link{lumatrix}}, - \code{\link{refmatrix}}, \code{\link{rowops}}, - \code{\link{tridiagmatrix}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/isPrime.Rd b/man/isPrime.Rd deleted file mode 100644 index dbe1d1f..0000000 --- a/man/isPrime.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/isPrime.R -\name{isPrime} -\alias{isPrime} -\title{Test for Primality} -\usage{ -isPrime(n) -} -\arguments{ -\item{n}{n} -} -\value{ -boolean TRUE if \code{n} is prime, FALSE if not -} -\description{ -Test the number given for primality. -} -\details{ -This function tests \code{n} if it is prime through repeated division -attempts. If a match is found, by finding a remainder of 0, -\code{FALSE} is returned. -} -\examples{ -isPrime(37) -isPrime(89) -isPrime(100) - -} -\seealso{ -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{fibonacci}}, \code{\link{horner}}, - \code{\link{linterp}}, \code{\link{nthroot}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} diff --git a/man/iterativematrix.Rd b/man/iterativematrix.Rd deleted file mode 100644 index d928f84..0000000 --- a/man/iterativematrix.Rd +++ /dev/null @@ -1,59 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/iterativematrix.R -\name{iterativematrix} -\alias{iterativematrix} -\alias{jacobi} -\alias{gaussseidel} -\alias{cgmmatrix} -\title{Solve a matrix using iterative methods} -\usage{ -jacobi(A, b, tol = 1e-06, maxiter = 100) - -gaussseidel(A, b, tol = 1e-06, maxiter = 100) - -cgmmatrix(A, b, tol = 1e-06, maxiter = 100) -} -\arguments{ -\item{A}{a square matrix representing the coefficients of a linear -system} - -\item{b}{a vector representing the right-hand side of the linear -system} - -\item{tol}{is a number representing the error tolerence} - -\item{maxiter}{is the maximum number of iterations} -} -\value{ -the solution vector -} -\description{ -Solve a matrix using iterative methods. -} -\details{ -\code{jacobi} finds the solution using Jacobi iteration. -Jacobi iteration depends on the matrix being diagonally-dominate. -The tolerence is specified the norm of the solution vector. - -\code{gaussseidel} finds the solution using Gauss-Seidel iteration. -Gauss-Seidel iteration depends on the matrix being either -diagonally-dominate or symmetric and positive definite. - -\code{cgmmatrix} finds the solution using the conjugate gradient -method. The conjugate gradient method depends on the matrix being -symmetric and positive definite. -} -\examples{ -A <- matrix(c(5, 2, 1, 2, 7, 3, 3, 4, 8), 3) -b <- c(40, 39, 55) -jacobi(A, b) - -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{invmatrix}}, \code{\link{lumatrix}}, - \code{\link{refmatrix}}, \code{\link{rowops}}, - \code{\link{tridiagmatrix}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/ivp.Rd b/man/ivp.Rd deleted file mode 100644 index 9b7906e..0000000 --- a/man/ivp.Rd +++ /dev/null @@ -1,47 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/ivp.R -\name{ivp} -\alias{ivp} -\alias{euler} -\alias{midptivp} -\alias{rungekutta4} -\alias{adamsbashforth} -\title{Initial value problems} -\usage{ -euler(f, x0, y0, h, n) - -midptivp(f, x0, y0, h, n) - -rungekutta4(f, x0, y0, h, n) - -adamsbashforth(f, x0, y0, h, n) -} -\arguments{ -\item{f}{function to integrate} - -\item{x0}{the initial value of x} - -\item{y0}{the initial value of y} - -\item{h}{selected step size} - -\item{n}{the number of steps} -} -\value{ -a data frame of \code{x} and \code{y} values -} -\description{ -solve initial value problems for ordinary differential equations -} -\details{ -The \code{euler} method implements the Euler method for solving -differential equations. The code{midptivp} method solves initial -value problems using the second-order Runge-Kutta method. The -\code{rungekutta4} method is the fourth-order Runge-Kutta method. -} -\examples{ -f <- function(x, y) { y / (2 * x + 1) } -ivp.euler <- euler(f, 0, 1, 1/100, 100) -ivp.midpt <- midptivp(f, 0, 1, 1/100, 100) -ivp.rk4 <- rungekutta4(f, 0, 1, 1/100, 100) -} diff --git a/man/ivpsys.Rd b/man/ivpsys.Rd deleted file mode 100644 index 3edafd8..0000000 --- a/man/ivpsys.Rd +++ /dev/null @@ -1,36 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/ivpsys.R -\name{ivpsys} -\alias{ivpsys} -\alias{eulersys} -\title{Initial value problems for systems of ordinary differential equations} -\usage{ -eulersys(f, x0, y0, h, n) -} -\arguments{ -\item{f}{function to integrate} - -\item{x0}{the initial value of x} - -\item{y0}{the vector initial values of y} - -\item{h}{selected step size} - -\item{n}{the number of steps} -} -\value{ -a data frame of \code{x} and \code{y} values -} -\description{ -solve initial value problems for systems ordinary differential equations -} -\details{ -The \code{euler} method implements the Euler method for solving -differential equations. The code{midptivp} method solves initial -value problems using the second-order Runge-Kutta method. The -\code{rungekutta4} method is the fourth-order Runge-Kutta method. -} -\examples{ -f <- function(x, y) { y / (2 * x + 1) } -ivp.euler <- euler(f, 0, 1, 1/100, 100) -} diff --git a/man/linterp.Rd b/man/linterp.Rd deleted file mode 100644 index 2e46e67..0000000 --- a/man/linterp.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/linterp.R -\name{linterp} -\alias{linterp} -\title{Linear interpolation} -\usage{ -linterp(x1, y1, x2, y2) -} -\arguments{ -\item{x1}{x value of the first point} - -\item{y1}{y value of the first point} - -\item{x2}{x value of the second point} - -\item{y2}{y value of the second point} -} -\value{ -a linear equation's coefficients -} -\description{ -Finds a linear function between two points -} -\details{ -\code{linterp} finds a linear function between two points. -} -\examples{ -f <- linterp(3, 2, 7, -2) - -} -\seealso{ -Other interp: \code{\link{bezier}}, \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{nn}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}} - -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{fibonacci}}, \code{\link{horner}}, - \code{\link{isPrime}}, \code{\link{nthroot}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} -\concept{interp} diff --git a/man/lumatrix.Rd b/man/lumatrix.Rd deleted file mode 100644 index b0125da..0000000 --- a/man/lumatrix.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/lumatrix.R -\name{lumatrix} -\alias{lumatrix} -\title{LU Decomposition} -\usage{ -lumatrix(m) -} -\arguments{ -\item{m}{a matrix} -} -\value{ -list with matrices L and U representing the LU decomposition -} -\description{ -Decompose a matrix into lower- and upper-triangular matrices -} -\details{ -\code{lumatrix} decomposes the matrix \code{m} into the LU -decomposition, such that m == L %*% U. -} -\examples{ -A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -lumatrix(A) - -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{invmatrix}}, \code{\link{iterativematrix}}, - \code{\link{refmatrix}}, \code{\link{rowops}}, - \code{\link{tridiagmatrix}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/mcint.Rd b/man/mcint.Rd deleted file mode 100644 index 9e18dc1..0000000 --- a/man/mcint.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/mcintegrate.R -\name{mcint} -\alias{mcint} -\alias{mcint2} -\title{Monte Carlo Integration} -\usage{ -mcint(f, a, b, m = 1000) - -mcint2(f, xdom, ydom, m = 1000) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the lower-bound of integration} - -\item{b}{the upper-bound of integration} - -\item{m}{the number of subintervals to calculate} - -\item{xdom}{the domain on \code{x} of integration in two dimensions} - -\item{ydom}{the domain on \code{y} of integration in two dimensions} -} -\value{ -the value of the integral -} -\description{ -Simple Monte Carlo Integraton -} -\details{ -The \code{mcint} function uses a simple Monte Carlo algorithm to -estimate the value of an integral. The parameter \code{n} sets the -total number of evaluation points. The parameter \code{max.y} is the -maximum expected value of the range of function \code{f}. The -\code{mcint2} provides Monte Carlo integration in two dimensions. -} -\examples{ -f <- function(x) { sin(x)^2 + log(x)} -mcint(f, 0, 1) -mcint(f, 0, 1, m = 10e6) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{giniquintile}}, - \code{\link{midpt}}, \code{\link{revolution-solid}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{simp}}, \code{\link{trap}} -} -\concept{integration} diff --git a/man/midpt.Rd b/man/midpt.Rd deleted file mode 100644 index 8e45ebc..0000000 --- a/man/midpt.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/midpt.R -\name{midpt} -\alias{midpt} -\title{rectangle method} -\usage{ -midpt(f, a, b, m = 100) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the a-bound of integration} - -\item{b}{the b-bound of integration} - -\item{m}{the number of subintervals to calculate} -} -\value{ -the value of the integral -} -\description{ -Use the rectangle method to integrate a function -} -\details{ -The \code{midpt} function uses the rectangle method to calculate -the integral of the function \code{f} over the interval from -\code{a} to \code{b}. The parameter \code{m} sets the number -of intervals to use when evaluating the rectangles. Additional -options are passed to the function \code{f} when evaluating. -} -\examples{ -f <- function(x) { sin(x)^2 + cos(x)^2 } -midpt(f, -pi, pi, m = 10) -midpt(f, -pi, pi, m = 100) -midpt(f, -pi, pi, m = 1000) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{giniquintile}}, - \code{\link{mcint}}, \code{\link{revolution-solid}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{simp}}, \code{\link{trap}} - -Other newton-cotes: \code{\link{adaptint}}, - \code{\link{giniquintile}}, \code{\link{romberg}}, - \code{\link{simp38}}, \code{\link{simp}}, - \code{\link{trap}} -} -\concept{integration} -\concept{newton-cotes} diff --git a/man/newton.Rd b/man/newton.Rd deleted file mode 100644 index f1865df..0000000 --- a/man/newton.Rd +++ /dev/null @@ -1,44 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/newton.R -\name{newton} -\alias{newton} -\title{Newton's method} -\usage{ -newton(f, fp, x, tol = 0.001, m = 100) -} -\arguments{ -\item{f}{function to integrate} - -\item{fp}{function representing the derivative of \code{f}} - -\item{x}{an initial estimate of the root} - -\item{tol}{the error tolerance} - -\item{m}{the maximum number of iterations} -} -\value{ -the real root found -} -\description{ -Use Newton's method to find real roots -} -\details{ -Newton's method finds real roots of a function, but requires knowing -the function derivative. It will return when the interval between -them is less than \code{tol}, the error tolerance. However, this -implementation also stops after \code{m} iterations. -} -\examples{ -f <- function(x) { x^3 - 2 * x^2 - 159 * x - 540 } -fp <- function(x) {3 * x^2 - 4 * x - 159 } -newton(f, fp, 1) - -} -\seealso{ -Other optimz: \code{\link{bisection}}, - \code{\link{goldsect}}, \code{\link{gradient}}, - \code{\link{hillclimbing}}, \code{\link{sa}}, - \code{\link{secant}} -} -\concept{optimz} diff --git a/man/nn.Rd b/man/nn.Rd deleted file mode 100644 index 6c6a833..0000000 --- a/man/nn.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/nn.R -\name{nn} -\alias{nn} -\title{Nearest interpolation} -\usage{ -nn(p, y, q) -} -\arguments{ -\item{p}{matrix of variable values, each row is a data point} - -\item{y}{vector of values, each entry corresponds to one row in \code{p}} - -\item{q}{vector of variable values, each entry corresponds to one column of \code{p}} -} -\value{ -an interpolated value for \var{q} -} -\description{ -Find the nearest neighbor for a set of data points -} -\details{ -\code{nn} finds the n-dimensional nearest neighbor for given datapoint -} -\examples{ -p <- matrix(floor(runif(100, 0, 9)), 20) -y <- floor(runif(20, 0, 9)) -q <- matrix(floor(runif(5, 0, 9)), 1) -nn(p, y, q) - -} -\seealso{ -Other interp: \code{\link{bezier}}, \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{linterp}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}} -} -\concept{interp} diff --git a/man/nthroot.Rd b/man/nthroot.Rd deleted file mode 100644 index 7fb5960..0000000 --- a/man/nthroot.Rd +++ /dev/null @@ -1,40 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/nthroot.R -\name{nthroot} -\alias{nthroot} -\title{The n-th root formula} -\usage{ -nthroot(a, n, tol = 1/1000) -} -\arguments{ -\item{a}{a positive real number} - -\item{n}{n} - -\item{tol}{the permitted error tolerance} -} -\value{ -the root -} -\description{ -Find the n-th root of real numbers -} -\details{ -The \code{nthroot} function finds the \code{n}th root of \code{a} via -an iterative process. -} -\examples{ -nthroot(100, 2) -nthroot(65536, 4) -nthroot(1000, 3) - -} -\seealso{ -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{fibonacci}}, \code{\link{horner}}, - \code{\link{isPrime}}, \code{\link{linterp}}, - \code{\link{polyinterp}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} diff --git a/man/polyinterp.Rd b/man/polyinterp.Rd deleted file mode 100644 index 96c4c59..0000000 --- a/man/polyinterp.Rd +++ /dev/null @@ -1,42 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/polyinterp.R -\name{polyinterp} -\alias{polyinterp} -\title{Polynomial interpolation} -\usage{ -polyinterp(x, y) -} -\arguments{ -\item{x}{a vector of x values} - -\item{y}{a vector of y values} -} -\value{ -a polynomial equation's coefficients -} -\description{ -Finds a polynomial function interpolating the given points -} -\details{ -\code{polyinterp} finds a polynomial that interpolates the given points. -} -\examples{ -x <- c(1, 2, 3) -y <- x^2 + 5 * x - 3 -f <- polyinterp(x, y) - -} -\seealso{ -Other interp: \code{\link{bezier}}, \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{linterp}}, - \code{\link{nn}}, \code{\link{pwiselinterp}} - -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{fibonacci}}, \code{\link{horner}}, - \code{\link{isPrime}}, \code{\link{linterp}}, - \code{\link{nthroot}}, \code{\link{pwiselinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} -\concept{interp} diff --git a/man/pwiselinterp.Rd b/man/pwiselinterp.Rd deleted file mode 100644 index b18df13..0000000 --- a/man/pwiselinterp.Rd +++ /dev/null @@ -1,52 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pwiselinterp.R -\name{pwiselinterp} -\alias{pwiselinterp} -\title{Piecewise linear interpolation} -\usage{ -pwiselinterp(x, y) -} -\arguments{ -\item{x}{a vector of x values} - -\item{y}{a vector of y values} -} -\value{ -a matrix with the linear function components -} -\description{ -Finds a piecewise linear function that interpolates the data points -} -\details{ -\code{pwiselinterp} finds a piecewise linear function that -interpolates the data points. For each x-y ordered pair, there -function finds the unique line interpolating them. The function will -return a data.frame with three columns. - -The column \code{x} is the upper bound of the domain for the given -piece. The columns \code{m} and \code{b} represent the coefficients -from the y-intercept form of the linear equation, y = mx + b. - -The matrix will contain length(x) rows with the first row having m -and b of NA. -} -\examples{ -x <- c(5, 0, 3) -y <- c(4, 0, 3) -f <- pwiselinterp(x, y) - -} -\seealso{ -Other interp: \code{\link{bezier}}, \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{linterp}}, - \code{\link{nn}}, \code{\link{polyinterp}} - -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{fibonacci}}, \code{\link{horner}}, - \code{\link{isPrime}}, \code{\link{linterp}}, - \code{\link{nthroot}}, \code{\link{polyinterp}}, - \code{\link{quadratic}} -} -\concept{algebra} -\concept{interp} diff --git a/man/quadratic.Rd b/man/quadratic.Rd deleted file mode 100644 index 769e228..0000000 --- a/man/quadratic.Rd +++ /dev/null @@ -1,45 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/quadratic.R -\name{quadratic} -\alias{quadratic} -\alias{quadratic2} -\title{The quadratic equation.} -\usage{ -quadratic(b2, b1, b0) - -quadratic2(b2, b1, b0) -} -\arguments{ -\item{b2}{the coefficient of the x^2 term} - -\item{b1}{the coefficient of the x term} - -\item{b0}{the constant term} -} -\value{ -numeric vector of solutions to the equation -} -\description{ -Find the zeros of a quadratic equation. -} -\details{ -\code{quadratic} and \code{quadratic2} implement the quadratic -equation from standard algebra in two different ways. The -\code{quadratic} function is susceptible to cascading numerical error -and the \code{quadratic2} has reduced potential error. -} -\examples{ -quadratic(1, 0, -1) -quadratic(4, -4, 1) -quadratic2(1, 0, -1) -quadratic2(4, -4, 1) -} -\seealso{ -Other algebra: \code{\link{bilinear}}, - \code{\link{cubicspline}}, \code{\link{division}}, - \code{\link{fibonacci}}, \code{\link{horner}}, - \code{\link{isPrime}}, \code{\link{linterp}}, - \code{\link{nthroot}}, \code{\link{polyinterp}}, - \code{\link{pwiselinterp}} -} -\concept{algebra} diff --git a/man/refmatrix.Rd b/man/refmatrix.Rd deleted file mode 100644 index 21658a6..0000000 --- a/man/refmatrix.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/refmatrix.R -\name{refmatrix} -\alias{refmatrix} -\alias{rrefmatrix} -\alias{solvematrix} -\title{Matrix to Row Echelon Form} -\usage{ -refmatrix(m) - -rrefmatrix(m) - -solvematrix(A, b) -} -\arguments{ -\item{m}{a matrix} - -\item{A}{a square matrix representing the coefficients of a linear -system in \code{solvematrix}} - -\item{b}{a vector representing the right-hand side of the linear -system in \code{solvematrix}} -} -\value{ -the modified matrix -} -\description{ -Transform a matrix to row echelon form. -} -\details{ -\code{refmatrix} reduces a matrix to row echelon form. This is not a -reduced row echelon form, though that can be easily calculated from -the diagonal. This function works on non-square matrices. - -\code{rrefmatrix} returns the reduced row echelon matrix. - -\code{solvematrix} solves a linear system using \code{rrefmatrix}. -} -\examples{ -A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -refmatrix(A) - -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{invmatrix}}, \code{\link{iterativematrix}}, - \code{\link{lumatrix}}, \code{\link{rowops}}, - \code{\link{tridiagmatrix}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/resizeImage.Rd b/man/resizeImage.Rd deleted file mode 100644 index d9dcb77..0000000 --- a/man/resizeImage.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/resizeImage.R -\name{resizeImage} -\alias{resizeImage} -\alias{resizeImageNN} -\alias{resizeImageBL} -\title{Image resizing} -\usage{ -resizeImageNN(imx, width, height) - -resizeImageBL(imx, width, height) -} -\arguments{ -\item{imx}{a 3-dimensional array containing image data} - -\item{width}{the new width} - -\item{height}{the new height} -} -\value{ -a three-dimensional array containing the resized image. -} -\description{ -Resize images using nearest neighbor and -} -\details{ -The \var{resizeImageNN} function uses the nearest neighbor method to -resize the image. Also, \var{resizeImageBL} uses bilinear -interpolation to resize the image. -} -\concept{interpolation} diff --git a/man/revolution-solid.Rd b/man/revolution-solid.Rd deleted file mode 100644 index 8e7805e..0000000 --- a/man/revolution-solid.Rd +++ /dev/null @@ -1,46 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/revolution-solid.R -\name{revolution-solid} -\alias{revolution-solid} -\alias{shellmethod} -\alias{discmethod} -\title{Volumes of solids of revolution} -\usage{ -shellmethod(f, a, b) - -discmethod(f, a, b) -} -\arguments{ -\item{f}{function of revolution} - -\item{a}{lower-bound of the solid} - -\item{b}{upper-bound of the solid} -} -\value{ -the volume of the solid -} -\description{ -Find the volume of a solid of revolution -} -\details{ -The functions \code{discmethod} and \code{shellmethod} implement the -algorithms for finding the volume of solids of revolution. The -\code{discmethod} function is suitable for volumes revolved around -the \code{x}-axis and the \code{shellmethod} function is suitable for -volumes revolved around the \code{y}-axis. -} -\examples{ -f <- function(x) { x^2 } -shellmethod(f, 1, 2) -discmethod(f, 1, 2) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{giniquintile}}, - \code{\link{mcint}}, \code{\link{midpt}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{simp}}, \code{\link{trap}} -} -\concept{integration} diff --git a/man/romberg.Rd b/man/romberg.Rd deleted file mode 100644 index 06e5c8f..0000000 --- a/man/romberg.Rd +++ /dev/null @@ -1,53 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/romberg.R -\name{romberg} -\alias{romberg} -\title{Romberg Integration} -\usage{ -romberg(f, a, b, m, tab = FALSE) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the lowerbound of integration} - -\item{b}{the upperbound of integration} - -\item{m}{the maximum number of iterations} - -\item{tab}{if \code{TRUE}, return the table of values} -} -\value{ -the value of the integral -} -\description{ -Romberg's adaptive integration -} -\details{ -The \code{romberg} function uses Romberg's rule to calculate the -integral of the function \code{f} over the interval from \code{a} -to \code{b}. The parameter \code{m} sets the number of intervals -to use when evaluating. Additional options are passed to the -function \code{f} when evaluating. -} -\examples{ -f <- function(x) { sin(x)^2 + log(x)} -romberg(f, 1, 10, m = 3) -romberg(f, 1, 10, m = 5) -romberg(f, 1, 10, m = 10) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{giniquintile}}, - \code{\link{mcint}}, \code{\link{midpt}}, - \code{\link{revolution-solid}}, \code{\link{simp38}}, - \code{\link{simp}}, \code{\link{trap}} - -Other newton-cotes: \code{\link{adaptint}}, - \code{\link{giniquintile}}, \code{\link{midpt}}, - \code{\link{simp38}}, \code{\link{simp}}, - \code{\link{trap}} -} -\concept{integration} -\concept{newton-cotes} diff --git a/man/rowops.Rd b/man/rowops.Rd deleted file mode 100644 index a0f7442..0000000 --- a/man/rowops.Rd +++ /dev/null @@ -1,54 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/rowops.R -\name{rowops} -\alias{rowops} -\alias{swaprows} -\alias{replacerow} -\alias{scalerow} -\title{Elementary row operations} -\usage{ -swaprows(m, row1, row2) - -replacerow(m, row1, row2, k) - -scalerow(m, row, k) -} -\arguments{ -\item{m}{a matrix} - -\item{row1}{a source row} - -\item{row2}{a destination row} - -\item{k}{a scaling factor} - -\item{row}{a row to modify} -} -\value{ -the modified matrix -} -\description{ -These are elementary operations for a matrix. They do not presume a -square matrix and will work on any matrix. They use R's internal row -addressing to function. -} -\details{ -\code{replacerow} replaces one row with the sum of itself and the -multiple of another row. \code{swaprows} swap two rows in the -matrix. \code{scalerow} scales all enteries in a row by a constant. -} -\examples{ -n <- 5 -A <- matrix(sample.int(10, n^2, TRUE) - 1, n) -A <- swaprows(A, 2, 4) -A <- replacerow(A, 1, 3, 2) -A <- scalerow(A, 5, 10) -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{invmatrix}}, \code{\link{iterativematrix}}, - \code{\link{lumatrix}}, \code{\link{refmatrix}}, - \code{\link{tridiagmatrix}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/sa.Rd b/man/sa.Rd deleted file mode 100644 index dc2dcca..0000000 --- a/man/sa.Rd +++ /dev/null @@ -1,45 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/sa.R -\name{sa} -\alias{sa} -\alias{tspsa} -\title{Simulated annealing} -\usage{ -sa(f, x, temp = 10000, rate = 1e-04) - -tspsa(x, temp = 100, rate = 1e-04) -} -\arguments{ -\item{f}{function representing \code{f}} - -\item{x}{an initial estimate of the minimum} - -\item{temp}{the initial temperature} - -\item{rate}{the cooling rate} -} -\value{ -the \code{x} value of the minimum found -} -\description{ -Use simulated annealing to find the global minimum -} -\details{ -Simulated annealing finds a global minimum by mimicing the -metallurgical process of annealing. -} -\examples{ -f <- function(x) { x^6 - 4 * x^5 - 7 * x^4 + 22 * x^3 + 24 * x^2 + 2} -sa(f, 0) - -f <- function(x) { (x[1] - 1)^2 + (x[2] - 1)^2 } -sa(f, c(0, 0), 0.05) - -} -\seealso{ -Other optimz: \code{\link{bisection}}, - \code{\link{goldsect}}, \code{\link{gradient}}, - \code{\link{hillclimbing}}, \code{\link{newton}}, - \code{\link{secant}} -} -\concept{optimz} diff --git a/man/secant.Rd b/man/secant.Rd deleted file mode 100644 index 3052fc6..0000000 --- a/man/secant.Rd +++ /dev/null @@ -1,41 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/secant.R -\name{secant} -\alias{secant} -\title{Secant Method} -\usage{ -secant(f, x, tol = 0.001, m = 100) -} -\arguments{ -\item{f}{function to integrate} - -\item{x}{an initial estimate of the root} - -\item{tol}{the error tolerance} - -\item{m}{the maximum number of iterations} -} -\value{ -the real root found -} -\description{ -The secant method for root finding -} -\details{ -The secant method for root finding extends Newton's method to -estimate the derivative. It will return when the interval between -them is less than \code{tol}, the error tolerance. However, this -implementation also stop if after \code{m} iterations. -} -\examples{ -f <- function(x) { x^3 - 2 * x^2 - 159 * x - 540 } -secant(f, 1) - -} -\seealso{ -Other optimz: \code{\link{bisection}}, - \code{\link{goldsect}}, \code{\link{gradient}}, - \code{\link{hillclimbing}}, \code{\link{newton}}, - \code{\link{sa}} -} -\concept{optimz} diff --git a/man/simp.Rd b/man/simp.Rd deleted file mode 100644 index a8f6ad6..0000000 --- a/man/simp.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/simp.R -\name{simp} -\alias{simp} -\title{Simpson's rule} -\usage{ -simp(f, a, b, m = 100) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the a-bound of integration} - -\item{b}{the b-bound of integration} - -\item{m}{the number of subintervals to calculate} -} -\value{ -the value of the integral -} -\description{ -Use Simpson's rule to integrate a function -} -\details{ -The \code{simp} function uses Simpson's rule to calculate the -integral of the function \code{f} over the interval from \code{a} -to \code{b}. The parameter \code{m} sets the number of intervals -to use when evaluating. Additional options are passed to the -function \code{f} when evaluating. -} -\examples{ -f <- function(x) { sin(x)^2 + cos(x)^2 } -simp(f, -pi, pi, m = 10) -simp(f, -pi, pi, m = 100) -simp(f, -pi, pi, m = 1000) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{giniquintile}}, - \code{\link{mcint}}, \code{\link{midpt}}, - \code{\link{revolution-solid}}, \code{\link{romberg}}, - \code{\link{simp38}}, \code{\link{trap}} - -Other newton-cotes: \code{\link{adaptint}}, - \code{\link{giniquintile}}, \code{\link{midpt}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{trap}} -} -\concept{integration} -\concept{newton-cotes} diff --git a/man/simp38.Rd b/man/simp38.Rd deleted file mode 100644 index 8f92b85..0000000 --- a/man/simp38.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/simp38.R -\name{simp38} -\alias{simp38} -\title{Simpson's 3/8 rule} -\usage{ -simp38(f, a, b, m = 100) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the a-bound of integration} - -\item{b}{the b-bound of integration} - -\item{m}{the number of subintervals to calculate} -} -\value{ -the value of the integral -} -\description{ -Use Simpson's 3/8 rule to integrate a function -} -\details{ -The \code{simp38} function uses Simpson's 3/8 rule to calculate the -integral of the function \code{f} over the interval from \code{a} -to \code{b}. The parameter \code{m} sets the number of intervals -to use when evaluating. Additional options are passed to the -function \code{f} when evaluating. -} -\examples{ -f <- function(x) { sin(x)^2 + log(x) } -simp38(f, 1, 10, m = 10) -simp38(f, 1, 10, m = 100) -simp38(f, 1, 10, m = 1000) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{giniquintile}}, - \code{\link{mcint}}, \code{\link{midpt}}, - \code{\link{revolution-solid}}, \code{\link{romberg}}, - \code{\link{simp}}, \code{\link{trap}} - -Other newton-cotes: \code{\link{adaptint}}, - \code{\link{giniquintile}}, \code{\link{midpt}}, - \code{\link{romberg}}, \code{\link{simp}}, - \code{\link{trap}} -} -\concept{integration} -\concept{newton-cotes} diff --git a/man/summation.Rd b/man/summation.Rd deleted file mode 100644 index cdccc6e..0000000 --- a/man/summation.Rd +++ /dev/null @@ -1,45 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/naivesum.R -\name{summation} -\alias{summation} -\alias{naivesum} -\alias{kahansum} -\alias{pwisesum} -\title{Two summing algorithms} -\usage{ -naivesum(x) - -kahansum(x) - -pwisesum(x) -} -\arguments{ -\item{x}{a vector of numbers to be summed} -} -\value{ -the sum -} -\description{ -Find the sum of a vector -} -\details{ -\code{naivesum} calculates the sum of a vector by keeping a counter -and repeatedly adding the next value to the interim sum. -\code{kahansum} uses Kahan's algorithm to capture the low-order -precision loss and ensure that the loss is reintegrated into the -final sum. \code{pwisesum} is a recursive implementation of the -piecewise summation algorithm that divides the vector in two and adds -the individual vector sums for a result. -} -\examples{ -k <- 1:10^6 -n <- sample(k, 1) -bound <- sample(k, 2) -bound.upper <- max(bound) - 10^6 / 2 -bound.lower <- min(bound) - 10^6 / 2 -x <- runif(n, bound.lower, bound.upper) -naivesum(x) -kahansum(x) -pwisesum(x) -} -\concept{intro} diff --git a/man/trap.Rd b/man/trap.Rd deleted file mode 100644 index 0762082..0000000 --- a/man/trap.Rd +++ /dev/null @@ -1,51 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/trap.R -\name{trap} -\alias{trap} -\title{Trapezoid method} -\usage{ -trap(f, a, b, m = 100) -} -\arguments{ -\item{f}{function to integrate} - -\item{a}{the a-bound of integration} - -\item{b}{the b-bound of integration} - -\item{m}{the number of subintervals to calculate} -} -\value{ -the value of the integral -} -\description{ -Use the trapezoid method to integrate a function -} -\details{ -The \code{trap} function uses the trapezoid method to calculate -the integral of the function \code{f} over the interval from -\code{a} to \code{b}. The parameter \code{m} sets the -number of intervals to use when evaluating the trapezoids. Additional -options are passed to the function \code{f} when evaluating. -} -\examples{ -f <- function(x) { sin(x)^2 + cos(x)^2 } -trap(f, -pi, pi, m = 10) -trap(f, -pi, pi, m = 100) -trap(f, -pi, pi, m = 1000) - -} -\seealso{ -Other integration: \code{\link{adaptint}}, - \code{\link{gaussint}}, \code{\link{giniquintile}}, - \code{\link{mcint}}, \code{\link{midpt}}, - \code{\link{revolution-solid}}, \code{\link{romberg}}, - \code{\link{simp38}}, \code{\link{simp}} - -Other newton-cotes: \code{\link{adaptint}}, - \code{\link{giniquintile}}, \code{\link{midpt}}, - \code{\link{romberg}}, \code{\link{simp38}}, - \code{\link{simp}} -} -\concept{integration} -\concept{newton-cotes} diff --git a/man/tridiagmatrix.Rd b/man/tridiagmatrix.Rd deleted file mode 100644 index 0edd71e..0000000 --- a/man/tridiagmatrix.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/tridiagmatrix.R -\name{tridiagmatrix} -\alias{tridiagmatrix} -\title{Solve a tridiagonal matrix} -\usage{ -tridiagmatrix(L, D, U, b) -} -\arguments{ -\item{L}{vector of entries below the main diagonal} - -\item{D}{vector of entries on the main diagonal} - -\item{U}{vector of entries above the main diagonal} - -\item{b}{vector of the right-hand side of the linear system} -} -\value{ -the solution vector -} -\description{ -use the tridiagonal matrix algorithm to solve a tridiagonal matrix -} -\details{ -\code{tridiagmatrix} uses the tridiagonal matrix algorithm to solve a -tridiagonal matrix. -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{invmatrix}}, \code{\link{iterativematrix}}, - \code{\link{lumatrix}}, \code{\link{refmatrix}}, - \code{\link{rowops}}, \code{\link{vecnorm}} -} -\concept{linear} diff --git a/man/vecnorm.Rd b/man/vecnorm.Rd deleted file mode 100644 index f749851..0000000 --- a/man/vecnorm.Rd +++ /dev/null @@ -1,33 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/vecnorm.R -\name{vecnorm} -\alias{vecnorm} -\title{Norm of a vector} -\usage{ -vecnorm(b) -} -\arguments{ -\item{b}{a vector} -} -\value{ -the norm -} -\description{ -Find the norm of a vector -} -\details{ -Find the norm of a vector -} -\examples{ -x <- c(1, 2, 3) -vecnorm(x) - -} -\seealso{ -Other linear: \code{\link{choleskymatrix}}, - \code{\link{detmatrix}}, \code{\link{gdls}}, - \code{\link{invmatrix}}, \code{\link{iterativematrix}}, - \code{\link{lumatrix}}, \code{\link{refmatrix}}, - \code{\link{rowops}}, \code{\link{tridiagmatrix}} -} -\concept{linear} diff --git a/man/wave.Rd b/man/wave.Rd deleted file mode 100644 index 049f86f..0000000 --- a/man/wave.Rd +++ /dev/null @@ -1,41 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/wave.R -\name{wave} -\alias{wave} -\title{Wave Equation using} -\usage{ -wave(u, alpha, xdelta, tdelta, n) -} -\arguments{ -\item{u}{the initial values of u} - -\item{alpha}{the thermal diffusivity coefficient} - -\item{xdelta}{the change in \code{x} at each step in \code{u}} - -\item{tdelta}{the time step} - -\item{n}{the number of steps to take} -} -\value{ -a matrix of u values at each time step -} -\description{ -solve heat equation via forward-time central-space method -} -\details{ -The \code{heat} solves the heat equation using the forward-time -central-space method in one-dimension. -} -\examples{ -speed <- 2 -x0 <- 0 -xdelta <- .05 -x <- seq(x0, 1, xdelta) -m <- length(x) -u <- sin(x * pi * 2) -u[11:21] <- 0 -tdelta <- .02 -n <- 40 -z <- wave(u, speed, xdelta, tdelta, n) -} diff --git a/man/wilkinson.Rd b/man/wilkinson.Rd deleted file mode 100644 index e67b83b..0000000 --- a/man/wilkinson.Rd +++ /dev/null @@ -1,32 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/wilkinson.R -\name{wilkinson} -\alias{wilkinson} -\title{Wilkinson's Polynomial} -\usage{ -wilkinson(x, w = 20) -} -\arguments{ -\item{x}{the \code{x}-value} - -\item{w}{the number of terms in the polynomial} -} -\value{ -the value of the function at \code{x} -} -\description{ -Wilkinson's polynomial -} -\details{ -Wilkinson's polynomail is a terrible joke played on numerical -analysis. By tradition, the function is f(x) = (x - 1)(x - 2)...(x - -20), giving a function with real roots at each integer from 1 to 20. -This function is generalized and allows for \code{n} and the function -value is f(x) = (x - 1)(x - 2)...(x - n). The default of \code{n} is -20. -} -\examples{ -wilkinson(0) - -} -\concept{polynomials} From 2ab7f4f8cf976588fe160170e8ca827eb2be8a91 Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:53:28 -0400 Subject: [PATCH 09/11] Move page push to master --- .github/workflows/pkgdown.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 4bd22a9..4de669a 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -1,6 +1,6 @@ on: push: - branches: develop + branches: master name: pkgdown From 59f8a67aaca7fbaf142dd48d132f536101ce413b Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:54:19 -0400 Subject: [PATCH 10/11] And there goes the docs --- docs/COPYRIGHT.html | 138 -------- docs/LICENSE-text.html | 131 -------- docs/authors.html | 153 --------- docs/docsearch.css | 148 --------- docs/docsearch.js | 85 ----- docs/index.html | 381 ---------------------- docs/link.svg | 12 - docs/pkgdown.css | 236 -------------- docs/pkgdown.js | 115 ------- docs/pkgdown.yml | 8 - docs/reference/adaptint.html | 207 ------------ docs/reference/bezier.html | 199 ------------ docs/reference/bilinear.html | 208 ------------ docs/reference/bisection.html | 202 ------------ docs/reference/bvp.html | 179 ----------- docs/reference/choleskymatrix.html | 192 ----------- docs/reference/cmna-package.html | 168 ---------- docs/reference/cubicspline.html | 197 ------------ docs/reference/detmatrix.html | 183 ----------- docs/reference/division.html | 203 ------------ docs/reference/fibonacci.html | 185 ----------- docs/reference/findiff.html | 193 ------------ docs/reference/gaussint.html | 205 ------------ docs/reference/gdls.html | 208 ------------ docs/reference/giniquintile.html | 195 ------------ docs/reference/goldsect.html | 204 ------------ docs/reference/gradient.html | 213 ------------- docs/reference/heat.html | 195 ------------ docs/reference/hillclimbing.html | 196 ------------ docs/reference/himmelblau.html | 167 ---------- docs/reference/horner.html | 209 ------------ docs/reference/index.html | 456 --------------------------- docs/reference/invmatrix.html | 187 ----------- docs/reference/isPrime.html | 185 ----------- docs/reference/iterativematrix.html | 210 ------------ docs/reference/ivp.html | 199 ------------ docs/reference/ivpsys.html | 191 ----------- docs/reference/linterp.html | 197 ------------ docs/reference/lumatrix.html | 201 ------------ docs/reference/mcint.html | 209 ------------ docs/reference/midpt.html | 203 ------------ docs/reference/newton.html | 202 ------------ docs/reference/nn.html | 191 ----------- docs/reference/nthroot.html | 192 ----------- docs/reference/polyinterp.html | 191 ----------- docs/reference/pwiselinterp.html | 199 ------------ docs/reference/quadratic.html | 195 ------------ docs/reference/refmatrix.html | 204 ------------ docs/reference/resizeImage.html | 179 ----------- docs/reference/revolution-solid.html | 197 ------------ docs/reference/romberg.html | 207 ------------ docs/reference/rowops.html | 211 ------------- docs/reference/sa.html | 199 ------------ docs/reference/secant.html | 197 ------------ docs/reference/simp.html | 203 ------------ docs/reference/simp38.html | 203 ------------ docs/reference/summation.html | 187 ----------- docs/reference/trap.html | 203 ------------ docs/reference/tridiagmatrix.html | 190 ----------- docs/reference/vecnorm.html | 183 ----------- docs/reference/wave.html | 197 ------------ docs/reference/wilkinson.html | 181 ----------- docs/sitemap.xml | 159 ---------- 63 files changed, 12023 deletions(-) delete mode 100644 docs/COPYRIGHT.html delete mode 100644 docs/LICENSE-text.html delete mode 100644 docs/authors.html delete mode 100644 docs/docsearch.css delete mode 100644 docs/docsearch.js delete mode 100644 docs/index.html delete mode 100644 docs/link.svg delete mode 100644 docs/pkgdown.css delete mode 100644 docs/pkgdown.js delete mode 100644 docs/pkgdown.yml delete mode 100644 docs/reference/adaptint.html delete mode 100644 docs/reference/bezier.html delete mode 100644 docs/reference/bilinear.html delete mode 100644 docs/reference/bisection.html delete mode 100644 docs/reference/bvp.html delete mode 100644 docs/reference/choleskymatrix.html delete mode 100644 docs/reference/cmna-package.html delete mode 100644 docs/reference/cubicspline.html delete mode 100644 docs/reference/detmatrix.html delete mode 100644 docs/reference/division.html delete mode 100644 docs/reference/fibonacci.html delete mode 100644 docs/reference/findiff.html delete mode 100644 docs/reference/gaussint.html delete mode 100644 docs/reference/gdls.html delete mode 100644 docs/reference/giniquintile.html delete mode 100644 docs/reference/goldsect.html delete mode 100644 docs/reference/gradient.html delete mode 100644 docs/reference/heat.html delete mode 100644 docs/reference/hillclimbing.html delete mode 100644 docs/reference/himmelblau.html delete mode 100644 docs/reference/horner.html delete mode 100644 docs/reference/index.html delete mode 100644 docs/reference/invmatrix.html delete mode 100644 docs/reference/isPrime.html delete mode 100644 docs/reference/iterativematrix.html delete mode 100644 docs/reference/ivp.html delete mode 100644 docs/reference/ivpsys.html delete mode 100644 docs/reference/linterp.html delete mode 100644 docs/reference/lumatrix.html delete mode 100644 docs/reference/mcint.html delete mode 100644 docs/reference/midpt.html delete mode 100644 docs/reference/newton.html delete mode 100644 docs/reference/nn.html delete mode 100644 docs/reference/nthroot.html delete mode 100644 docs/reference/polyinterp.html delete mode 100644 docs/reference/pwiselinterp.html delete mode 100644 docs/reference/quadratic.html delete mode 100644 docs/reference/refmatrix.html delete mode 100644 docs/reference/resizeImage.html delete mode 100644 docs/reference/revolution-solid.html delete mode 100644 docs/reference/romberg.html delete mode 100644 docs/reference/rowops.html delete mode 100644 docs/reference/sa.html delete mode 100644 docs/reference/secant.html delete mode 100644 docs/reference/simp.html delete mode 100644 docs/reference/simp38.html delete mode 100644 docs/reference/summation.html delete mode 100644 docs/reference/trap.html delete mode 100644 docs/reference/tridiagmatrix.html delete mode 100644 docs/reference/vecnorm.html delete mode 100644 docs/reference/wave.html delete mode 100644 docs/reference/wilkinson.html delete mode 100644 docs/sitemap.xml diff --git a/docs/COPYRIGHT.html b/docs/COPYRIGHT.html deleted file mode 100644 index 295943c..0000000 --- a/docs/COPYRIGHT.html +++ /dev/null @@ -1,138 +0,0 @@ - - - - - - - - -Simplified BSD License • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
- - -
- -

Copyright © 2016-2019, James P. Howard, II <>
All rights reserved.

-

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

-
    -
  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. -
  3. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  4. -
-

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

-
- -
- -
- - -
- - -
-

Site built with pkgdown 1.3.0.

-
-
-
- - - - - - diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html deleted file mode 100644 index 5731950..0000000 --- a/docs/LICENSE-text.html +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - -License • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
- - -
YEAR: 2016
-COPYRIGHT HOLDER: James P. Howard, II
-
- -
- -
- - -
- - -
-

Site built with pkgdown 1.3.0.

-
-
-
- - - - - - diff --git a/docs/authors.html b/docs/authors.html deleted file mode 100644 index 509380a..0000000 --- a/docs/authors.html +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - -Citation and Authors • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - -
- -
-
- - -

Howard JP (2017). -Computational Methods for Numerical Analysis with R, series Numerical Analysis and Scientific Computing Series. -Chapman and Hall/CRC, Boca Raton, Florida. -https://jameshoward.us/cmna. -

-
@Book{,
-  title = {Computational Methods for Numerical Analysis with R},
-  author = {James P. Howard},
-  year = {2017},
-  publisher = {Chapman and Hall/CRC},
-  address = {Boca Raton, Florida},
-  series = {Numerical Analysis and Scientific Computing Series},
-  url = {https://jameshoward.us/cmna},
-}
- - -
    -
  • -

    James Howard. Author, maintainer. ORCID -

    -
  • -
- -
- -
- - -
- - -
-

Site built with pkgdown 1.3.0.

-
-
-
- - - - - - diff --git a/docs/docsearch.css b/docs/docsearch.css deleted file mode 100644 index e5f1fe1..0000000 --- a/docs/docsearch.css +++ /dev/null @@ -1,148 +0,0 @@ -/* Docsearch -------------------------------------------------------------- */ -/* - Source: https://github.com/algolia/docsearch/ - License: MIT -*/ - -.algolia-autocomplete { - display: block; - -webkit-box-flex: 1; - -ms-flex: 1; - flex: 1 -} - -.algolia-autocomplete .ds-dropdown-menu { - width: 100%; - min-width: none; - max-width: none; - padding: .75rem 0; - background-color: #fff; - background-clip: padding-box; - border: 1px solid rgba(0, 0, 0, .1); - box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); -} - -@media (min-width:768px) { - .algolia-autocomplete .ds-dropdown-menu { - width: 175% - } -} - -.algolia-autocomplete .ds-dropdown-menu::before { - display: none -} - -.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { - padding: 0; - background-color: rgb(255,255,255); - border: 0; - max-height: 80vh; -} - -.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { - margin-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion { - padding: 0; - overflow: visible -} - -.algolia-autocomplete .algolia-docsearch-suggestion--category-header { - padding: .125rem 1rem; - margin-top: 0; - font-size: 1.3em; - font-weight: 500; - color: #00008B; - border-bottom: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { - float: none; - padding-top: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { - float: none; - width: auto; - padding: 0; - text-align: left -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content { - float: none; - width: auto; - padding: 0 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--content::before { - display: none -} - -.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { - padding-top: .75rem; - margin-top: .75rem; - border-top: 1px solid rgba(0, 0, 0, .1) -} - -.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { - display: block; - padding: .1rem 1rem; - margin-bottom: 0.1; - font-size: 1.0em; - font-weight: 400 - /* display: none */ -} - -.algolia-autocomplete .algolia-docsearch-suggestion--title { - display: block; - padding: .25rem 1rem; - margin-bottom: 0; - font-size: 0.9em; - font-weight: 400 -} - -.algolia-autocomplete .algolia-docsearch-suggestion--text { - padding: 0 1rem .5rem; - margin-top: -.25rem; - font-size: 0.8em; - font-weight: 400; - line-height: 1.25 -} - -.algolia-autocomplete .algolia-docsearch-footer { - width: 110px; - height: 20px; - z-index: 3; - margin-top: 10.66667px; - float: right; - font-size: 0; - line-height: 0; -} - -.algolia-autocomplete .algolia-docsearch-footer--logo { - background-image: url("data:image/svg+xml;utf8,"); - background-repeat: no-repeat; - background-position: 50%; - background-size: 100%; - overflow: hidden; - text-indent: -9000px; - width: 100%; - height: 100%; - display: block; - transform: translate(-8px); -} - -.algolia-autocomplete .algolia-docsearch-suggestion--highlight { - color: #FF8C00; - background: rgba(232, 189, 54, 0.1) -} - - -.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { - box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) -} - -.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { - background-color: rgba(192, 192, 192, .15) -} diff --git a/docs/docsearch.js b/docs/docsearch.js deleted file mode 100644 index b35504c..0000000 --- a/docs/docsearch.js +++ /dev/null @@ -1,85 +0,0 @@ -$(function() { - - // register a handler to move the focus to the search bar - // upon pressing shift + "/" (i.e. "?") - $(document).on('keydown', function(e) { - if (e.shiftKey && e.keyCode == 191) { - e.preventDefault(); - $("#search-input").focus(); - } - }); - - $(document).ready(function() { - // do keyword highlighting - /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ - var mark = function() { - - var referrer = document.URL ; - var paramKey = "q" ; - - if (referrer.indexOf("?") !== -1) { - var qs = referrer.substr(referrer.indexOf('?') + 1); - var qs_noanchor = qs.split('#')[0]; - var qsa = qs_noanchor.split('&'); - var keyword = ""; - - for (var i = 0; i < qsa.length; i++) { - var currentParam = qsa[i].split('='); - - if (currentParam.length !== 2) { - continue; - } - - if (currentParam[0] == paramKey) { - keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); - } - } - - if (keyword !== "") { - $(".contents").unmark({ - done: function() { - $(".contents").mark(keyword); - } - }); - } - } - }; - - mark(); - }); -}); - -/* Search term highlighting ------------------------------*/ - -function matchedWords(hit) { - var words = []; - - var hierarchy = hit._highlightResult.hierarchy; - // loop to fetch from lvl0, lvl1, etc. - for (var idx in hierarchy) { - words = words.concat(hierarchy[idx].matchedWords); - } - - var content = hit._highlightResult.content; - if (content) { - words = words.concat(content.matchedWords); - } - - // return unique words - var words_uniq = [...new Set(words)]; - return words_uniq; -} - -function updateHitURL(hit) { - - var words = matchedWords(hit); - var url = ""; - - if (hit.anchor) { - url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; - } else { - url = hit.url + '?q=' + escape(words.join(" ")); - } - - return url; -} diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index 6ef2da9..0000000 --- a/docs/index.html +++ /dev/null @@ -1,381 +0,0 @@ - - - - - - - -Computational Methods for Numerical Analysis • cmna - - - - - - - - - -
-
- - - -
-
-
- - -

This is the R package to support Computational Methods for Numerical Analysis with R by James P. Howard, II.

-
-

-Algorithms included

-
    -
  • Elementary and Example Algorithms -
      -
    • Polynomial Expansion -
        -
      • Naive (naivepoly)
      • -
      • Cached Naive (betterpoly)
      • -
      • Horner’s Method (horner, rhorner)
      • -
      -
    • -
    • Summation -
        -
      • Naive Summation (naivesum)
      • -
      • Kahan Summation (kahansum)
      • -
      -
    • -
    • Division -
        -
      • Naive Division (naivediv)
      • -
      • Long Division (longdiv)
      • -
      -
    • -
    • Miscellaneous -
        -
      • Naive Primality tester (isPrime)
      • -
      • Nth Root (nthroot)
      • -
      • Quadratic Formula (quadratic, quadratic2)
      • -
      -
    • -
    • Samples -
        -
      • Fibbonaci (fibonacci)
      • -
      • Wilinson’s Polynomial (wilkinson)
      • -
      • Himmelblau (himmelblau)
      • -
      -
    • -
    -
  • -
  • Linear Algebra -
      -
    • Row/Vector Operations -
        -
      • Row Replacement (replacerow)
      • -
      • Scale Row (scalerow)
      • -
      • Swap Rows (swaprows)
      • -
      • Norm of a Vector (vecnorm)
      • -
      -
    • -
    • Elementary Functions -
        -
      • Determinant (detmatrix)
      • -
      • Matrix Inverse (invmatrix)
      • -
      • Row-Echelon Form (refmatrix)
      • -
      • Reduced Row-Echelon Form (rrefmatrix)
      • -
      • Solve a Matrix, Using Row Reduction (solvematrix)
      • -
      -
    • -
    • Decompositions -
        -
      • Cholesky Decomposition (choleskymatrix)
      • -
      • LU Decomposition (lumatrix)
      • -
      -
    • -
    • Iterative Methods -
        -
      • Conjugate Gradient (cgmmatrix)
      • -
      • Gauss Seidel (gaussseidel)
      • -
      • Jacobi (jacobi)
      • -
      -
    • -
    • Specialty Methods -
        -
      • Tridiagonal Matrix Solver (tridiagmatrix)
      • -
      -
    • -
    -
  • -
  • Interpolation and Extrapolation -
      -
    • Polynomial Interpolation -
        -
      • Liner Interpolation (linterp)
      • -
      • Polynomial Interpolation (polyinterp)
      • -
      -
    • -
    • Splines -
        -
      • Piecewise Linear (pwiselinterp)
      • -
      • Cubic Spline (cubicspline)
      • -
      -
    • -
    • Bezier -
        -
      • Quadratic Bezier (qbezier)
      • -
      • Cubic Bezier (cbezier)
      • -
      -
    • -
    • Multidimensional Interpolaters -
        -
      • Bilinear (bilinear)
      • -
      • Nearest Neighbor (nn)
      • -
      -
    • -
    • Applications -
        -
      • Image Resizing (resizeImageNN, resizeImageBL)
      • -
      -
    • -
    -
  • -
  • Differentiation -
      -
    • Finite Differences -
        -
      • One-Step (findiff)
      • -
      • More Differentiators (symdiff, rdiff)
      • -
      • Second Derivative (findiff2)
      • -
      -
    • -
    -
  • -
  • Numerical Integration -
      -
    • Newton-Cotes -
        -
      • Midpoint Method (midpt)
      • -
      • Trapezoid Method (trap)
      • -
      • Simpson’s Rule (simp)
      • -
      • Simpson’s 3/8s Rule (simp38)
      • -
      -
    • -
    • Gaussian Integration -
        -
      • Driver (gaussint)
      • -
      • Specific forms (gauss.hermite, gauss.laguerre, gauss.legendre)
      • -
      -
    • -
    • Adaptive Integrators -
        -
      • Recursive Adaptive (adaptint)
      • -
      • Romberg (romberg)
      • -
      -
    • -
    • Monte Carlo -
        -
      • Monte Carlo Integration, 1D (mcint)
      • -
      • Monte Carlo Integration, 2D (mcint2)
      • -
      -
    • -
    • Applications -
        -
      • Shell Method for Revolved Volume (shellmethod)
      • -
      • Disc Method for Revolved Volume (discmethod)
      • -
      • Gini Coefficient (giniquintile)
      • -
      -
    • -
    -
  • -
  • Root Finding -
      -
    • Bisection Method (bisection)
    • -
    • Newton’s Method (newton)
    • -
    • Secant Method (secant)
    • -
    -
  • -
  • Optimization -
      -
    • Continuous -
        -
      • Golden Section (goldsectmax, goldsectmin)
      • -
      • Gradient Descent (gd, gdls, gradasc, graddsc)
      • -
      • Hill Climbing (hillclimbing)
      • -
      • Simulated Annealing (sa)
      • -
      -
    • -
    • Discrete -
        -
      • Traveling Salesperson Problem (tspsa)
      • -
      -
    • -
    -
  • -
  • Differential Equations -
      -
    • Initial Value Problems -
        -
      • Euler Method (euler)
      • -
      • Midpoint Method (midptivp)
      • -
      • Fouth-Order Runge-Kutta (rungekutta4)
      • -
      • Adams-Bashforth (adamsbashforth)
      • -
      -
    • -
    • Systems of Differential Equations -
        -
      • Euler Method (eulersys)
      • -
      -
    • -
    • Partial Differential Equations -
        -
      • Heat Equation, 1D (heat)
      • -
      • Wave Equation, 1D (wave)
      • -
      -
    • -
    • Applications -
        -
      • Boundary Value Problems (bvpexample, bvpexample10)
      • -
      -
    • -
    -
  • -
-
-
-

-Dependencies

-
    -
  • testthat
  • -
  • roxygen2
  • -
-
-
-

-Contribution guidelines

- -
-
-

-For more information

- -
-
-
- - -
- -
- -
-

Site built with pkgdown 1.3.0.

-
-
-
- - - - - diff --git a/docs/link.svg b/docs/link.svg deleted file mode 100644 index 88ad827..0000000 --- a/docs/link.svg +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - diff --git a/docs/pkgdown.css b/docs/pkgdown.css deleted file mode 100644 index c03fb08..0000000 --- a/docs/pkgdown.css +++ /dev/null @@ -1,236 +0,0 @@ -/* Sticky footer */ - -/** - * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ - * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css - * - * .Site -> body > .container - * .Site-content -> body > .container .row - * .footer -> footer - * - * Key idea seems to be to ensure that .container and __all its parents__ - * have height set to 100% - * - */ - -html, body { - height: 100%; -} - -body > .container { - display: flex; - height: 100%; - flex-direction: column; - - padding-top: 60px; -} - -body > .container .row { - flex: 1 0 auto; -} - -footer { - margin-top: 45px; - padding: 35px 0 36px; - border-top: 1px solid #e5e5e5; - color: #666; - display: flex; - flex-shrink: 0; -} -footer p { - margin-bottom: 0; -} -footer div { - flex: 1; -} -footer .pkgdown { - text-align: right; -} -footer p { - margin-bottom: 0; -} - -img.icon { - float: right; -} - -img { - max-width: 100%; -} - -/* Fix bug in bootstrap (only seen in firefox) */ -summary { - display: list-item; -} - -/* Typographic tweaking ---------------------------------*/ - -.contents .page-header { - margin-top: calc(-60px + 1em); -} - -/* Section anchors ---------------------------------*/ - -a.anchor { - margin-left: -30px; - display:inline-block; - width: 30px; - height: 30px; - visibility: hidden; - - background-image: url(./link.svg); - background-repeat: no-repeat; - background-size: 20px 20px; - background-position: center center; -} - -.hasAnchor:hover a.anchor { - visibility: visible; -} - -@media (max-width: 767px) { - .hasAnchor:hover a.anchor { - visibility: hidden; - } -} - - -/* Fixes for fixed navbar --------------------------*/ - -.contents h1, .contents h2, .contents h3, .contents h4 { - padding-top: 60px; - margin-top: -40px; -} - -/* Static header placement on mobile devices */ -@media (max-width: 767px) { - .navbar-fixed-top { - position: absolute; - } - .navbar { - padding: 0; - } -} - - -/* Sidebar --------------------------*/ - -#sidebar { - margin-top: 30px; -} -#sidebar h2 { - font-size: 1.5em; - margin-top: 1em; -} - -#sidebar h2:first-child { - margin-top: 0; -} - -#sidebar .list-unstyled li { - margin-bottom: 0.5em; -} - -.orcid { - height: 16px; - vertical-align: middle; -} - -/* Reference index & topics ----------------------------------------------- */ - -.ref-index th {font-weight: normal;} - -.ref-index td {vertical-align: top;} -.ref-index .icon {width: 40px;} -.ref-index .alias {width: 40%;} -.ref-index-icons .alias {width: calc(40% - 40px);} -.ref-index .title {width: 60%;} - -.ref-arguments th {text-align: right; padding-right: 10px;} -.ref-arguments th, .ref-arguments td {vertical-align: top;} -.ref-arguments .name {width: 20%;} -.ref-arguments .desc {width: 80%;} - -/* Nice scrolling for wide elements --------------------------------------- */ - -table { - display: block; - overflow: auto; -} - -/* Syntax highlighting ---------------------------------------------------- */ - -pre { - word-wrap: normal; - word-break: normal; - border: 1px solid #eee; -} - -pre, code { - background-color: #f8f8f8; - color: #333; -} - -pre code { - overflow: auto; - word-wrap: normal; - white-space: pre; -} - -pre .img { - margin: 5px 0; -} - -pre .img img { - background-color: #fff; - display: block; - height: auto; -} - -code a, pre a { - color: #375f84; -} - -a.sourceLine:hover { - text-decoration: none; -} - -.fl {color: #1514b5;} -.fu {color: #000000;} /* function */ -.ch,.st {color: #036a07;} /* string */ -.kw {color: #264D66;} /* keyword */ -.co {color: #888888;} /* comment */ - -.message { color: black; font-weight: bolder;} -.error { color: orange; font-weight: bolder;} -.warning { color: #6A0366; font-weight: bolder;} - -/* Clipboard --------------------------*/ - -.hasCopyButton { - position: relative; -} - -.btn-copy-ex { - position: absolute; - right: 0; - top: 0; - visibility: hidden; -} - -.hasCopyButton:hover button.btn-copy-ex { - visibility: visible; -} - -/* mark.js ----------------------------*/ - -mark { - background-color: rgba(255, 255, 51, 0.5); - border-bottom: 2px solid rgba(255, 153, 51, 0.3); - padding: 1px; -} - -/* vertical spacing after htmlwidgets */ -.html-widget { - margin-bottom: 10px; -} diff --git a/docs/pkgdown.js b/docs/pkgdown.js deleted file mode 100644 index eb7e83d..0000000 --- a/docs/pkgdown.js +++ /dev/null @@ -1,115 +0,0 @@ -/* http://gregfranko.com/blog/jquery-best-practices/ */ -(function($) { - $(function() { - - $("#sidebar") - .stick_in_parent({offset_top: 40}) - .on('sticky_kit:bottom', function(e) { - $(this).parent().css('position', 'static'); - }) - .on('sticky_kit:unbottom', function(e) { - $(this).parent().css('position', 'relative'); - }); - - $('body').scrollspy({ - target: '#sidebar', - offset: 60 - }); - - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); - } - - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } - - return(haystack.length); - } - - /* Clipboard --------------------------*/ - - function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); - $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); - } - - if(ClipboardJS.isSupported()) { - $(document).ready(function() { - var copyButton = ""; - - $(".examples, div.sourceCode").addClass("hasCopyButton"); - - // Insert copy buttons: - $(copyButton).prependTo(".hasCopyButton"); - - // Initialize tooltips: - $('.btn-copy-ex').tooltip({container: 'body'}); - - // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { - text: function(trigger) { - return trigger.parentNode.textContent; - } - }); - - clipboardBtnCopies.on('success', function(e) { - changeTooltipMessage(e.trigger, 'Copied!'); - e.clearSelection(); - }); - - clipboardBtnCopies.on('error', function() { - changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); - }); - }); - } -})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml deleted file mode 100644 index dba37d0..0000000 --- a/docs/pkgdown.yml +++ /dev/null @@ -1,8 +0,0 @@ -pandoc: 2.3.1 -pkgdown: 1.3.0 -pkgdown_sha: ~ -articles: {} -urls: - reference: https://howardjp.github.io/cmna//reference - article: https://howardjp.github.io/cmna//articles - diff --git a/docs/reference/adaptint.html b/docs/reference/adaptint.html deleted file mode 100644 index a72238f..0000000 --- a/docs/reference/adaptint.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - - -Adaptive Integration — adaptint • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Adaptive integration

    - -
    - -
    adaptint(f, a, b, n = 10, tol = 1e-06)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the a-bound of integration

    b

    the b-bound of integration

    n

    the maximum recursive depth

    tol

    the maximum error tolerance

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The adaptint function uses Romberg's rule to calculate the -integral of the function f over the interval from a -to b. The parameter n sets the number of intervals -to use when evaluating. Additional options are passed to the -function f when evaluating.

    - -

    See also

    - -

    Other integration: gaussint, - giniquintile, mcint, - midpt, revolution-solid, - romberg, simp38, - simp, trap

    -

    Other newton-cotes: giniquintile, - midpt, romberg, - simp38, simp, - trap

    - - -

    Examples

    -
    f <- function(x) { sin(x)^2 + log(x) } -adaptint(f, 1, 10, n = 4)
    #> [1] 18.53653
    adaptint(f, 1, 10, n = 5)
    #> [1] 18.52788
    adaptint(f, 1, 10, n = 10)
    #> [1] 18.52494
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/bezier.html b/docs/reference/bezier.html deleted file mode 100644 index 62b21c7..0000000 --- a/docs/reference/bezier.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - -Bezier curves — bezier • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Find the quadratic and cubic Bezier curve for the given points

    - -
    - -
    qbezier(x, y, t)
    -
    -cbezier(x, y, t)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    x

    a vector of x values

    y

    a vector of y values

    t

    a vector of t values for which the curve will be computed

    - -

    Value

    - -

    a list composed of an x-vector and a y-vector

    - -

    Details

    - -

    qbezier finds the quadratic Bezier curve for the -given three points and cbezier finds the cubic Bezier curve -for the given four points. The curve will be computed at all values -in the vector t and a list of x and y values returned.

    - -

    See also

    - - - - -

    Examples

    -
    x <- c(1, 2, 3) -y <- c(2, 3, 5) -f <- qbezier(x, y, seq(0, 1, 1/100)) - -x <- c(-1, 1, 0, -2) -y <- c(-2, 2, -1, -1) -f <- cbezier(x, y, seq(0, 1, 1/100))
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/bilinear.html b/docs/reference/bilinear.html deleted file mode 100644 index 915ec9f..0000000 --- a/docs/reference/bilinear.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - -Bilinear interpolation — bilinear • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Finds a bilinear interpolation bounded by four points

    - -
    - -
    bilinear(x, y, z, newx, newy)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    x

    vector of two x values representing x_1 and x_2

    y

    vector of two y values representing y_1 and y_2

    z

    2x2 matrix if z values

    newx

    vector of new x values to interpolate

    newy

    vector of new y values to interpolate

    - -

    Value

    - -

    a vector of interpolated z values at (x, y)

    - -

    Details

    - -

    bilinear finds a bilinear interpolation bounded by four corners

    - -

    See also

    - - - - -

    Examples

    -
    x <- c(2, 4) -y <- c(4, 7) -z <- matrix(c(81, 84, 85, 89), nrow = 2) -newx <- c(2.5, 3, 3.5) -newy <- c(5, 5.5, 6) -bilinear(x, y, z, newx, newy)
    #> [1] 83.08333 84.75000 86.50000
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/bisection.html b/docs/reference/bisection.html deleted file mode 100644 index 692c94b..0000000 --- a/docs/reference/bisection.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - -The Bisection Method — bisection • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use the bisection method to find real roots

    - -
    - -
    bisection(f, a, b, tol = 0.001, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to locate a root for

    a

    the a bound of the search region

    b

    the b bound of the search region

    tol

    the error tolerance

    m

    the maximum number of iterations

    - -

    Value

    - -

    the real root found

    - -

    Details

    - -

    The bisection method functions by repeatedly halving the interval -between a and b and will return when the -interval between them is less than tol, the error tolerance. -However, this implementation also stops if after m -iterations.

    - -

    See also

    - -

    Other optimz: goldsect, - gradient, hillclimbing, - newton, sa, - secant

    - - -

    Examples

    -
    f <- function(x) { x^3 - 2 * x^2 - 159 * x - 540} -bisection(f, 0, 10)
    #> [1] 9.999695
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/bvp.html b/docs/reference/bvp.html deleted file mode 100644 index 63057e7..0000000 --- a/docs/reference/bvp.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - -Boundary value problems — bvp • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    solve boundary value problems for ordinary differential equations

    - -
    - -
    bvpexample(x)
    -
    -bvpexample10(x)
    - -

    Arguments

    - - - - - - -
    x

    proposed initial x-value

    - -

    Value

    - -

    a data frame of x and y values

    - -

    Details

    - -

    The euler method implements the Euler method for solving -differential equations. The codemidptivp method solves initial -value problems using the second-order Runge-Kutta method. The -rungekutta4 method is the fourth-order Runge-Kutta method.

    - - -

    Examples

    -
    bvpexample(-2)
    #> [1] -2.782773
    bvpexample(-1)
    #> [1] -1.775453
    bvpexample(0)
    #> [1] -0.5779241
    bvpexample(1)
    #> [1] 0.8409145
    bvpexample(2)
    #> [1] 2.518243
    ## (bvp.b <- bisection(bvpexample, 0, 1)) -## (bvp.s <- secant(bvpexample, 0)) - -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/choleskymatrix.html b/docs/reference/choleskymatrix.html deleted file mode 100644 index 81286d3..0000000 --- a/docs/reference/choleskymatrix.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - -Cholesky Decomposition — choleskymatrix • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Decompose a matrix into the Cholesky

    - -
    - -
    choleskymatrix(m)
    - -

    Arguments

    - - - - - - -
    m

    a matrix

    - -

    Value

    - -

    the matrix L

    - -

    Details

    - -

    choleskymatrix decomposes the matrix m into the LU -decomposition, such that m == L

    - -

    See also

    - - - - -

    Examples

    -
    (A <- matrix(c(5, 1, 2, 1, 9, 3, 2, 3, 7), 3))
    #> [,1] [,2] [,3] -#> [1,] 5 1 2 -#> [2,] 1 9 3 -#> [3,] 2 3 7
    (L <- choleskymatrix(A))
    #> [,1] [,2] [,3] -#> [1,] 2.236068 0.4472136 0.8944272 -#> [2,] 0.000000 2.9664794 0.8764598 -#> [3,] 0.000000 0.0000000 2.3306261
    t(L) %*% L
    #> [,1] [,2] [,3] -#> [1,] 5 1 2 -#> [2,] 1 9 3 -#> [3,] 2 3 7
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/cmna-package.html b/docs/reference/cmna-package.html deleted file mode 100644 index a5a373d..0000000 --- a/docs/reference/cmna-package.html +++ /dev/null @@ -1,168 +0,0 @@ - - - - - - - - -Computational Methods for Numerical Analysis — cmna-package • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Provides the source and examples for Computational Methods for -Numerical Analysis with R.

    - -
    - - -

    Details

    - -

    This package provides a suite of simple implementations of standard -methods from numerical analysis. The collection is designed to -accompany Computational Methods for Numerical Analysis with R -by James P. Howard, II. Together, these functions provide methods to -support linear algebra, interpolation, integration, root finding, -optimization, and differential equations.

    - -

    See also

    - - - - -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/cubicspline.html b/docs/reference/cubicspline.html deleted file mode 100644 index 3e7e09b..0000000 --- a/docs/reference/cubicspline.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - -Natural cubic spline interpolation — cubicspline • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Finds a piecewise linear function that interpolates the data points

    - -
    - -
    cubicspline(x, y)
    - -

    Arguments

    - - - - - - - - - - -
    x

    a vector of x values

    y

    a vector of y values

    - -

    Value

    - -

    a list of coefficient vectors

    - -

    Details

    - -

    cubicspline finds a piecewise cubic spline function that -interpolates the data points. For each x-y ordered pair. The function will -return a list of four vectors representing the coefficients.

    - -

    See also

    - - - - -

    Examples

    -
    x <- c(1, 2, 3) -y <- c(2, 3, 5) -f <- cubicspline(x, y) - -x <- c(-1, 1, 0, -2) -y <- c(-2, 2, -1, -1) -f <- cubicspline(x, y)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/detmatrix.html b/docs/reference/detmatrix.html deleted file mode 100644 index 4901d92..0000000 --- a/docs/reference/detmatrix.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - -Calculate the determinant of the matrix — detmatrix • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Calculate the determinant of the matrix

    - -
    - -
    detmatrix(m)
    - -

    Arguments

    - - - - - - -
    m

    a matrix

    - -

    Value

    - -

    the determinant

    - -

    Details

    - -

    detmatrix calculates the determinant of the matrix given.

    - -

    See also

    - - - - -

    Examples

    -
    A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -detmatrix(A)
    #> [1] 1
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/division.html b/docs/reference/division.html deleted file mode 100644 index c6aeb7b..0000000 --- a/docs/reference/division.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - -Algorithms for divisions — division • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Algorithms for division that provide a quotient and remainder.

    - -
    - -
    naivediv(m, n)
    -
    -longdiv(m, n)
    - -

    Arguments

    - - - - - - - - - - -
    m

    the dividend

    n

    the divisor

    - -

    Value

    - -

    the quotient and remainder as a list

    - -

    Details

    - -

    The naivediv divides m by n by using repeated -division. The longdiv function uses the long division -algorithm in binary.

    - -

    See also

    - - - - -

    Examples

    -
    a <- floor(runif(1, 1, 1000)) -b <- floor(runif(1, 1, 100)) -naivediv(a, b)
    #> $quotient -#> [1] 0 -#> -#> $remainder -#> [1] 81 -#>
    longdiv(a, b)
    #> $quotient -#> [1] 0 -#> -#> $remainder -#> [1] 81 -#>
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/fibonacci.html b/docs/reference/fibonacci.html deleted file mode 100644 index 234267f..0000000 --- a/docs/reference/fibonacci.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - -Fibonacci numbers — fibonacci • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Return the n-th Fibonacci number

    - -
    - -
    fibonacci(n)
    - -

    Arguments

    - - - - - - -
    n

    n

    - -

    Value

    - -

    the sequence element

    - -

    Details

    - -

    This function is recursively implements the famous Fibonacci -sequence. The function returns the nth member of the -sequence.

    - -

    See also

    - - - - -

    Examples

    -
    fibonacci(10)
    #> [1] 55
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/findiff.html b/docs/reference/findiff.html deleted file mode 100644 index 97fcfab..0000000 --- a/docs/reference/findiff.html +++ /dev/null @@ -1,193 +0,0 @@ - - - - - - - - -Finite Differences — findiff • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Finite differences formulas

    - -
    - -
    findiff(f, x, h = x * sqrt(.Machine$double.eps))
    -
    -symdiff(f, x, h = x * .Machine$double.eps^(1/3))
    -
    -findiff2(f, x, h)
    -
    -rdiff(f, x, n = 10, h = 1e-04)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function to differentiate

    x

    the x-value to differentiate at

    h

    the step-size for evaluation

    n

    the maximum number of convergence steps in rdiff

    - -

    Value

    - -

    the value of the derivative

    - -

    Details

    - -

    The findiff formula uses the finite differences formula to -find the derivative of f at x. The value of h -is the step size of the evaluation. The function findiff2 -provides the second derivative.

    - - -

    Examples

    -
    findiff(sin, pi, 1e-3)
    #> [1] -0.9999998
    symdiff(sin, pi, 1e-3)
    #> [1] -0.9999998
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/gaussint.html b/docs/reference/gaussint.html deleted file mode 100644 index c5c6390..0000000 --- a/docs/reference/gaussint.html +++ /dev/null @@ -1,205 +0,0 @@ - - - - - - - - -Gaussian integration method driver — gaussint • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use the Gaussian method to evaluate integrals

    - -
    - -
    gaussint(f, x, w)
    -
    -gauss.legendre(f, m = 5)
    -
    -gauss.laguerre(f, m = 5)
    -
    -gauss.hermite(f, m = 5)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    x

    list of evaluation points

    w

    list of weights

    m

    number of evaluation points

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The gaussint function uses the Gaussian integration to -evaluate an integral. The function itself is a driver and expects -the integration points and associated weights as options.

    - -

    See also

    - - - - -

    Examples

    -
    w = c(1, 1) -x = c(-1 / sqrt(3), 1 / sqrt(3)) -f <- function(x) { x^3 + x + 1 } -gaussint(f, x, w)
    #> [1] 2
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/gdls.html b/docs/reference/gdls.html deleted file mode 100644 index 8699e68..0000000 --- a/docs/reference/gdls.html +++ /dev/null @@ -1,208 +0,0 @@ - - - - - - - - -Least squares with graident descent — gdls • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Solve least squares with graident descent

    - -
    - -
    gdls(A, b, alpha = 0.05, tol = 1e-06, m = 1e+05)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    A

    a square matrix representing the coefficients of a linear system

    b

    a vector representing the right-hand side of the linear system

    alpha

    the learning rate

    tol

    the expected error tolerance

    m

    the maximum number of iterations

    - -

    Value

    - -

    the modified matrix

    - -

    Details

    - -

    gdls solves a linear system using gradient descent.

    - -

    See also

    - - - - -

    Examples

    -
    head(b <- iris$Sepal.Length)
    #> [1] 5.1 4.9 4.7 4.6 5.0 5.4
    head(A <- matrix(cbind(1, iris$Sepal.Width, iris$Petal.Length, iris$Petal.Width), ncol = 4))
    #> [,1] [,2] [,3] [,4] -#> [1,] 1 3.5 1.4 0.2 -#> [2,] 1 3.0 1.4 0.2 -#> [3,] 1 3.2 1.3 0.2 -#> [4,] 1 3.1 1.5 0.2 -#> [5,] 1 3.6 1.4 0.2 -#> [6,] 1 3.9 1.7 0.4
    gdls(A, b, alpha = 0.05, m = 10000)
    #> Warning: iterations maximum exceeded
    #> [,1] -#> [1,] 1.8439696 -#> [2,] 0.6538332 -#> [3,] 0.7107731 -#> [4,] -0.5593274
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/giniquintile.html b/docs/reference/giniquintile.html deleted file mode 100644 index d0d9abe..0000000 --- a/docs/reference/giniquintile.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - -Gini coefficients — giniquintile • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Calculate the Gini coefficient from quintile data

    - -
    - -
    giniquintile(L)
    - -

    Arguments

    - - - - - - -
    L

    vector of percentages at 20th, 40th, 60th, and 80th -percentiles

    - -

    Value

    - -

    the estimated Gini coefficient

    - -

    Details

    - -

    Calculate the Gini coefficient given the quintile data.

    - -

    References

    - -

    Leon Gerber, "A Quintile Rule for the Gini Coefficient", -Mathematics Magazine, 80:2, April 2007.

    - -

    See also

    - -

    Other integration: adaptint, - gaussint, mcint, - midpt, revolution-solid, - romberg, simp38, - simp, trap

    -

    Other newton-cotes: adaptint, - midpt, romberg, - simp38, simp, - trap

    - - -

    Examples

    -
    L <- c(4.3, 9.8, 15.4, 22.7) -giniquintile(L)
    #> [1] 0.4223958
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/goldsect.html b/docs/reference/goldsect.html deleted file mode 100644 index bf1ec0c..0000000 --- a/docs/reference/goldsect.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - -Golden Section Search — goldsect • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use golden section search to find local extrema

    - -
    - -
    goldsectmin(f, a, b, tol = 0.001, m = 100)
    -
    -goldsectmax(f, a, b, tol = 0.001, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the a bound of the search region

    b

    the b bound of the search region

    tol

    the error tolerance

    m

    the maximum number of iterations

    - -

    Value

    - -

    the x value of the minimum found

    - -

    Details

    - -

    The golden section search method functions by repeatedly dividing the interval -between a and b and will return when the -interval between them is less than tol, the error tolerance. -However, this implementation also stop if after m -iterations.

    - -

    See also

    - -

    Other optimz: bisection, - gradient, hillclimbing, - newton, sa, - secant

    - - -

    Examples

    -
    f <- function(x) { x^2 - 3 * x + 3 } -goldsectmin(f, 0, 5)
    #> [1] 1.500066
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/gradient.html b/docs/reference/gradient.html deleted file mode 100644 index 2bf3972..0000000 --- a/docs/reference/gradient.html +++ /dev/null @@ -1,213 +0,0 @@ - - - - - - - - -Gradient descent — gradient • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use gradient descent to find local minima

    - -
    - -
    graddsc(fp, x, h = 0.001, tol = 1e-04, m = 1000)
    -
    -gradasc(fp, x, h = 0.001, tol = 1e-04, m = 1000)
    -
    -gd(fp, x, h = 100, tol = 1e-04, m = 1000)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    fp

    function representing the derivative of f

    x

    an initial estimate of the minima

    h

    the step size

    tol

    the error tolerance

    m

    the maximum number of iterations

    - -

    Value

    - -

    the x value of the minimum found

    - -

    Details

    - -

    Gradient descent can be used to find local minima of functions. It -will return an approximation based on the step size h and -fp. The tol is the error tolerance, x is the -initial guess at the minimum. This implementation also stops after -m iterations.

    - -

    See also

    - -

    Other optimz: bisection, - goldsect, hillclimbing, - newton, sa, - secant

    - - -

    Examples

    -
    fp <- function(x) { x^3 + 3 * x^2 - 1 } -graddsc(fp, 0)
    #> [1] 0.5067967
    -f <- function(x) { (x[1] - 1)^2 + (x[2] - 1)^2 } -fp <-function(x) { - x1 <- 2 * x[1] - 2 - x2 <- 8 * x[2] - 8 - - return(c(x1, x2)) -} -gd(fp, c(0, 0), 0.05)
    #> [1] 0.9991405 1.0000000
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/heat.html b/docs/reference/heat.html deleted file mode 100644 index c8a0840..0000000 --- a/docs/reference/heat.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - -Heat Equation via Forward-Time Central-Space — heat • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    solve heat equation via forward-time central-space method

    - -
    - -
    heat(u, alpha, xdelta, tdelta, n)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    u

    the initial values of u

    alpha

    the thermal diffusivity coefficient

    xdelta

    the change in x at each step in u

    tdelta

    the time step

    n

    the number of steps to take

    - -

    Value

    - -

    a matrix of u values at each time step

    - -

    Details

    - -

    The heat solves the heat equation using the forward-time -central-space method in one-dimension.

    - - -

    Examples

    -
    alpha <- 1 -x0 <- 0 -xdelta <- .05 -x <- seq(x0, 1, xdelta) -u <- sin(x^4 * pi) -tdelta <- .001 -n <- 25 -z <- heat(u, alpha, xdelta, tdelta, n)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/hillclimbing.html b/docs/reference/hillclimbing.html deleted file mode 100644 index d4bb286..0000000 --- a/docs/reference/hillclimbing.html +++ /dev/null @@ -1,196 +0,0 @@ - - - - - - - - -Hill climbing — hillclimbing • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use hill climbing to find the global minimum

    - -
    - -
    hillclimbing(f, x, h = 1, m = 1000)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function representing the derivative of f

    x

    an initial estimate of the minimum

    h

    the step size

    m

    the maximum number of iterations

    - -

    Value

    - -

    the x value of the minimum found

    - -

    Details

    - -

    Hill climbing

    - -

    See also

    - -

    Other optimz: bisection, - goldsect, gradient, - newton, sa, - secant

    - - -

    Examples

    -
    f <- function(x) { - (x[1]^2 + x[2] - 11)^2 + (x[1] + x[2]^2 - 7)^2 -} -hillclimbing(f, c(0,0))
    #> [1] -3.773609 -3.279415
    hillclimbing(f, c(-1,-1))
    #> [1] -3.778311 -3.281417
    hillclimbing(f, c(10,10))
    #> [1] -2.803689 3.135395
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/himmelblau.html b/docs/reference/himmelblau.html deleted file mode 100644 index c1e7e9b..0000000 --- a/docs/reference/himmelblau.html +++ /dev/null @@ -1,167 +0,0 @@ - - - - - - - - -Himmelblau Function — himmelblau • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Generate the Himmelblau function

    - -
    - -
    himmelblau(x)
    - -

    Arguments

    - - - - - - -
    x

    a vector of x-values

    - -

    Value

    - -

    the value of the function at x.

    - -

    Details

    - -

    Generate the Himmelblau function

    - - -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/horner.html b/docs/reference/horner.html deleted file mode 100644 index 5dfbbe0..0000000 --- a/docs/reference/horner.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - -Horner's rule — horner • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use Horner's rule to evaluate a polynomial

    - -
    - -
    horner(x, coefs)
    -
    -rhorner(x, coefs)
    -
    -naivepoly(x, coefs)
    -
    -betterpoly(x, coefs)
    - -

    Arguments

    - - - - - - - - - - -
    x

    a vector of x values to evaluate the polynomial

    coefs

    vector of coefficients of x

    - -

    Value

    - -

    the value of the function at x

    - -

    Details

    - -

    This function implements Horner's rule for fast polynomial -evaluation. The implementation expects x to be a vector of x -values at which to evaluate the polynomial. The parameter coefs -is a vector of coefficients of x. The vector order is such -that the first element is the constant term, the second element is -the coefficient of x, the so forth to the highest degreed -term. Terms with a 0 coefficient should have a 0 element in the -vector.

    -

    The function rhorner implements the the Horner algorithm -recursively.

    -

    The function naivepoly implements a polynomial evaluator using -the straightforward algebraic approach.

    -

    The function betterpoly implements a polynomial evaluator using -the straightforward algebraic approach with cached x terms.

    - -

    See also

    - - - - -

    Examples

    -
    b <- c(2, 10, 11) -x <- 5 -horner(x, b)
    #> [1] 327
    b <- c(-1, 0, 1) -x <- c(1, 2, 3, 4) -horner(x, b)
    #> [1] 0 3 8 15
    rhorner(x, b)
    #> [1] 0 3 8 15
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/index.html b/docs/reference/index.html deleted file mode 100644 index f4d9578..0000000 --- a/docs/reference/index.html +++ /dev/null @@ -1,456 +0,0 @@ - - - - - - - - -Function reference • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -

    All functions

    -

    -
    -

    adaptint()

    -

    Adaptive Integration

    -

    qbezier() cbezier()

    -

    Bezier curves

    -

    bilinear()

    -

    Bilinear interpolation

    -

    bisection()

    -

    The Bisection Method

    -

    bvpexample() bvpexample10()

    -

    Boundary value problems

    -

    choleskymatrix()

    -

    Cholesky Decomposition

    -

    cmna-package

    -

    Computational Methods for Numerical Analysis

    -

    cubicspline()

    -

    Natural cubic spline interpolation

    -

    detmatrix()

    -

    Calculate the determinant of the matrix

    -

    naivediv() longdiv()

    -

    Algorithms for divisions

    -

    fibonacci()

    -

    Fibonacci numbers

    -

    findiff() symdiff() findiff2() rdiff()

    -

    Finite Differences

    -

    gaussint() gauss.legendre() gauss.laguerre() gauss.hermite()

    -

    Gaussian integration method driver

    -

    gdls()

    -

    Least squares with graident descent

    -

    giniquintile()

    -

    Gini coefficients

    -

    goldsectmin() goldsectmax()

    -

    Golden Section Search

    -

    graddsc() gradasc() gd()

    -

    Gradient descent

    -

    heat()

    -

    Heat Equation via Forward-Time Central-Space

    -

    hillclimbing()

    -

    Hill climbing

    -

    himmelblau()

    -

    Himmelblau Function

    -

    horner() rhorner() naivepoly() betterpoly()

    -

    Horner's rule

    -

    invmatrix()

    -

    Invert a matrix

    -

    isPrime()

    -

    Test for Primality

    -

    jacobi() gaussseidel() cgmmatrix()

    -

    Solve a matrix using iterative methods

    -

    euler() midptivp() rungekutta4() adamsbashforth()

    -

    Initial value problems

    -

    eulersys()

    -

    Initial value problems for systems of ordinary differential equations

    -

    linterp()

    -

    Linear interpolation

    -

    lumatrix()

    -

    LU Decomposition

    -

    mcint() mcint2()

    -

    Monte Carlo Integration

    -

    midpt()

    -

    rectangle method

    -

    newton()

    -

    Newton's method

    -

    nn()

    -

    Nearest interpolation

    -

    nthroot()

    -

    The n-th root formula

    -

    polyinterp()

    -

    Polynomial interpolation

    -

    pwiselinterp()

    -

    Piecewise linear interpolation

    -

    quadratic() quadratic2()

    -

    The quadratic equation.

    -

    refmatrix() rrefmatrix() solvematrix()

    -

    Matrix to Row Echelon Form

    -

    resizeImageNN() resizeImageBL()

    -

    Image resizing

    -

    shellmethod() discmethod()

    -

    Volumes of solids of revolution

    -

    romberg()

    -

    Romberg Integration

    -

    swaprows() replacerow() scalerow()

    -

    Elementary row operations

    -

    sa() tspsa()

    -

    Simulated annealing

    -

    secant()

    -

    Secant Method

    -

    simp()

    -

    Simpson's rule

    -

    simp38()

    -

    Simpson's 3/8 rule

    -

    naivesum() kahansum() pwisesum()

    -

    Two summing algorithms

    -

    trap()

    -

    Trapezoid method

    -

    tridiagmatrix()

    -

    Solve a tridiagonal matrix

    -

    vecnorm()

    -

    Norm of a vector

    -

    wave()

    -

    Wave Equation using

    -

    wilkinson()

    -

    Wilkinson's Polynomial

    -
    - - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/invmatrix.html b/docs/reference/invmatrix.html deleted file mode 100644 index ab4cb23..0000000 --- a/docs/reference/invmatrix.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - -Invert a matrix — invmatrix • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Invert the matrix using Gaussian elimination

    - -
    - -
    invmatrix(m)
    - -

    Arguments

    - - - - - - -
    m

    a matrix

    - -

    Value

    - -

    the inverted matrix

    - -

    Details

    - -

    invmatrix invertse the given matrix using Gaussian elimination -and returns the result.

    - -

    See also

    - - - - -

    Examples

    -
    A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -refmatrix(A)
    #> [,1] [,2] [,3] -#> [1,] 1 -1 2 -#> [2,] 0 1 -3 -#> [3,] 0 0 1
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/isPrime.html b/docs/reference/isPrime.html deleted file mode 100644 index 0c65285..0000000 --- a/docs/reference/isPrime.html +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - -Test for Primality — isPrime • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Test the number given for primality.

    - -
    - -
    isPrime(n)
    - -

    Arguments

    - - - - - - -
    n

    n

    - -

    Value

    - -

    boolean TRUE if n is prime, FALSE if not

    - -

    Details

    - -

    This function tests n if it is prime through repeated division -attempts. If a match is found, by finding a remainder of 0, -FALSE is returned.

    - -

    See also

    - - - - -

    Examples

    -
    isPrime(37)
    #> [1] TRUE
    isPrime(89)
    #> [1] TRUE
    isPrime(100)
    #> [1] FALSE
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/iterativematrix.html b/docs/reference/iterativematrix.html deleted file mode 100644 index 928b95f..0000000 --- a/docs/reference/iterativematrix.html +++ /dev/null @@ -1,210 +0,0 @@ - - - - - - - - -Solve a matrix using iterative methods — iterativematrix • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Solve a matrix using iterative methods.

    - -
    - -
    jacobi(A, b, tol = 1e-06, maxiter = 100)
    -
    -gaussseidel(A, b, tol = 1e-06, maxiter = 100)
    -
    -cgmmatrix(A, b, tol = 1e-06, maxiter = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    A

    a square matrix representing the coefficients of a linear -system

    b

    a vector representing the right-hand side of the linear -system

    tol

    is a number representing the error tolerence

    maxiter

    is the maximum number of iterations

    - -

    Value

    - -

    the solution vector

    - -

    Details

    - -

    jacobi finds the solution using Jacobi iteration. -Jacobi iteration depends on the matrix being diagonally-dominate. -The tolerence is specified the norm of the solution vector.

    -

    gaussseidel finds the solution using Gauss-Seidel iteration. -Gauss-Seidel iteration depends on the matrix being either -diagonally-dominate or symmetric and positive definite.

    -

    cgmmatrix finds the solution using the conjugate gradient -method. The conjugate gradient method depends on the matrix being -symmetric and positive definite.

    - -

    See also

    - - - - -

    Examples

    -
    A <- matrix(c(5, 2, 1, 2, 7, 3, 3, 4, 8), 3) -b <- c(40, 39, 55) -jacobi(A, b)
    #> [1] 4 1 6
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/ivp.html b/docs/reference/ivp.html deleted file mode 100644 index 0602b71..0000000 --- a/docs/reference/ivp.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - -Initial value problems — ivp • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    solve initial value problems for ordinary differential equations

    - -
    - -
    euler(f, x0, y0, h, n)
    -
    -midptivp(f, x0, y0, h, n)
    -
    -rungekutta4(f, x0, y0, h, n)
    -
    -adamsbashforth(f, x0, y0, h, n)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    x0

    the initial value of x

    y0

    the initial value of y

    h

    selected step size

    n

    the number of steps

    - -

    Value

    - -

    a data frame of x and y values

    - -

    Details

    - -

    The euler method implements the Euler method for solving -differential equations. The codemidptivp method solves initial -value problems using the second-order Runge-Kutta method. The -rungekutta4 method is the fourth-order Runge-Kutta method.

    - - -

    Examples

    -
    f <- function(x, y) { y / (2 * x + 1) } -ivp.euler <- euler(f, 0, 1, 1/100, 100) -ivp.midpt <- midptivp(f, 0, 1, 1/100, 100) -ivp.rk4 <- rungekutta4(f, 0, 1, 1/100, 100)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/ivpsys.html b/docs/reference/ivpsys.html deleted file mode 100644 index bc6bc5e..0000000 --- a/docs/reference/ivpsys.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - -Initial value problems for systems of ordinary differential equations — ivpsys • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    solve initial value problems for systems ordinary differential equations

    - -
    - -
    eulersys(f, x0, y0, h, n)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    x0

    the initial value of x

    y0

    the vector initial values of y

    h

    selected step size

    n

    the number of steps

    - -

    Value

    - -

    a data frame of x and y values

    - -

    Details

    - -

    The euler method implements the Euler method for solving -differential equations. The codemidptivp method solves initial -value problems using the second-order Runge-Kutta method. The -rungekutta4 method is the fourth-order Runge-Kutta method.

    - - -

    Examples

    -
    f <- function(x, y) { y / (2 * x + 1) } -ivp.euler <- euler(f, 0, 1, 1/100, 100)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/linterp.html b/docs/reference/linterp.html deleted file mode 100644 index 4a882bf..0000000 --- a/docs/reference/linterp.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - -Linear interpolation — linterp • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Finds a linear function between two points

    - -
    - -
    linterp(x1, y1, x2, y2)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    x1

    x value of the first point

    y1

    y value of the first point

    x2

    x value of the second point

    y2

    y value of the second point

    - -

    Value

    - -

    a linear equation's coefficients

    - -

    Details

    - -

    linterp finds a linear function between two points.

    - -

    See also

    - - - - -

    Examples

    -
    f <- linterp(3, 2, 7, -2)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/lumatrix.html b/docs/reference/lumatrix.html deleted file mode 100644 index 031d662..0000000 --- a/docs/reference/lumatrix.html +++ /dev/null @@ -1,201 +0,0 @@ - - - - - - - - -LU Decomposition — lumatrix • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Decompose a matrix into lower- and upper-triangular matrices

    - -
    - -
    lumatrix(m)
    - -

    Arguments

    - - - - - - -
    m

    a matrix

    - -

    Value

    - -

    list with matrices L and U representing the LU decomposition

    - -

    Details

    - -

    lumatrix decomposes the matrix m into the LU -decomposition, such that m == L

    - -

    See also

    - - - - -

    Examples

    -
    A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -lumatrix(A)
    #> $P -#> [,1] [,2] [,3] -#> [1,] 1 0 0 -#> [2,] 0 1 0 -#> [3,] 0 0 1 -#> -#> $L -#> [,1] [,2] [,3] -#> [1,] 1 0 0 -#> [2,] 2 1 0 -#> [3,] -7 -6 1 -#> -#> $U -#> [,1] [,2] [,3] -#> [1,] 1 -1 2 -#> [2,] 0 1 -3 -#> [3,] 0 0 1 -#>
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/mcint.html b/docs/reference/mcint.html deleted file mode 100644 index a21001d..0000000 --- a/docs/reference/mcint.html +++ /dev/null @@ -1,209 +0,0 @@ - - - - - - - - -Monte Carlo Integration — mcint • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Simple Monte Carlo Integraton

    - -
    - -
    mcint(f, a, b, m = 1000)
    -
    -mcint2(f, xdom, ydom, m = 1000)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the lower-bound of integration

    b

    the upper-bound of integration

    m

    the number of subintervals to calculate

    xdom

    the domain on x of integration in two dimensions

    ydom

    the domain on y of integration in two dimensions

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The mcint function uses a simple Monte Carlo algorithm to -estimate the value of an integral. The parameter n sets the -total number of evaluation points. The parameter max.y is the -maximum expected value of the range of function f. The -mcint2 provides Monte Carlo integration in two dimensions.

    - -

    See also

    - - - - -

    Examples

    -
    f <- function(x) { sin(x)^2 + log(x)} -mcint(f, 0, 1)
    #> [1] -0.7141941
    mcint(f, 0, 1, m = 10e6)
    #> [1] -0.7267529
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/midpt.html b/docs/reference/midpt.html deleted file mode 100644 index f6e5556..0000000 --- a/docs/reference/midpt.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - -rectangle method — midpt • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use the rectangle method to integrate a function

    - -
    - -
    midpt(f, a, b, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the a-bound of integration

    b

    the b-bound of integration

    m

    the number of subintervals to calculate

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The midpt function uses the rectangle method to calculate -the integral of the function f over the interval from -a to b. The parameter m sets the number -of intervals to use when evaluating the rectangles. Additional -options are passed to the function f when evaluating.

    - -

    See also

    - -

    Other integration: adaptint, - gaussint, giniquintile, - mcint, revolution-solid, - romberg, simp38, - simp, trap

    -

    Other newton-cotes: adaptint, - giniquintile, romberg, - simp38, simp, - trap

    - - -

    Examples

    -
    f <- function(x) { sin(x)^2 + cos(x)^2 } -midpt(f, -pi, pi, m = 10)
    #> [1] 6.283185
    midpt(f, -pi, pi, m = 100)
    #> [1] 6.283185
    midpt(f, -pi, pi, m = 1000)
    #> [1] 6.283185
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/newton.html b/docs/reference/newton.html deleted file mode 100644 index e1b08a0..0000000 --- a/docs/reference/newton.html +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - -Newton's method — newton • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use Newton's method to find real roots

    - -
    - -
    newton(f, fp, x, tol = 0.001, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    fp

    function representing the derivative of f

    x

    an initial estimate of the root

    tol

    the error tolerance

    m

    the maximum number of iterations

    - -

    Value

    - -

    the real root found

    - -

    Details

    - -

    Newton's method finds real roots of a function, but requires knowing -the function derivative. It will return when the interval between -them is less than tol, the error tolerance. However, this -implementation also stops after m iterations.

    - -

    See also

    - -

    Other optimz: bisection, - goldsect, gradient, - hillclimbing, sa, - secant

    - - -

    Examples

    -
    f <- function(x) { x^3 - 2 * x^2 - 159 * x - 540 } -fp <- function(x) {3 * x^2 - 4 * x - 159 } -newton(f, fp, 1)
    #> [1] -4
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/nn.html b/docs/reference/nn.html deleted file mode 100644 index ea78e0c..0000000 --- a/docs/reference/nn.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - -Nearest interpolation — nn • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Find the nearest neighbor for a set of data points

    - -
    - -
    nn(p, y, q)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    p

    matrix of variable values, each row is a data point

    y

    vector of values, each entry corresponds to one row in p

    q

    vector of variable values, each entry corresponds to one column of p

    - -

    Value

    - -

    an interpolated value for q

    - -

    Details

    - -

    nn finds the n-dimensional nearest neighbor for given datapoint

    - -

    See also

    - - - - -

    Examples

    -
    p <- matrix(floor(runif(100, 0, 9)), 20) -y <- floor(runif(20, 0, 9)) -q <- matrix(floor(runif(5, 0, 9)), 1) -nn(p, y, q)
    #> [1] 8
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/nthroot.html b/docs/reference/nthroot.html deleted file mode 100644 index 10f1143..0000000 --- a/docs/reference/nthroot.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - - - -The n-th root formula — nthroot • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Find the n-th root of real numbers

    - -
    - -
    nthroot(a, n, tol = 1/1000)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    a

    a positive real number

    n

    n

    tol

    the permitted error tolerance

    - -

    Value

    - -

    the root

    - -

    Details

    - -

    The nthroot function finds the nth root of a via -an iterative process.

    - -

    See also

    - - - - -

    Examples

    -
    nthroot(100, 2)
    #> [1] 10
    nthroot(65536, 4)
    #> [1] 16
    nthroot(1000, 3)
    #> [1] 10
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/polyinterp.html b/docs/reference/polyinterp.html deleted file mode 100644 index c9e5933..0000000 --- a/docs/reference/polyinterp.html +++ /dev/null @@ -1,191 +0,0 @@ - - - - - - - - -Polynomial interpolation — polyinterp • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Finds a polynomial function interpolating the given points

    - -
    - -
    polyinterp(x, y)
    - -

    Arguments

    - - - - - - - - - - -
    x

    a vector of x values

    y

    a vector of y values

    - -

    Value

    - -

    a polynomial equation's coefficients

    - -

    Details

    - -

    polyinterp finds a polynomial that interpolates the given points.

    - -

    See also

    - - - - -

    Examples

    -
    x <- c(1, 2, 3) -y <- x^2 + 5 * x - 3 -f <- polyinterp(x, y)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/pwiselinterp.html b/docs/reference/pwiselinterp.html deleted file mode 100644 index 6cd78b0..0000000 --- a/docs/reference/pwiselinterp.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - -Piecewise linear interpolation — pwiselinterp • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Finds a piecewise linear function that interpolates the data points

    - -
    - -
    pwiselinterp(x, y)
    - -

    Arguments

    - - - - - - - - - - -
    x

    a vector of x values

    y

    a vector of y values

    - -

    Value

    - -

    a matrix with the linear function components

    - -

    Details

    - -

    pwiselinterp finds a piecewise linear function that -interpolates the data points. For each x-y ordered pair, there -function finds the unique line interpolating them. The function will -return a data.frame with three columns.

    -

    The column x is the upper bound of the domain for the given -piece. The columns m and b represent the coefficients -from the y-intercept form of the linear equation, y = mx + b.

    -

    The matrix will contain length(x) rows with the first row having m -and b of NA.

    - -

    See also

    - - - - -

    Examples

    -
    x <- c(5, 0, 3) -y <- c(4, 0, 3) -f <- pwiselinterp(x, y)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/quadratic.html b/docs/reference/quadratic.html deleted file mode 100644 index 475d3b1..0000000 --- a/docs/reference/quadratic.html +++ /dev/null @@ -1,195 +0,0 @@ - - - - - - - - -The quadratic equation. — quadratic • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Find the zeros of a quadratic equation.

    - -
    - -
    quadratic(b2, b1, b0)
    -
    -quadratic2(b2, b1, b0)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    b2

    the coefficient of the x^2 term

    b1

    the coefficient of the x term

    b0

    the constant term

    - -

    Value

    - -

    numeric vector of solutions to the equation

    - -

    Details

    - -

    quadratic and quadratic2 implement the quadratic -equation from standard algebra in two different ways. The -quadratic function is susceptible to cascading numerical error -and the quadratic2 has reduced potential error.

    - -

    See also

    - - - - -

    Examples

    -
    quadratic(1, 0, -1)
    #> [1] -1 1
    quadratic(4, -4, 1)
    #> [1] 0.5 0.5
    quadratic2(1, 0, -1)
    #> [1] -1 1
    quadratic2(4, -4, 1)
    #> [1] 0.5 0.5
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/refmatrix.html b/docs/reference/refmatrix.html deleted file mode 100644 index d1b2840..0000000 --- a/docs/reference/refmatrix.html +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - - - -Matrix to Row Echelon Form — refmatrix • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Transform a matrix to row echelon form.

    - -
    - -
    refmatrix(m)
    -
    -rrefmatrix(m)
    -
    -solvematrix(A, b)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    m

    a matrix

    A

    a square matrix representing the coefficients of a linear -system in solvematrix

    b

    a vector representing the right-hand side of the linear -system in solvematrix

    - -

    Value

    - -

    the modified matrix

    - -

    Details

    - -

    refmatrix reduces a matrix to row echelon form. This is not a -reduced row echelon form, though that can be easily calculated from -the diagonal. This function works on non-square matrices.

    -

    rrefmatrix returns the reduced row echelon matrix.

    -

    solvematrix solves a linear system using rrefmatrix.

    - -

    See also

    - - - - -

    Examples

    -
    A <- matrix(c(1, 2, -7, -1, -1, 1, 2, 1, 5), 3) -refmatrix(A)
    #> [,1] [,2] [,3] -#> [1,] 1 -1 2 -#> [2,] 0 1 -3 -#> [3,] 0 0 1
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/resizeImage.html b/docs/reference/resizeImage.html deleted file mode 100644 index 372b60d..0000000 --- a/docs/reference/resizeImage.html +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - -Image resizing — resizeImage • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Resize images using nearest neighbor and

    - -
    - -
    resizeImageNN(imx, width, height)
    -
    -resizeImageBL(imx, width, height)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    imx

    a 3-dimensional array containing image data

    width

    the new width

    height

    the new height

    - -

    Value

    - -

    a three-dimensional array containing the resized image.

    - -

    Details

    - -

    The resizeImageNN function uses the nearest neighbor method to -resize the image. Also, resizeImageBL uses bilinear -interpolation to resize the image.

    - - -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/revolution-solid.html b/docs/reference/revolution-solid.html deleted file mode 100644 index 6eba339..0000000 --- a/docs/reference/revolution-solid.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - -Volumes of solids of revolution — revolution-solid • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Find the volume of a solid of revolution

    - -
    - -
    shellmethod(f, a, b)
    -
    -discmethod(f, a, b)
    - -

    Arguments

    - - - - - - - - - - - - - - -
    f

    function of revolution

    a

    lower-bound of the solid

    b

    upper-bound of the solid

    - -

    Value

    - -

    the volume of the solid

    - -

    Details

    - -

    The functions discmethod and shellmethod implement the -algorithms for finding the volume of solids of revolution. The -discmethod function is suitable for volumes revolved around -the x-axis and the shellmethod function is suitable for -volumes revolved around the y-axis.

    - -

    See also

    - -

    Other integration: adaptint, - gaussint, giniquintile, - mcint, midpt, - romberg, simp38, - simp, trap

    - - -

    Examples

    -
    f <- function(x) { x^2 } -shellmethod(f, 1, 2)
    #> [1] 23.56242
    discmethod(f, 1, 2)
    #> [1] 19.47751
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/romberg.html b/docs/reference/romberg.html deleted file mode 100644 index 4295c37..0000000 --- a/docs/reference/romberg.html +++ /dev/null @@ -1,207 +0,0 @@ - - - - - - - - -Romberg Integration — romberg • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Romberg's adaptive integration

    - -
    - -
    romberg(f, a, b, m, tab = FALSE)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the lowerbound of integration

    b

    the upperbound of integration

    m

    the maximum number of iterations

    tab

    if TRUE, return the table of values

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The romberg function uses Romberg's rule to calculate the -integral of the function f over the interval from a -to b. The parameter m sets the number of intervals -to use when evaluating. Additional options are passed to the -function f when evaluating.

    - -

    See also

    - -

    Other integration: adaptint, - gaussint, giniquintile, - mcint, midpt, - revolution-solid, simp38, - simp, trap

    -

    Other newton-cotes: adaptint, - giniquintile, midpt, - simp38, simp, - trap

    - - -

    Examples

    -
    f <- function(x) { sin(x)^2 + log(x)} -romberg(f, 1, 10, m = 3)
    #> [1] 18.48497
    romberg(f, 1, 10, m = 5)
    #> [1] 18.52473
    romberg(f, 1, 10, m = 10)
    #> [1] 18.52494
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/rowops.html b/docs/reference/rowops.html deleted file mode 100644 index 497584f..0000000 --- a/docs/reference/rowops.html +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - -Elementary row operations — rowops • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    These are elementary operations for a matrix. They do not presume a -square matrix and will work on any matrix. They use R's internal row -addressing to function.

    - -
    - -
    swaprows(m, row1, row2)
    -
    -replacerow(m, row1, row2, k)
    -
    -scalerow(m, row, k)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    m

    a matrix

    row1

    a source row

    row2

    a destination row

    k

    a scaling factor

    row

    a row to modify

    - -

    Value

    - -

    the modified matrix

    - -

    Details

    - -

    replacerow replaces one row with the sum of itself and the -multiple of another row. swaprows swap two rows in the -matrix. scalerow scales all enteries in a row by a constant.

    - -

    See also

    - - - - -

    Examples

    -
    n <- 5 -A <- matrix(sample.int(10, n^2, TRUE) - 1, n) -A <- swaprows(A, 2, 4) -A <- replacerow(A, 1, 3, 2) -A <- scalerow(A, 5, 10)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/sa.html b/docs/reference/sa.html deleted file mode 100644 index c0a2c30..0000000 --- a/docs/reference/sa.html +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - - - -Simulated annealing — sa • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use simulated annealing to find the global minimum

    - -
    - -
    sa(f, x, temp = 10000, rate = 1e-04)
    -
    -tspsa(x, temp = 100, rate = 1e-04)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function representing f

    x

    an initial estimate of the minimum

    temp

    the initial temperature

    rate

    the cooling rate

    - -

    Value

    - -

    the x value of the minimum found

    - -

    Details

    - -

    Simulated annealing finds a global minimum by mimicing the -metallurgical process of annealing.

    - -

    See also

    - - - - -

    Examples

    -
    f <- function(x) { x^6 - 4 * x^5 - 7 * x^4 + 22 * x^3 + 24 * x^2 + 2} -sa(f, 0)
    #> [1] 3.612758
    -f <- function(x) { (x[1] - 1)^2 + (x[2] - 1)^2 } -sa(f, c(0, 0), 0.05)
    #> [1] 0 0
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/secant.html b/docs/reference/secant.html deleted file mode 100644 index 9968c89..0000000 --- a/docs/reference/secant.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - -Secant Method — secant • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    The secant method for root finding

    - -
    - -
    secant(f, x, tol = 0.001, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    x

    an initial estimate of the root

    tol

    the error tolerance

    m

    the maximum number of iterations

    - -

    Value

    - -

    the real root found

    - -

    Details

    - -

    The secant method for root finding extends Newton's method to -estimate the derivative. It will return when the interval between -them is less than tol, the error tolerance. However, this -implementation also stop if after m iterations.

    - -

    See also

    - -

    Other optimz: bisection, - goldsect, gradient, - hillclimbing, newton, - sa

    - - -

    Examples

    -
    f <- function(x) { x^3 - 2 * x^2 - 159 * x - 540 } -secant(f, 1)
    #> [1] -3.999999
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/simp.html b/docs/reference/simp.html deleted file mode 100644 index f850729..0000000 --- a/docs/reference/simp.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - -Simpson's rule — simp • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use Simpson's rule to integrate a function

    - -
    - -
    simp(f, a, b, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the a-bound of integration

    b

    the b-bound of integration

    m

    the number of subintervals to calculate

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The simp function uses Simpson's rule to calculate the -integral of the function f over the interval from a -to b. The parameter m sets the number of intervals -to use when evaluating. Additional options are passed to the -function f when evaluating.

    - -

    See also

    - -

    Other integration: adaptint, - gaussint, giniquintile, - mcint, midpt, - revolution-solid, romberg, - simp38, trap

    -

    Other newton-cotes: adaptint, - giniquintile, midpt, - romberg, simp38, - trap

    - - -

    Examples

    -
    f <- function(x) { sin(x)^2 + cos(x)^2 } -simp(f, -pi, pi, m = 10)
    #> [1] 6.283185
    simp(f, -pi, pi, m = 100)
    #> [1] 6.283185
    simp(f, -pi, pi, m = 1000)
    #> [1] 6.283185
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/simp38.html b/docs/reference/simp38.html deleted file mode 100644 index 9703463..0000000 --- a/docs/reference/simp38.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - -Simpson's 3/8 rule — simp38 • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use Simpson's 3/8 rule to integrate a function

    - -
    - -
    simp38(f, a, b, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the a-bound of integration

    b

    the b-bound of integration

    m

    the number of subintervals to calculate

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The simp38 function uses Simpson's 3/8 rule to calculate the -integral of the function f over the interval from a -to b. The parameter m sets the number of intervals -to use when evaluating. Additional options are passed to the -function f when evaluating.

    - -

    See also

    - -

    Other integration: adaptint, - gaussint, giniquintile, - mcint, midpt, - revolution-solid, romberg, - simp, trap

    -

    Other newton-cotes: adaptint, - giniquintile, midpt, - romberg, simp, - trap

    - - -

    Examples

    -
    f <- function(x) { sin(x)^2 + log(x) } -simp38(f, 1, 10, m = 10)
    #> [1] 18.52477
    simp38(f, 1, 10, m = 100)
    #> [1] 18.52494
    simp38(f, 1, 10, m = 1000)
    #> [1] 18.52494
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/summation.html b/docs/reference/summation.html deleted file mode 100644 index cb3bd94..0000000 --- a/docs/reference/summation.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - - - - -Two summing algorithms — summation • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Find the sum of a vector

    - -
    - -
    naivesum(x)
    -
    -kahansum(x)
    -
    -pwisesum(x)
    - -

    Arguments

    - - - - - - -
    x

    a vector of numbers to be summed

    - -

    Value

    - -

    the sum

    - -

    Details

    - -

    naivesum calculates the sum of a vector by keeping a counter -and repeatedly adding the next value to the interim sum. -kahansum uses Kahan's algorithm to capture the low-order -precision loss and ensure that the loss is reintegrated into the -final sum. pwisesum is a recursive implementation of the -piecewise summation algorithm that divides the vector in two and adds -the individual vector sums for a result.

    - - -

    Examples

    -
    k <- 1:10^6 -n <- sample(k, 1) -bound <- sample(k, 2) -bound.upper <- max(bound) - 10^6 / 2 -bound.lower <- min(bound) - 10^6 / 2 -x <- runif(n, bound.lower, bound.upper) -naivesum(x)
    #> [1] 102354494310
    kahansum(x)
    #> [1] 102354494310
    pwisesum(x)
    #> [1] 102354494310
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/trap.html b/docs/reference/trap.html deleted file mode 100644 index 06155c0..0000000 --- a/docs/reference/trap.html +++ /dev/null @@ -1,203 +0,0 @@ - - - - - - - - -Trapezoid method — trap • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Use the trapezoid method to integrate a function

    - -
    - -
    trap(f, a, b, m = 100)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    f

    function to integrate

    a

    the a-bound of integration

    b

    the b-bound of integration

    m

    the number of subintervals to calculate

    - -

    Value

    - -

    the value of the integral

    - -

    Details

    - -

    The trap function uses the trapezoid method to calculate -the integral of the function f over the interval from -a to b. The parameter m sets the -number of intervals to use when evaluating the trapezoids. Additional -options are passed to the function f when evaluating.

    - -

    See also

    - -

    Other integration: adaptint, - gaussint, giniquintile, - mcint, midpt, - revolution-solid, romberg, - simp38, simp

    -

    Other newton-cotes: adaptint, - giniquintile, midpt, - romberg, simp38, - simp

    - - -

    Examples

    -
    f <- function(x) { sin(x)^2 + cos(x)^2 } -trap(f, -pi, pi, m = 10)
    #> [1] 6.283185
    trap(f, -pi, pi, m = 100)
    #> [1] 6.283185
    trap(f, -pi, pi, m = 1000)
    #> [1] 6.283185
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/tridiagmatrix.html b/docs/reference/tridiagmatrix.html deleted file mode 100644 index 2e729f4..0000000 --- a/docs/reference/tridiagmatrix.html +++ /dev/null @@ -1,190 +0,0 @@ - - - - - - - - -Solve a tridiagonal matrix — tridiagmatrix • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    use the tridiagonal matrix algorithm to solve a tridiagonal matrix

    - -
    - -
    tridiagmatrix(L, D, U, b)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - -
    L

    vector of entries below the main diagonal

    D

    vector of entries on the main diagonal

    U

    vector of entries above the main diagonal

    b

    vector of the right-hand side of the linear system

    - -

    Value

    - -

    the solution vector

    - -

    Details

    - -

    tridiagmatrix uses the tridiagonal matrix algorithm to solve a -tridiagonal matrix.

    - -

    See also

    - - - - -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/vecnorm.html b/docs/reference/vecnorm.html deleted file mode 100644 index ea110df..0000000 --- a/docs/reference/vecnorm.html +++ /dev/null @@ -1,183 +0,0 @@ - - - - - - - - -Norm of a vector — vecnorm • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Find the norm of a vector

    - -
    - -
    vecnorm(b)
    - -

    Arguments

    - - - - - - -
    b

    a vector

    - -

    Value

    - -

    the norm

    - -

    Details

    - -

    Find the norm of a vector

    - -

    See also

    - - - - -

    Examples

    -
    x <- c(1, 2, 3) -vecnorm(x)
    #> [1] 3.741657
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/wave.html b/docs/reference/wave.html deleted file mode 100644 index 8a20e06..0000000 --- a/docs/reference/wave.html +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - -Wave Equation using — wave • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    solve heat equation via forward-time central-space method

    - -
    - -
    wave(u, alpha, xdelta, tdelta, n)
    - -

    Arguments

    - - - - - - - - - - - - - - - - - - - - - - -
    u

    the initial values of u

    alpha

    the thermal diffusivity coefficient

    xdelta

    the change in x at each step in u

    tdelta

    the time step

    n

    the number of steps to take

    - -

    Value

    - -

    a matrix of u values at each time step

    - -

    Details

    - -

    The heat solves the heat equation using the forward-time -central-space method in one-dimension.

    - - -

    Examples

    -
    speed <- 2 -x0 <- 0 -xdelta <- .05 -x <- seq(x0, 1, xdelta) -m <- length(x) -u <- sin(x * pi * 2) -u[11:21] <- 0 -tdelta <- .02 -n <- 40 -z <- wave(u, speed, xdelta, tdelta, n)
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/reference/wilkinson.html b/docs/reference/wilkinson.html deleted file mode 100644 index 692d4a7..0000000 --- a/docs/reference/wilkinson.html +++ /dev/null @@ -1,181 +0,0 @@ - - - - - - - - -Wilkinson's Polynomial — wilkinson • cmna - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    -
    - - - -
    - -
    -
    - - -
    - -

    Wilkinson's polynomial

    - -
    - -
    wilkinson(x, w = 20)
    - -

    Arguments

    - - - - - - - - - - -
    x

    the x-value

    w

    the number of terms in the polynomial

    - -

    Value

    - -

    the value of the function at x

    - -

    Details

    - -

    Wilkinson's polynomail is a terrible joke played on numerical -analysis. By tradition, the function is f(x) = (x - 1)(x - 2)...(x - -20), giving a function with real roots at each integer from 1 to 20. -This function is generalized and allows for n and the function -value is f(x) = (x - 1)(x - 2)...(x - n). The default of n is -20.

    - - -

    Examples

    -
    wilkinson(0)
    #> [1] 2.432902e+18
    -
    -
    - -
    - -
    - - -
    -

    Site built with pkgdown 1.3.0.

    -
    -
    -
    - - - - - - diff --git a/docs/sitemap.xml b/docs/sitemap.xml deleted file mode 100644 index 36dfb58..0000000 --- a/docs/sitemap.xml +++ /dev/null @@ -1,159 +0,0 @@ - - - - https://howardjp.github.io/cmna//index.html - - - https://howardjp.github.io/cmna//reference/adaptint.html - - - https://howardjp.github.io/cmna//reference/bezier.html - - - https://howardjp.github.io/cmna//reference/bilinear.html - - - https://howardjp.github.io/cmna//reference/bisection.html - - - https://howardjp.github.io/cmna//reference/bvp.html - - - https://howardjp.github.io/cmna//reference/choleskymatrix.html - - - https://howardjp.github.io/cmna//reference/cmna-package.html - - - https://howardjp.github.io/cmna//reference/cubicspline.html - - - https://howardjp.github.io/cmna//reference/detmatrix.html - - - https://howardjp.github.io/cmna//reference/division.html - - - https://howardjp.github.io/cmna//reference/fibonacci.html - - - https://howardjp.github.io/cmna//reference/findiff.html - - - https://howardjp.github.io/cmna//reference/gaussint.html - - - https://howardjp.github.io/cmna//reference/gdls.html - - - https://howardjp.github.io/cmna//reference/giniquintile.html - - - https://howardjp.github.io/cmna//reference/goldsect.html - - - https://howardjp.github.io/cmna//reference/gradient.html - - - https://howardjp.github.io/cmna//reference/heat.html - - - https://howardjp.github.io/cmna//reference/hillclimbing.html - - - https://howardjp.github.io/cmna//reference/himmelblau.html - - - https://howardjp.github.io/cmna//reference/horner.html - - - https://howardjp.github.io/cmna//reference/invmatrix.html - - - https://howardjp.github.io/cmna//reference/isPrime.html - - - https://howardjp.github.io/cmna//reference/iterativematrix.html - - - https://howardjp.github.io/cmna//reference/ivp.html - - - https://howardjp.github.io/cmna//reference/ivpsys.html - - - https://howardjp.github.io/cmna//reference/linterp.html - - - https://howardjp.github.io/cmna//reference/lumatrix.html - - - https://howardjp.github.io/cmna//reference/mcint.html - - - https://howardjp.github.io/cmna//reference/midpt.html - - - https://howardjp.github.io/cmna//reference/newton.html - - - https://howardjp.github.io/cmna//reference/nn.html - - - https://howardjp.github.io/cmna//reference/nthroot.html - - - https://howardjp.github.io/cmna//reference/polyinterp.html - - - https://howardjp.github.io/cmna//reference/pwiselinterp.html - - - https://howardjp.github.io/cmna//reference/quadratic.html - - - https://howardjp.github.io/cmna//reference/refmatrix.html - - - https://howardjp.github.io/cmna//reference/resizeImage.html - - - https://howardjp.github.io/cmna//reference/revolution-solid.html - - - https://howardjp.github.io/cmna//reference/romberg.html - - - https://howardjp.github.io/cmna//reference/rowops.html - - - https://howardjp.github.io/cmna//reference/sa.html - - - https://howardjp.github.io/cmna//reference/secant.html - - - https://howardjp.github.io/cmna//reference/simp.html - - - https://howardjp.github.io/cmna//reference/simp38.html - - - https://howardjp.github.io/cmna//reference/summation.html - - - https://howardjp.github.io/cmna//reference/trap.html - - - https://howardjp.github.io/cmna//reference/tridiagmatrix.html - - - https://howardjp.github.io/cmna//reference/vecnorm.html - - - https://howardjp.github.io/cmna//reference/wave.html - - - https://howardjp.github.io/cmna//reference/wilkinson.html - - From 72ac92245beac53fe6f2831864192726296799af Mon Sep 17 00:00:00 2001 From: "James P. Howard, II" Date: Mon, 6 Jul 2020 18:58:59 -0400 Subject: [PATCH 11/11] Up the version and add roxygen dep --- DESCRIPTION | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 596d0b7..2ac9621 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Package: cmna Type: Package Title: Computational Methods for Numerical Analysis -Version: 1.0.2 -Date: 2019-07-23 +Version: 1.0.3 +Date: 2020-07-05 Encoding: UTF-8 Authors@R: person(given = "James", family = "Howard", email = "jh@jameshoward.us", role = c("aut", "cre"), @@ -18,6 +18,6 @@ LazyLoad: no Suggests: testthat, devtools, - markdown -RoxygenNote: 6.1.1 + markdown, + roxygen2 Depends: R (>= 2.10)