Skip to content

Commit

Permalink
fixes for R 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pkharchenko committed Jun 2, 2016
1 parent 7e7e79e commit 2c93f5e
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: spp
Type: Package
Title: some description
Version: 1.13
Date: 2015-08-21
Version: 1.14
Date: 2016-06-02
Author: Peter K
Depends: caTools
Imports: Rsamtools
Expand Down
4 changes: 2 additions & 2 deletions src/bed2vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#endif

extern "C" {
#include "R.h"
#include "Rmath.h"
//#include "R.h"
//#include "Rmath.h"
#include "Rinternals.h"
#include "Rdefines.h"
// for getline
Expand Down
4 changes: 2 additions & 2 deletions src/maqread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
#include <zlib.h>

extern "C" {
#include "R.h"
#include "Rmath.h"
//#include "R.h"
//#include "Rmath.h"
#include "Rinternals.h"
#include "Rdefines.h"
#include "maqmap.h"
Expand Down
20 changes: 11 additions & 9 deletions src/peaks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#include <iostream>
#include <string>
#include <set>
#include <cmath>
#include <cstdlib>

extern "C" {
#include "R.h"
#include "Rmath.h"
//#include "R.h"
//#include "Rmath.h"
#include "Rinternals.h"
#include "Rdefines.h"
}
Expand Down Expand Up @@ -108,14 +110,14 @@ extern "C" {

for(int i=0;i<nd;i++) {
// increment k until pos[k]+size>=d[i]
while((abs(pos[k])+size) < d[i]) { k++; if(k==npos) { break; };
while((std::abs(pos[k])+size) < d[i]) { k++; if(k==npos) { break; };
#ifdef DEBUG
Rprintf("advancing k to %d\n",k);
#endif
}
if(k==npos) { break; };
// increment i until d[i]>=pos[k]-size
while((abs(pos[k])-size) > d[i]) { i++; if(i==nd) { break; }
while((std::abs(pos[k])-size) > d[i]) { i++; if(i==nd) { break; }
#ifdef DEBUG
Rprintf("advancing i to %d\n",i);
#endif
Expand All @@ -124,14 +126,14 @@ extern "C" {


int l=k;
while((l<npos) && ((abs(pos[l])-size) <= d[i])) { l++;
while((l<npos) && ((std::abs(pos[l])-size) <= d[i])) { l++;
#ifdef DEBUG
Rprintf("advancing l to %d\n",l);
#endif
}
for(int j=k;j<l;j++) {
int pd=d[i]-abs(pos[j]);
if(abs(pd)<=size) {
int pd=d[i]-std::abs(pos[j]);
if(std::abs(pd)<=size) {
// record
if(pos[j]>0) {
x.push_back(pd);
Expand Down Expand Up @@ -698,9 +700,9 @@ extern "C" {
// update flags
int f=flags[i];
if(f>0) {
s[abs(f)-1]++;
s[std::abs(f)-1]++;
} else {
s[abs(f)-1]--;
s[std::abs(f)-1]--;
}

if(max_val!=0 && val[i]*max_val > mval*max_val) { mval=val[i]; }
Expand Down
6 changes: 4 additions & 2 deletions src/wdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
#include <iostream>
#include <string>
#include <set>
#include <cmath>
#include <cstdlib>

extern "C" {
#include "R.h"
#include "Rmath.h"
//#include "R.h"
//#include "Rmath.h"
#include "Rinternals.h"
#include "Rdefines.h"
}
Expand Down

0 comments on commit 2c93f5e

Please sign in to comment.