Skip to content

Commit a46fc72

Browse files
committed
cmake: Fix include path and get tests working again.
Signed-off-by: Matthew Emmett <[email protected]>
1 parent 0892bf1 commit a46fc72

File tree

5 files changed

+16
-8
lines changed

5 files changed

+16
-8
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ add_subdirectory(3rdparty)
7070

7171
message(STATUS "********************************************************************************")
7272
message(STATUS "Configuring sources")
73-
add_subdirectory(src)
73+
add_subdirectory(include)
7474

7575
if(pfasst_BUILD_EXAMPLES)
7676
message(STATUS "********************************************************************************")

examples/ad/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class FFT {
7676
complex<double>* forward(const dvector& x)
7777
{
7878
workspace *wk = get_workspace(x.size());
79-
for (int i=0; i<x.size(); i++)
79+
for (unsigned int i=0; i<x.size(); i++)
8080
wk->z[i] = x[i];
8181
fftw_execute_dft(wk->ffft, wk->wk, wk->wk);
8282
return wk->z;
@@ -86,7 +86,7 @@ class FFT {
8686
{
8787
workspace *wk = get_workspace(x.size());
8888
fftw_execute_dft(wk->ifft, wk->wk, wk->wk);
89-
for (int i=0; i<x.size(); i++)
89+
for (unsigned int i=0; i<x.size(); i++)
9090
x[i] = real(wk->z[i]);
9191
}
9292

include/pfasst.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
#ifndef _PFASST_HPP_
2+
#define _PFASST_HPP_
3+
14
#include "pfasst/interfaces.hpp"
25
#include "pfasst/sdc.hpp"
36
#include "pfasst/mlsdc.hpp"
47
#include "pfasst/pfasst.hpp"
8+
9+
#endif

include/pfasst/quadrature.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@
1010

1111
#include <boost/numeric/ublas/matrix.hpp>
1212

13-
using boost::numeric::ublas::matrix;
13+
using std::complex;
14+
using std::string;
1415
using std::vector;
1516

17+
using boost::numeric::ublas::matrix;
18+
1619
namespace pfasst {
1720

1821
typedef unsigned int uint;
@@ -91,15 +94,15 @@ namespace pfasst {
9194
coeffT acc = 0.0;
9295
for (int j=0; j<n; j++)
9396
acc += abs(z0[j] - z1[j]);
94-
if (acc < 2*numeric_limits<coeffT>::epsilon())
97+
if (acc < 2*std::numeric_limits<coeffT>::epsilon())
9598
break;
9699

97100
z1 = z0;
98101
}
99102

100103
vector<coeffT> roots(n);
101104
for (int j=0; j<n; j++)
102-
roots[j] = abs(z0[j]) < 4*numeric_limits<coeffT>::epsilon() ? 0.0 : real(z0[j]);
105+
roots[j] = abs(z0[j]) < 4*std::numeric_limits<coeffT>::epsilon() ? 0.0 : real(z0[j]);
103106

104107
sort(roots.begin(), roots.end());
105108
return roots;

tests/test-quadrature.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <gtest/gtest.h>
99
#include <gmock/gmock.h>
1010

11-
#include <pfasst-quadrature.hpp>
11+
#include <pfasst/quadrature.hpp>
1212

1313
using namespace std;
1414

@@ -136,7 +136,7 @@ TEST(QuadratureTest, GaussLobattoNodes) {
136136
0.33333333333333333,
137137
0.20833333333333333 };
138138

139-
EXPECT_THAT(s3, testing::Pointwise(DoubleNear(), s3e));
139+
EXPECT_THAT(s3.data(), testing::Pointwise(DoubleNear(), s3e));
140140

141141
// XXX: need more tests here
142142
}

0 commit comments

Comments
 (0)