Skip to content

Commit

Permalink
Changes a C++ exit to Rcpp:stop
Browse files Browse the repository at this point in the history
  • Loading branch information
jkrijthe committed Sep 30, 2018
1 parent 9c95888 commit f2edaf0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tsne.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ void TSNE<NDims>::zeroMean(double* X, int N, int D) {

// Compute data mean
double* mean = (double*) calloc(D, sizeof(double));
if(mean == NULL) { printf("Memory allocation failed!\n"); exit(1); }
if(mean == NULL) { Rcpp::stop("Memory allocation failed!\n"); }
int nD = 0;
for(int n = 0; n < N; n++) {
for(int d = 0; d < D; d++) {
Expand Down

0 comments on commit f2edaf0

Please sign in to comment.