Skip to content

Commit

Permalink
fix for mpx sanitizer
Browse files Browse the repository at this point in the history
  • Loading branch information
franzbischoff committed Mar 11, 2020
1 parent e1bcbb2 commit c0b96ff
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ URL: https://github.com/matrix-profile-foundation/tsmp
BugReports:
https://github.com/matrix-profile-foundation/tsmp/issues
Depends:
R (>= 3.2)
R (>= 3.0)
Imports:
audio,
checkmate,
Expand Down
9 changes: 8 additions & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ mbm_stamp_par <- round(median(microbenchmark::microbenchmark(tsmp(data, window_s
```{r bench_dataset, echo = FALSE, message=FALSE, warnings=FALSE}
bench_data <- data.frame("Elapsed Time(s)" = c(mbm_stamp, mbm_stamp_par, mbm_stomp, mbm_stomp_par, mbm_scrimp, mbm_mpx, mbm_mpx_par), "Data Size" = data_size, "Window Size" = w, Threads = c(1, workers, 1, workers, 1, 1, workers), Lang = c("R", "R", "R", "R", "R", "Rcpp", "Rcpp"), row.names = c("`stamp`", "`stamp_par`", "`stomp`", "`stomp_par`", "`scrimp`", "`mpx`", "`mpx_par`"), check.names = FALSE)
knitr::kable(bench_data[order(bench_data$`Elapsed Time(s)`),])
knitr::kable(bench_data[order(bench_data$`Elapsed Time(s)`), ])
```

## Installation
Expand Down Expand Up @@ -165,6 +165,13 @@ Our next step unifying the Matrix Profile implementation in several programming

Visit: [Matrix Profile Foundation](https://matrixprofile.org)

## Package dependencies

```{r dependency_plot, echo = FALSE, fig.width = 10, fig.height = 5, message = FALSE, warning = FALSE, fig.path = "man/figures/"}
source("https://gist.githubusercontent.com/franzbischoff/3b83243dfdfa73e459935112f3f783e3/raw/239548243f984843b3a87d8cc82f99395a8ed26e/plot_dependencies.R")
plot_dependencies()
```

## Code of Conduct

Please note that the 'tsmp' project is released with a
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
README
================
Francisco Bischoff
\- 03 Mar 2020
\- 06 Mar 2020

<!-- README.md is generated from README.Rmd. Please edit that file -->

Expand Down Expand Up @@ -154,6 +154,10 @@ programming languages.

Visit: [Matrix Profile Foundation](https://matrixprofile.org)

## Package dependencies

![](man/figures/dependency_plot-1.png)<!-- -->

## Code of Conduct

Please note that the ‘tsmp’ project is released with a [Contributor Code
Expand Down
Binary file added man/figures/dependency_plot-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/mpx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ List mpx_rcpp(NumericVector a, uint16_t w, uint16_t minlag, bool idxs = false, b
IntegerVector seq_diag = Range(minlag, profile_len - 1);

NumericVector mmp(profile_len, -1.0);
IntegerVector mmpi(profile_len, R_NaN);
IntegerVector mmpi(profile_len, R_NaN); // TODO: SANITIZE?

double *mp = &mmp[0];
int *mpi = &mmpi[0];
Expand Down Expand Up @@ -152,7 +152,7 @@ List mpxab_rcpp(NumericVector a, NumericVector b, uint16_t w, bool idxs = false,
ddg_a.push_front(0);
NumericVector ddf_b = 0.5 * (b[Range(w, b_len - 1)] - b[Range(0, b_len - w - 1)]);
ddf_b.push_front(0);
NumericVector ddg_b = (b[Range(w, a_len - 1)] - mmu_b[Range(1, profile_len_b - 1)]) + (b[Range(0, b_len - w - 1)] - mmu_b[Range(0, b_len - w - 1)]);
NumericVector ddg_b = (b[Range(w, b_len - 1)] - mmu_b[Range(1, profile_len_b - 1)]) + (b[Range(0, b_len - w - 1)] - mmu_b[Range(0, b_len - w - 1)]);
ddg_b.push_front(0);

double *df_a = &ddf_a[0];
Expand Down Expand Up @@ -523,7 +523,7 @@ List mpxab_rcpp_parallel(NumericVector a, NumericVector b, uint16_t w, bool idxs
dg_a.push_front(0);
NumericVector df_b = 0.5 * (b[Range(w, b_len - 1)] - b[Range(0, b_len - w - 1)]);
df_b.push_front(0);
NumericVector dg_b = (b[Range(w, a_len - 1)] - mu_b[Range(1, profile_len_b - 1)]) + (b[Range(0, b_len - w - 1)] - mu_b[Range(0, b_len - w - 1)]);
NumericVector dg_b = (b[Range(w, b_len - 1)] - mu_b[Range(1, profile_len_b - 1)]) + (b[Range(0, b_len - w - 1)] - mu_b[Range(0, b_len - w - 1)]);
dg_b.push_front(0);

NumericVector ww_a = (a[Range(0, w - 1)] - mu_a[0]);
Expand Down

0 comments on commit c0b96ff

Please sign in to comment.