Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cost Opimization #29

Merged
merged 17 commits into from
Aug 15, 2018
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 41 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ message(WARNING ${LIBRARIES})

# Add the sources to the executables
add_library(Routes STATIC ${HS}
${SOURCES})
${SOURCES})

IF (WIN32)

Expand All @@ -35,28 +35,28 @@ ENDIF()

# Include stuff
include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/include
${GDAL_INCLUDE_DIR})
${GDAL_INCLUDE_DIR})

add_custom_target(copy)

IF (WIN32)

message(STATUS ${GDAL_LIBRARY})
target_link_libraries(Routes ${OpenCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES})
${GDAL_LIBRARY}
${LIBRARIES})

add_custom_command(TARGET copy PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy C:/warmerda/bld/bin/gdal202.dll
${CMAKE_BINARY_DIR}/gdal202.dll)
COMMAND ${CMAKE_COMMAND} -E
copy C:/warmerda/bld/bin/gdal202.dll
${CMAKE_BINARY_DIR}/gdal202.dll)

ELSE()

target_link_libraries(Routes ${OPENCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread)
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread)

ENDIF()

Expand All @@ -68,8 +68,8 @@ foreach(Header ${HS})
message(STATUS ${TO_WRITE})

add_custom_command(TARGET copy PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy ${Header} ${TO_WRITE})
COMMAND ${CMAKE_COMMAND} -E
copy ${Header} ${TO_WRITE})

endforeach()

Expand All @@ -80,7 +80,7 @@ FILE(GLOB_RECURSE HS ${CMAKE_SOURCE_DIR}/src/routes-exec/*.h*)
FILE(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR}/src/routes-exec/*.cpp)

add_executable(Routes-Exec ${HS}
${SOURCES})
${SOURCES})

add_dependencies(Routes-Exec Routes)

Expand All @@ -93,15 +93,17 @@ IF (WIN32)

message(WARNING ${GDAL_LIBRARY})
target_link_libraries(Routes-Exec ${OpenCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES})
${GDAL_LIBRARY}
${LIBRARIES})

ELSE()

target_link_libraries(Routes-Exec ${OPENCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread)
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread
-lpqxx
-lpq)

ENDIF()

Expand All @@ -110,7 +112,7 @@ FILE(GLOB_RECURSE HS ${CMAKE_SOURCE_DIR}/src/routes-server/*.h*)
FILE(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR}/src/routes-server/*.cpp)

add_executable(Routes-Server ${HS}
${SOURCES})
${SOURCES})

add_dependencies(Routes-Server Routes)

Expand All @@ -123,15 +125,17 @@ IF (WIN32)

message(STATUS ${GDAL_LIBRARY})
target_link_libraries(Routes-Server ${OpenCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES})
${GDAL_LIBRARY}
${LIBRARIES})

ELSE()

target_link_libraries(Routes-Server ${OPENCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread)
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread
-lpqxx
-lpq)

ENDIF()

Expand All @@ -141,8 +145,8 @@ enable_testing()
FILE(GLOB_RECURSE HS ${CMAKE_SOURCE_DIR}/src/routes-tests/*.h*)
FILE(GLOB_RECURSE SOURCES ${CMAKE_SOURCE_DIR}/src/routes-tests/*.cpp)

add_executable(Routes-Tests ${HS}
${SOURCES})
add_executable(Routes-Tests ${HS}
${SOURCES})

add_dependencies(Routes-Tests Routes)

Expand All @@ -155,27 +159,29 @@ IF (WIN32)

message(STATUS ${GDAL_LIBRARY})
target_link_libraries(Routes-Tests ${OpenCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES})
${GDAL_LIBRARY}
${LIBRARIES})

ELSE()

target_link_libraries(Routes-Tests ${OPENCL_LIBRARIES}
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread)
${GDAL_LIBRARY}
${LIBRARIES}
-lpthread
-lpqxx
-lpq)

ENDIF()

add_test(Routes-TestSuite Routes-Tests)

# Add the check target because the built in test one is a pain
# Taken from https://stackoverflow.com/questions/5709914/using-cmake-how-do-i-get-verbose-output-from-ctest/31124523#31124523
add_custom_target(check
add_custom_target(check
COMMAND ${CMAKE_COMMAND} -E env CTEST_OUTPUT_ON_FAILURE=1
${CMAKE_CTEST_COMMAND} -C $<CONFIG>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS Routes-Tests)
${CMAKE_CTEST_COMMAND} -C $<CONFIG>
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
DEPENDS Routes-Tests)

# Fix the Xcode build so that everything is put into the binary directory
set_target_properties(Routes PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
Expand All @@ -193,4 +199,3 @@ set_target_properties(Routes-Exec PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${
set_target_properties(Routes-Tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set_target_properties(Routes-Tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set_target_properties(Routes-Tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Routes are internally represented by n-degree bezier curves, where n is determin
- Geospatial Data Abstraction Library (GDAL) [ http://www.gdal.org]

- Boost [http://www.boost.org]
- OpenGL Mathematics (GLM) [https://glm.g-truc.net/0.9.8/index.html]
- OpenGL Mathematics (GLM) [https://glm.g_CONST-truc.net/0.9.8/index.html]
- OpenCL [https://www.khronos.org/opencl/]
- Eigen [http://eigen.tuxfamily.org/]

Expand Down
2 changes: 1 addition & 1 deletion docs/class_pod.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a6d1251a997b3e47ffc0f2380
</tr>
</table>
</div><div class="memdoc">
<p>Calculates the minimum radius of curvature that the track may have in meters. This is based on the maximum speed of the hyperloop pod in meters / second and a max lateral acceleration of g</p>
<p>Calculates the minimum radius of curvature that the track may have in meters. This is based on the maximum speed of the hyperloop pod in meters / second and a max lateral acceleration of g_CONST</p>
<dl class="section return"><dt>Returns</dt><dd>The minimum radius of curvature that should be allowed for human comfort on the track. </dd></dl>

</div>
Expand Down
6 changes: 3 additions & 3 deletions docs/classes.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<div class="title">Class Index</div> </div>
</div><!--header-->
<div class="contents">
<div class="qindex"><a class="qindex" href="#letter__">_</a>&#160;|&#160;<a class="qindex" href="#letter_b">b</a>&#160;|&#160;<a class="qindex" href="#letter_c">c</a>&#160;|&#160;<a class="qindex" href="#letter_e">e</a>&#160;|&#160;<a class="qindex" href="#letter_g">g</a>&#160;|&#160;<a class="qindex" href="#letter_i">i</a>&#160;|&#160;<a class="qindex" href="#letter_k">k</a>&#160;|&#160;<a class="qindex" href="#letter_m">m</a>&#160;|&#160;<a class="qindex" href="#letter_p">p</a>&#160;|&#160;<a class="qindex" href="#letter_r">r</a>&#160;|&#160;<a class="qindex" href="#letter_s">s</a></div>
<div class="qindex"><a class="qindex" href="#letter__">_</a>&#160;|&#160;<a class="qindex" href="#letter_b">b</a>&#160;|&#160;<a class="qindex" href="#letter_c">c</a>&#160;|&#160;<a class="qindex" href="#letter_e">e</a>&#160;|&#160;<a class="qindex" href="#letter_g">g_CONST</a>&#160;|&#160;<a class="qindex" href="#letter_i">i</a>&#160;|&#160;<a class="qindex" href="#letter_k">k</a>&#160;|&#160;<a class="qindex" href="#letter_m">m</a>&#160;|&#160;<a class="qindex" href="#letter_p">p</a>&#160;|&#160;<a class="qindex" href="#letter_r">r</a>&#160;|&#160;<a class="qindex" href="#letter_s">s</a></div>
<table class="classindex">
<tr><td rowspan="2" valign="bottom"><a name="letter__"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;_&#160;&#160;</div></td></tr></table>
</td><td rowspan="2" valign="bottom"><a name="letter_e"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;e&#160;&#160;</div></td></tr></table>
Expand All @@ -71,7 +71,7 @@
<tr><td rowspan="2" valign="bottom"><a name="letter_r"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;r&#160;&#160;</div></td></tr></table>
</td><td></td></tr>
<tr><td valign="top"><a class="el" href="struct_routes_queue_1_1___route_item.html">RoutesQueue::_RouteItem</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="class_elevation_data.html">ElevationData</a>&#160;&#160;&#160;</td><td valign="top"><a class="el" href="class_kernel.html">Kernel</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td valign="top"><a class="el" href="class_elevation_data_1_1___static_g_d_a_l.html">ElevationData::_StaticGDAL</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_g"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;g&#160;&#160;</div></td></tr></table>
<tr><td valign="top"><a class="el" href="class_elevation_data_1_1___static_g_d_a_l.html">ElevationData::_StaticGDAL</a>&#160;&#160;&#160;</td><td rowspan="2" valign="bottom"><a name="letter_g"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;g_CONST&#160;&#160;</div></td></tr></table>
</td><td rowspan="2" valign="bottom"><a name="letter_m"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;m&#160;&#160;</div></td></tr></table>
</td><td valign="top"><a class="el" href="class_routes.html">Routes</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td rowspan="2" valign="bottom"><a name="letter_b"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;b&#160;&#160;</div></td></tr></table>
Expand All @@ -87,7 +87,7 @@
<tr><td valign="top"><a class="el" href="class_c_m_d.html">CMD</a>&#160;&#160;&#160;</td><td></td><td></td><td></td><td></td></tr>
<tr><td></td><td></td><td></td><td></td><td></td></tr>
</table>
<div class="qindex"><a class="qindex" href="#letter__">_</a>&#160;|&#160;<a class="qindex" href="#letter_b">b</a>&#160;|&#160;<a class="qindex" href="#letter_c">c</a>&#160;|&#160;<a class="qindex" href="#letter_e">e</a>&#160;|&#160;<a class="qindex" href="#letter_g">g</a>&#160;|&#160;<a class="qindex" href="#letter_i">i</a>&#160;|&#160;<a class="qindex" href="#letter_k">k</a>&#160;|&#160;<a class="qindex" href="#letter_m">m</a>&#160;|&#160;<a class="qindex" href="#letter_p">p</a>&#160;|&#160;<a class="qindex" href="#letter_r">r</a>&#160;|&#160;<a class="qindex" href="#letter_s">s</a></div>
<div class="qindex"><a class="qindex" href="#letter__">_</a>&#160;|&#160;<a class="qindex" href="#letter_b">b</a>&#160;|&#160;<a class="qindex" href="#letter_c">c</a>&#160;|&#160;<a class="qindex" href="#letter_e">e</a>&#160;|&#160;<a class="qindex" href="#letter_g">g_CONST</a>&#160;|&#160;<a class="qindex" href="#letter_i">i</a>&#160;|&#160;<a class="qindex" href="#letter_k">k</a>&#160;|&#160;<a class="qindex" href="#letter_m">m</a>&#160;|&#160;<a class="qindex" href="#letter_p">p</a>&#160;|&#160;<a class="qindex" href="#letter_r">r</a>&#160;|&#160;<a class="qindex" href="#letter_s">s</a></div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Expand Down
2 changes: 1 addition & 1 deletion docs/functions.html
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ <h3><a id="index_e"></a>- e -</h3><ul>
</ul>


<h3><a id="index_g"></a>- g -</h3><ul>
<h3><a id="index_g"></a>- g_CONST -</h3><ul>
<li>generateRandomSamples()
: <a class="el" href="class_multi_normal.html#a6f2a5156edccfc8abc46699366a59e7b">MultiNormal</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/functions_func.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ <h3><a id="index_e"></a>- e -</h3><ul>
</ul>


<h3><a id="index_g"></a>- g -</h3><ul>
<h3><a id="index_g"></a>- g_CONST -</h3><ul>
<li>generateRandomSamples()
: <a class="el" href="class_multi_normal.html#a6f2a5156edccfc8abc46699366a59e7b">MultiNormal</a>
</li>
Expand Down
2 changes: 1 addition & 1 deletion docs/functions_vars.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h3><a id="index_d"></a>- d -</h3><ul>
</ul>


<h3><a id="index_g"></a>- g -</h3><ul>
<h3><a id="index_g"></a>- g_CONST -</h3><ul>
<li>genome
: <a class="el" href="struct_individual.html#a93363084997e9905d3d19e780e2de060">Individual</a>
</li>
Expand Down
4 changes: 2 additions & 2 deletions docs/globals.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ <h3><a id="index_e"></a>- e -</h3><ul>
</ul>


<h3><a id="index_g"></a>- g -</h3><ul>
<li>g
<h3><a id="index_g"></a>- g_CONST -</h3><ul>
<li>g_CONST
: <a class="el" href="pod_8h.html#a167d2c0ec9b943d55f2124f7442b2f6d">pod.h</a>
</li>
<li>GDAL_DB_PATH
Expand Down
2 changes: 1 addition & 1 deletion docs/globals_defs.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
<li>EXCAVATION_DEPTH
: <a class="el" href="pod_8h.html#ae4adb5dee6386c072d6040a979e5b405">pod.h</a>
</li>
<li>g
<li>g_CONST
: <a class="el" href="pod_8h.html#a167d2c0ec9b943d55f2124f7442b2f6d">pod.h</a>
</li>
<li>GDAL_DB_PATH
Expand Down
8 changes: 4 additions & 4 deletions docs/pod_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a167d2c0ec9b943d55f2124f7442b2f6d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pod_8h.html#a167d2c0ec9b943d55f2124f7442b2f6d">g</a>&#160;&#160;&#160;9.81</td></tr>
<tr class="memitem:a167d2c0ec9b943d55f2124f7442b2f6d"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pod_8h.html#a167d2c0ec9b943d55f2124f7442b2f6d">g_CONST</a>&#160;&#160;&#160;9.81</td></tr>
<tr class="separator:a167d2c0ec9b943d55f2124f7442b2f6d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8191f33de6b15bf953b2a80e9d704e63"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pod_8h.html#a8191f33de6b15bf953b2a80e9d704e63">MAX_SLOPE_GRADE</a>&#160;&#160;&#160;0.06f</td></tr>
<tr class="separator:a8191f33de6b15bf953b2a80e9d704e63"><td class="memSeparator" colspan="2">&#160;</td></tr>
Expand Down Expand Up @@ -124,17 +124,17 @@ <h2 class="memtitle"><span class="permalink"><a href="#ae4adb5dee6386c072d6040a9
</div>
</div>
<a id="a167d2c0ec9b943d55f2124f7442b2f6d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a167d2c0ec9b943d55f2124f7442b2f6d">&#9670;&nbsp;</a></span>g</h2>
<h2 class="memtitle"><span class="permalink"><a href="#a167d2c0ec9b943d55f2124f7442b2f6d">&#9670;&nbsp;</a></span>g_CONST</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define g&#160;&#160;&#160;9.81</td>
<td class="memname">#define g_CONST&#160;&#160;&#160;9.81</td>
</tr>
</table>
</div><div class="memdoc">
<p>Lowercase g in physics (the gravitational acceleration constant) in meters / second^2. </p>
<p>Lowercase g_CONST in physics (the gravitational acceleration constant) in meters / second^2. </p>

</div>
</div>
Expand Down
Loading