Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: gtfsrouter
Title: Routing with 'GTFS' (General Transit Feed Specification) Data
Version: 0.1.4.003
Version: 0.1.4.005
Authors@R: c(
person("Mark", "Padgham", , "mark.padgham@email.com", role = c("aut", "cre")),
person("Marcin", "Stepniak", , "marcinstepniak@ucm.es", role = "aut",
Expand Down
2 changes: 1 addition & 1 deletion codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"codeRepository": "https://github.com/UrbanAnalyst/gtfsrouter",
"issueTracker": "https://github.com/UrbanAnalyst/gtfsrouter/issues",
"license": "https://spdx.org/licenses/GPL-3.0",
"version": "0.1.4.003",
"version": "0.1.4.005",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down
13 changes: 9 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
LFILE = README
VIGNETTE = gtfsrouter


all: help

doc: ## Update package documentation with `roxygen2`
Expand All @@ -22,13 +21,19 @@ knith: $(LFILE).Rmd ## Render README as HTML
knitr: $(LFILE).Rmd ## Render README as markdown
echo "rmarkdown::render('$(LFILE).Rmd',output_file='$(LFILE).md')" | R --no-save -q

open: ## Open main HTML vignette in browser
xdg-open docs/articles/$(VIGNETTE).html &

allcontribs: ## Update allcontributors in README
Rscript -e "allcontributors::add_contributors ()"

open: ## Open main HTML vignette in browser
xdg-open docs/articles/$(VIGNETTE).html &
check: ## Run `rcmdcheck`
Rscript -e 'rcmdcheck::rcmdcheck()'

test: ## Run test suite
Rscript -e 'testthat::test_local()'

check: ## Run pkgcheck
pkgcheck: ## Run `pkgcheck` and print results to screen.
Rscript -e 'library(pkgcheck); checks <- pkgcheck(); print(checks); summary (checks)'

clean: ## Clean all junk files, including all pkgdown docs
Expand Down
9 changes: 8 additions & 1 deletion src/csa.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ CSA_Return csa::main_csa_loop (
csa_ret.earliest_time = INFINITE_INT;
csa_ret.end_station = INFINITE_INT;

std::vector <bool> is_connected (csa_pars.ntrips, false);
std::vector <bool> is_connected (csa_pars.ntrips + 1L, false);

// trip connections:
for (size_t i = 0; i < csa_pars.timetable_size; i++)
Expand All @@ -200,6 +200,13 @@ CSA_Return csa::main_csa_loop (
csa_in.arrival_station [i], i);
}

if (csa_in.departure_station [i] < 0 || csa_in.departure_station [i] >= csa_out.earliest_connection.size ()) {
Rcpp::stop ("Departure station in wrong range.");
}
if (csa_in.trip_id [i] < 0 || csa_in.trip_id [i] >= is_connected.size ()) {
Rcpp::stop ("Trip id in wrong range.");
}

// main connection scan:
if (((csa_out.earliest_connection [csa_in.departure_station [i] ] <= csa_in.departure_time [i]) &&
csa_out.n_transfers [csa_in.departure_station [i] ] <= csa_pars.max_transfers) ||
Expand Down
Loading