Skip to content

Commit

Permalink
minor modifications for compilation under windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mblum committed Jul 24, 2013
1 parent 228e997 commit 80cf2f3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions include/gp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#ifndef __GP_H__
#define __GP_H__

#define _USE_MATH_DEFINES
#include <cmath>
#include <Eigen/Dense>

#include "cov.h"
Expand Down
15 changes: 12 additions & 3 deletions include/gp_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
#ifndef __GP_UTILS_H__
#define __GP_UTILS_H__

#include <stdlib.h>
#include <cstdlib>
#include <cmath>
#include <assert.h>
#include <stdint.h>
#include <cassert>
#include <tr1/cstdint>

namespace libgp {

Expand Down Expand Up @@ -46,6 +46,15 @@ namespace libgp {
/** Sign function.
*/
static double sign(double x);

// drand48() is not aviable under win
#if defined(WIN32) || defined(WIN64)
inline double drand48()
{
return (rand() / (RAND_MAX + 1.0));
}
#endif

};
}

Expand Down
1 change: 1 addition & 0 deletions src/gp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include <sstream>
#include <cmath>
#include <iomanip>
#include <ctime>

namespace libgp {

Expand Down

0 comments on commit 80cf2f3

Please sign in to comment.