diff options
author | Nao Pross <naopross@thearcway.org> | 2019-02-23 14:56:30 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-02-23 15:03:55 +0100 |
commit | 4b97a0eb6c9ef2a0e8f53dd7d6f89129d8467fac (patch) | |
tree | a521c847616b3717c3fd55b47d2d33ed9581aee5 /test | |
parent | Merge branch 'master' into matrices (diff) | |
download | libmm-4b97a0eb6c9ef2a0e8f53dd7d6f89129d8467fac.tar.gz libmm-4b97a0eb6c9ef2a0e8f53dd7d6f89129d8467fac.zip |
Add initializer_list constructor to basic_matrix and matrix test
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 32 | ||||
-rw-r--r-- | test/matrix_example.cpp | 13 |
2 files changed, 45 insertions, 0 deletions
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e80e737..89e7c47 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,3 +1,4 @@ +# vectors example add_executable(vec_example vec_example.cpp ) @@ -26,3 +27,34 @@ target_link_libraries(vec_example PRIVATE MM::mm ) + + +# matrix example +add_executable(matrix_example + matrix_example.cpp +) + +target_compile_options(matrix_example + PRIVATE + $<$<CXX_COMPILER_ID:GNU>: + -pedantic -Wall -Wextra -Wcast-qual -Wcast-align -Wpointer-arith + -Winit-self -Wshadow -Wswitch-enum -Wredundant-decls -Wfloat-equal + -Wundef -Wvla -Wconversion -Wstrict-aliasing + > + $<$<CXX_COMPILER_ID:MSVC>:/W4> +) + +target_compile_features(matrix_example + PRIVATE + cxx_std_17 +) + +target_include_directories(matrix_example + PRIVATE + ${MM_INCLUDE_DIRS} +) + +target_link_libraries(matrix_example + PRIVATE + MM::mm +) diff --git a/test/matrix_example.cpp b/test/matrix_example.cpp new file mode 100644 index 0000000..3fb7c78 --- /dev/null +++ b/test/matrix_example.cpp @@ -0,0 +1,13 @@ +#include "mmmatrix.hpp" + +#include <iostream> +#include <complex> + +int main(int argc, char *argv[]) { + std::cout << "MxN dimensional (int) matrices" << std::endl; + mm::matrix<int, 3, 2> m {{1, 2}, {3, 4}, {5, 6}}; + + std::cout << m; + + return 0; +} |