Skip to content
This repository was archived by the owner on Mar 8, 2023. It is now read-only.

Commit c5e8c76

Browse files
committed
adding build matrix to travis
1 parent 26aeadb commit c5e8c76

File tree

3 files changed

+127
-37
lines changed

3 files changed

+127
-37
lines changed

.travis.yml

Lines changed: 92 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,92 @@
11
language: cpp
2-
os: linux
3-
compiler:
4-
- clang
5-
addons:
6-
apt:
7-
update: true
8-
sources:
9-
- ubuntu-toolchain-r-test
10-
- llvm-toolchain-trusty-6.0
11-
packages:
12-
- cmake
13-
- cmake-data
14-
- clang-6.0
15-
- libboost-all-dev
16-
- build-essential
17-
env:
18-
- MATRIX_EVAL="CC=clang-6.0 && CXX=clang++-6.0"
2+
3+
matrix:
4+
include:
5+
- name: "Linux clang debug"
6+
os: linux
7+
compiler:
8+
- clang
9+
addons:
10+
apt:
11+
update: true
12+
sources:
13+
- ubuntu-toolchain-r-test
14+
- llvm-toolchain-trusty-6.0
15+
packages:
16+
- cmake
17+
- cmake-data
18+
- clang-6.0
19+
- libboost-all-dev
20+
- build-essential
21+
env:
22+
- MATRIX_EVAL="CC=/usr/local/clang-5.0.0/bin/clang && CXX=/usr/local/clang-5.0.0/bin/clang++"
23+
- BUILD_TYPE="Debug"
24+
- BUILD_FLAGS=""
25+
- CMAKE_FLAGS=""
26+
- name: "Linux gcc debug"
27+
os: linux
28+
compiler:
29+
- gcc
30+
sudo: required
31+
addons:
32+
apt:
33+
update: true
34+
sources:
35+
- ubuntu-toolchain-r-test
36+
packages:
37+
- g++-7
38+
- cmake
39+
- cmake-data
40+
- libboost-all-dev
41+
- build-essential
42+
env:
43+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
44+
- BUILD_TYPE="Debug"
45+
- BUILD_FLAGS=""
46+
- CMAKE_FLAGS=""
47+
- name: "Linux clang release"
48+
os: linux
49+
compiler:
50+
- clang
51+
sudo: required
52+
addons:
53+
apt:
54+
update: true
55+
sources:
56+
- ubuntu-toolchain-r-test
57+
- llvm-toolchain-trusty-6.0
58+
packages:
59+
- cmake
60+
- cmake-data
61+
- clang-6.0
62+
- libboost-all-dev
63+
- build-essential
64+
env:
65+
- MATRIX_EVAL="CC=/usr/local/clang-5.0.0/bin/clang && CXX=/usr/local/clang-5.0.0/bin/clang++"
66+
- BUILD_TYPE="Release"
67+
- BUILD_FLAGS=""
68+
- CMAKE_FLAGS=""
69+
- name: "Linux gcc release"
70+
os: linux
71+
compiler:
72+
- gcc
73+
sudo: required
74+
addons:
75+
apt:
76+
update: true
77+
sources:
78+
- ubuntu-toolchain-r-test
79+
packages:
80+
- g++-7
81+
- cmake
82+
- cmake-data
83+
- libboost-all-dev
84+
- build-essential
85+
env:
86+
- MATRIX_EVAL="CC=gcc-7 && CXX=g++-7"
87+
- BUILD_TYPE="Release"
88+
- BUILD_FLAGS=""
89+
- CMAKE_FLAGS='-DCMAKE_CXX_FLAGS_RELEASE="-O2"'
1990

2091
before_install:
2192
- eval "${MATRIX_EVAL}"
@@ -26,8 +97,8 @@ before_install:
2697
script:
2798
- mkdir build-cmake-release
2899
- cd build-cmake-release
29-
- cmake -DCMAKE_CXX_FLAGS="-DGDAL_VERSION_2_2=1 --std=c++11" -DTNTN_TEST=ON -DCMAKE_BUILD_TYPE=Debug ../.
30-
- VERBOSE=1 make -j2 tin-terrain
31-
- VERBOSE=1 make -j2 tntn-tests
100+
- cmake "${CMAKE_FLAGS}" -DCMAKE_CXX_FLAGS="-DGDAL_VERSION_2_2=1 --std=c++11 ${BUILD_FLAGS}" -DTNTN_TEST=ON -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" ../.
101+
- VERBOSE=1 make tin-terrain
102+
- VERBOSE=1 make tntn-tests
32103
- test/tntn-tests
33-
104+

include/tntn/Raster.h

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Raster
102102
@param w width of raster
103103
@param h height of raster
104104
*/
105-
Raster(const uint w, const uint h) : Raster() { allocate(w, h); }
105+
Raster(const unsigned int w, const unsigned int h) : Raster() { allocate(w, h); }
106106

107107
/**
108108
copies settable parameters from parent raster
@@ -139,7 +139,7 @@ class Raster
139139
@param w width of raster
140140
@param h height of raster
141141
*/
142-
void allocate(const uint w, const uint h)
142+
void allocate(const unsigned int w, const unsigned int h)
143143
{
144144
m_width = w;
145145
m_height = h;
@@ -185,7 +185,10 @@ class Raster
185185
@param ch height of sub image
186186
@return the sub image with updated xpos & ypos and correct cellsize parameter
187187
*/
188-
Raster crop_ll(const uint cx, const uint cy, const uint cw, const uint ch) const
188+
Raster crop_ll(const unsigned int cx,
189+
const unsigned int cy,
190+
const unsigned int cw,
191+
const unsigned int ch) const
189192
{
190193
int cyn = m_height - (cy + ch);
191194
return crop(cx, cyn, cw, ch);
@@ -280,7 +283,10 @@ class Raster
280283
@param ch height of sub image
281284
@return the sub image with updated xpos & ypos and correct cellsize parameter
282285
*/
283-
Raster crop(const uint cx, const uint cy, const uint cw, const uint ch) const
286+
Raster crop(const unsigned int cx,
287+
const unsigned int cy,
288+
const unsigned int cw,
289+
const unsigned int ch) const
284290
{
285291
Raster dst_raster;
286292
crop(cx, cy, cw, ch, dst_raster);
@@ -308,12 +314,12 @@ class Raster
308314
/**
309315
@return raster width in pixels
310316
*/
311-
uint get_width() const { return m_width; }
317+
unsigned int get_width() const { return m_width; }
312318

313319
/**
314320
@return raster height in pixels
315321
*/
316-
uint get_height() const { return m_height; }
322+
unsigned int get_height() const { return m_height; }
317323

318324
/**
319325
get tile position in geo coordinates
@@ -374,14 +380,17 @@ class Raster
374380
@param r row
375381
@return raw pointer
376382
*/
377-
T* get_ptr(const uint r) const { return m_data.get() + r * m_width; }
383+
T* get_ptr(const unsigned int r) const { return m_data.get() + r * m_width; }
378384

379385
/**
380386
get raw pointer to beginning of raster row (lower left is origin)
381387
@param r row
382388
@return raw pointer
383389
*/
384-
T* get_ptr_ll(const uint r) const { return m_data.get() + (m_height - 1 - r) * m_width; }
390+
T* get_ptr_ll(const unsigned int r) const
391+
{
392+
return m_data.get() + (m_height - 1 - r) * m_width;
393+
}
385394

386395
/**
387396
get value at raster position
@@ -390,7 +399,7 @@ class Raster
390399
@param c column
391400
@return value
392401
*/
393-
T& value(const uint r, const uint c) const { return get_ptr(r)[c]; }
402+
T& value(const unsigned int r, const unsigned int c) const { return get_ptr(r)[c]; }
394403

395404
/**
396405
get value at raster position (using lower left coordinate system)
@@ -399,15 +408,15 @@ class Raster
399408
@param c column
400409
@return value
401410
*/
402-
T& value_ll(const uint r, const uint c) const { return get_ptr_ll(r)[c]; }
411+
T& value_ll(const unsigned int r, const unsigned int c) const { return get_ptr_ll(r)[c]; }
403412

404413
/**
405414
get x component of geo/world coordinates at column c
406415
407416
@param c column
408417
@return x geo coordinates
409418
*/
410-
double col2x(const uint c) const { return m_xpos + (c + 0.5) * m_cellsize; }
419+
double col2x(const unsigned int c) const { return m_xpos + (c + 0.5) * m_cellsize; }
411420

412421
int x2col(double x) const
413422
{
@@ -445,7 +454,7 @@ class Raster
445454
@param c column
446455
@return x geo coordinates
447456
*/
448-
double row2y(const uint r_tl) const
457+
double row2y(const unsigned int r_tl) const
449458
{
450459
int r_ll = m_height - 1 - r_tl;
451460
return m_ypos + (r_ll + 0.5) * m_cellsize;
@@ -458,7 +467,7 @@ class Raster
458467
@param r row from lower left
459468
@return y geo coordinates
460469
*/
461-
double row_ll2y(const uint r_ll) const { return m_ypos + (r_ll + 0.5) * m_cellsize; }
470+
double row_ll2y(const unsigned int r_ll) const { return m_ypos + (r_ll + 0.5) * m_cellsize; }
462471

463472
/**
464473
get x component of geo/world coordinates at column c
@@ -467,7 +476,7 @@ class Raster
467476
@param c column from lower left
468477
@return x geo coordinates
469478
*/
470-
double col_ll2x(const uint c) const { return col2x(c); }
479+
double col_ll2x(const unsigned int c) const { return col2x(c); }
471480

472481
/**
473482
is raster empty
@@ -523,8 +532,8 @@ class Raster
523532

524533
private:
525534
// raster width and height
526-
uint m_width = 0;
527-
uint m_height = 0;
535+
unsigned int m_width = 0;
536+
unsigned int m_height = 0;
528537

529538
// tile position in world coordinates
530539
double m_xpos = 0;

include/tntn/println.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ inline void println(const T& t)
3939
detail::print_impl(static_cast<const std::stringstream&>(std::stringstream() << t), true);
4040
}
4141

42+
inline void println(const std::basic_ostream<char>& s)
43+
{
44+
detail::print_impl(static_cast<const std::stringstream&>(s), true);
45+
}
46+
4247
inline void println(const std::stringstream& s)
4348
{
4449
detail::print_impl(s, true);
@@ -103,6 +108,11 @@ inline void print(const std::stringstream& s)
103108
detail::print_impl(s, false);
104109
}
105110

111+
inline void print(const std::basic_ostream<char>& s)
112+
{
113+
detail::print_impl(static_cast<const std::stringstream&>(s), false);
114+
}
115+
106116
inline void print(const std::string& s)
107117
{
108118
detail::print_impl(s, false);

0 commit comments

Comments
 (0)