Skip to content

Commit

Permalink
Merge pull request #4 from mailund/release-0.1.0
Browse files Browse the repository at this point in the history
Release 0.1.0
  • Loading branch information
mailund authored Mar 28, 2018
2 parents 8eb5eb4 + b6bb688 commit caaa934
Show file tree
Hide file tree
Showing 35 changed files with 2,715 additions and 18 deletions.
Binary file modified .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
^cleanup\.R$
^experiments\.R$
^.imdone$
^cran-comments\.md$
^docs$
10 changes: 6 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
Package: dynprog
Version: 0.0.0.9000
Title: Dynamic Programming DSL
Description: A domain-specific langauge for specifying dynamic-programming
algorithms.
Version: 0.1.0
Title: Dynamic Programming Domain-Specific Language
Description: A domain-specific language for specifying translating recursions
into dynamic-programming algorithms. See
<https://en.wikipedia.org/wiki/Dynamic_programming> for a description
of dynamic programming.
Authors@R: person("Thomas", "Mailund",
email = "[email protected]",
role = c("aut", "cre"))
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# dynprog 0.0.0.9000
# dynprog 0.1.0

* Initial package setup.
* Initial release.

27 changes: 27 additions & 0 deletions R/dsl.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,33 @@
#' compute values over.
#'
#' @return A filled out dynamic programming table.
#' @examples
#'
#' # Fibonnaci numbers
#' fib <- {
#' F[n] <- 1 ? n <= 2
#' F[n] <- F[n-1] + F[n-2]
#' } %where% {
#' n <- 1:10
#' }
#' fib
#'
#' # Edit distance
#' x <- c("a", "b", "c")
#' y <- c("a", "b", "b", "c")
#' edit <- {
#' E[1,j] <- j - 1
#' E[i,1] <- i - 1
#' E[i,j] <- min(
#' E[i - 1,j] + 1,
#' E[i,j - 1] + 1,
#' E[i - 1,j - 1] + (x[i - 1] != y[j - 1])
#' )
#' } %where% {
#' i <- 1:(length(x) + 1)
#' j <- 1:(length(y) + 1)
#' }
#' edit
#'
#' @export
`%where%` <- function(recursion, ranges) {
Expand Down
4 changes: 2 additions & 2 deletions R/evaluate.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ make_pattern_tests <- function(patterns, range_vars) {
#' @param patterns The patterns specifications
#' @param conditions The conditions specifications
#' @param recursions The recursions specification
#' @return A list of calls, one per recurision, for testing conditions.
#' @return A list of calls, one per recursion, for testing conditions.
make_condition_checks <- function(ranges,
patterns,
conditions,
Expand Down Expand Up @@ -129,7 +129,7 @@ make_update_expr <- function(ranges,
#' evaluate the dynprog expression, returning a filled out dynamic programming
#' table.
#'
#' @param ranges The ranges specificatoin
#' @param ranges The ranges specification
#' @param recursions The recursions specification
#' @return The filled out dynamic programming table
eval_recursion <- function(ranges, recursions) {
Expand Down
2 changes: 1 addition & 1 deletion R/parser.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ parse_ranges <- function(ranges) {
#' The parser return a list with the following components:
#' - **recursion_env:** The environment in which expressions should be
#' evaluated.
#' - **partterns:** A list of patterns, one per recursion case.
#' - **patterns:** A list of patterns, one per recursion case.
#' - **conditions:** A list of conditions, one per recursion case.
#' - **recursions:** A list of expressions, one per recursion case.
#'
Expand Down
4 changes: 1 addition & 3 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,11 @@ library(dynprog)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![lifecycle](http://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Last-changedate](https://img.shields.io/badge/last%20change-`r gsub('-', '--', Sys.Date())`-orange.svg)](/commits/master)
[![packageversion](https://img.shields.io/badge/Package%20version-0.0.0.9000-orange.svg?style=flat-square)](commits/master)

[![packageversion](https://img.shields.io/badge/Package%20version-0.1.0-orange.svg?style=flat-square)](commits/master)
[![Travis build status](https://travis-ci.org/mailund/dynprog.svg?branch=master)](https://travis-ci.org/mailund/dynprog)
[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/mailund/dynprog?branch=master&svg=true)](https://ci.appveyor.com/project/mailund/dynprog)
[![Coverage status](https://codecov.io/gh/mailund/dynprog/branch/master/graph/badge.svg)](https://codecov.io/github/mailund/dynprog?branch=master)
[![Coverage status](http://coveralls.io/repos/github/mailund/dynprog/badge.svg?branch=master)](https://coveralls.io/github/mailund/dynprog?branch=master)

[![CRAN status](http://www.r-pkg.org/badges/version/dynprog)](https://cran.r-project.org/package=dynprog)
[![CRAN downloads](http://cranlogs.r-pkg.org/badges/grand-total/dynprog)](https://cran.r-project.org/package=dynprog)
[![minimal R version](https://img.shields.io/badge/R-%E2%89%A53.1-blue.svg)](https://cran.r-project.org/)
Expand Down
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ state and is being actively
developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)
[![lifecycle](http://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![Last-changedate](https://img.shields.io/badge/last%20change-2018--03--24-orange.svg)](/commits/master)
[![packageversion](https://img.shields.io/badge/Package%20version-0.0.0.9000-orange.svg?style=flat-square)](commits/master)

[![packageversion](https://img.shields.io/badge/Package%20version-0.1.0-orange.svg?style=flat-square)](commits/master)
[![Travis build
status](https://travis-ci.org/mailund/dynprog.svg?branch=master)](https://travis-ci.org/mailund/dynprog)
[![AppVeyor build
Expand All @@ -19,7 +18,6 @@ status](https://ci.appveyor.com/api/projects/status/github/mailund/dynprog?branc
status](https://codecov.io/gh/mailund/dynprog/branch/master/graph/badge.svg)](https://codecov.io/github/mailund/dynprog?branch=master)
[![Coverage
status](http://coveralls.io/repos/github/mailund/dynprog/badge.svg?branch=master)](https://coveralls.io/github/mailund/dynprog?branch=master)

[![CRAN
status](http://www.r-pkg.org/badges/version/dynprog)](https://cran.r-project.org/package=dynprog)
[![CRAN
Expand Down
34 changes: 34 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# dynprog: Domain-specific langauge for specifying dynamic programming algorithms.

Implements a small domain-specific language that translates recursions into
dynamic programming computations.

This is a resubmission with changes based on email. I have:

- Added examples so "checking examples" should not show NONE.
- %where% is the only exported function, so the examples are there
- I have added a reference to Dynamic Programming on Wikipedia
(it is a common algorithmic technique, so there is no obvious
paper to quote; the paper introducing it is dated compared to
modern algorithmic textbooks).

## Test environments
* local OS X install, R 3.4.4
* ubuntu 14.04 (on travis-ci), R 3.4.4
* win-builder (devel and release)
* RHub:

- Fedora Linux, R-devel, clang, gfortran
- Ubuntu Linux 16.04 LTS, R-release, GCC
- Windows Server 2008 R2 SP1, R-devel, 32/64 bit

On RHub on Windows a warning that Pandoc cannot
find the badges images (which Pandoc always complain about on Windows).

Other than that, the package checks.

## R CMD check results

0 errors | 0 warnings | 1 note

* This is a new release.
140 changes: 140 additions & 0 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit caaa934

Please sign in to comment.