Skip to content

Commit

Permalink
Merge pull request #78 from bevanwsjones/77-project-structure-overhaul
Browse files Browse the repository at this point in the history
77 project structure overhaul
  • Loading branch information
bevanwsjones authored Apr 25, 2024
2 parents a813363 + 9fdeab0 commit c1d2919
Show file tree
Hide file tree
Showing 55 changed files with 791 additions and 929 deletions.
38 changes: 16 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ add_compile_definitions("DISA_DEBUG")
# ----------------------------------------------------------------------------------------------------------------------

if(ENABLE_TEST)

include(FetchContent)
FetchContent_Declare(googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG release-1.12.1)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
Expand All @@ -54,7 +53,6 @@ if(ENABLE_TEST)
enable_testing()
include(CTest)
include(GoogleTest)

endif ()


Expand All @@ -66,30 +64,26 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

add_subdirectory(${PROJECT_SOURCE_DIR}/libs/core)
add_subdirectory(${PROJECT_SOURCE_DIR}/libs/graphing)
add_subdirectory(${PROJECT_SOURCE_DIR}/libs/solver)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/core)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/graph)
add_subdirectory(${PROJECT_SOURCE_DIR}/src/solver)

if(ENABLE_TEST)
add_subdirectory(${PROJECT_SOURCE_DIR}/test/core)
add_subdirectory(${PROJECT_SOURCE_DIR}/test/graph)
add_subdirectory(${PROJECT_SOURCE_DIR}/test/solver)
endif()

# ----------------------------------------------------------------------------------------------------------------------
# Library Recipe
# ----------------------------------------------------------------------------------------------------------------------

include_directories(include)
set(LIBRARIES
core
graph
solver
)

set(SOURCES
include/disa.h
)

set(LIBRARIES
core
graphing
solver
)

add_library(disa ${SOURCES})
target_link_libraries(disa ${LIBRARIES})
add_library(disa INTERFACE)
target_link_libraries(disa INTERFACE ${LIBRARIES})
set_target_properties(disa PROPERTIES LINKER_LANGUAGE CXX)

add_executable(example src/main.cpp ${SOURCES})
target_link_libraries(example disa)

2 changes: 1 addition & 1 deletion external/doxygen-awesome-css
2 changes: 1 addition & 1 deletion libs/core/macros.h → include/core/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------
// File Name: Macros.h
// File Name: macros.hpp
// Description: Defines a number of global functions and macros for the project.
// ---------------------------------------------------------------------------------------------------------------------

Expand Down
10 changes: 5 additions & 5 deletions libs/core/matrix_dense.h → include/core/matrix_dense.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------
// File Name: matrix_dense.h
// File Name: matrix_dense.hpp
// Description: Contains the declaration and definitions for the basic static and dynamic dense matrix classes for Disa.
// ---------------------------------------------------------------------------------------------------------------------

#ifndef DISA_MATRIX_DENSE_H
#define DISA_MATRIX_DENSE_H

#include "macros.h"
#include "scalar.h"
#include "vector_dense.h"
#include "vector_operators.h"
#include "macros.hpp"
#include "scalar.hpp"
#include "vector_dense.hpp"
#include "vector_operators.hpp"

#include <algorithm>
#include <array>
Expand Down
8 changes: 4 additions & 4 deletions libs/core/matrix_sparse.h → include/core/matrix_sparse.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------
// File Name: matrix_sparse.h
// File Name: matrix_sparse.hpp
// Description: Contains the declaration and some definitions for the basic sparse matrix classes for Disa, at present
// represented as a CSR matrix.
// ---------------------------------------------------------------------------------------------------------------------

#ifndef DISA_MATRIX_SPARSE_H
#define DISA_MATRIX_SPARSE_H

#include "macros.h"
#include "scalar.h"
#include "vector_dense.h"
#include "macros.hpp"
#include "scalar.hpp"
#include "vector_dense.hpp"

#include <numeric>
#include <vector>
Expand Down
4 changes: 2 additions & 2 deletions libs/core/scalar.h → include/core/scalar.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------
// File Name: Scalar.h
// File Name: Scalar.hpp
// Description: Contains the declaration and definitions of 'macro' like globals which help with floating point
// operations, when used as mathematical scalar.
// ---------------------------------------------------------------------------------------------------------------------

#ifndef DISA_SCALAR_H
#define DISA_SCALAR_H

#include "macros.h"
#include "macros.hpp"

#include <limits>

Expand Down
6 changes: 3 additions & 3 deletions libs/core/vector_dense.h → include/core/vector_dense.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------
// File Name: vector_dense.h
// File Name: vector_dense.hpp
// Description: Contains the declaration and definitions for the basic static and dynamic dense vector classes for Disa.
// ---------------------------------------------------------------------------------------------------------------------

#ifndef DISA_VECTOR_DENSE_H
#define DISA_VECTOR_DENSE_H

#include "macros.h"
#include "scalar.h"
#include "macros.hpp"
#include "scalar.hpp"

#include <algorithm>
#include <array>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ---------------------------------------------------------------------------------------------------------------------
// File Name: vector_operator.h
// File Name: vector_operator.hpp
// Description: Contains the declaration and definition of mathematical vector operations. File will only define
// operations which either reduce or maintain vector dimensionality. I.e. An outer product, for example,
// would be defined in matrix_operators.
Expand All @@ -24,9 +24,9 @@
#ifndef DISA_VECTOR_OPERATORS_H
#define DISA_VECTOR_OPERATORS_H

#include "macros.h"
#include "scalar.h"
#include "vector_dense.h"
#include "macros.hpp"
#include "scalar.hpp"
#include "vector_dense.hpp"

#include <algorithm>
#include <cmath>
Expand Down
50 changes: 0 additions & 50 deletions include/disa.h

This file was deleted.

Loading

0 comments on commit c1d2919

Please sign in to comment.