diff options
author | Nao Pross <naopross@thearcway.org> | 2019-06-24 10:16:32 +0200 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2019-06-24 10:17:45 +0200 |
commit | 4234e4adf62d035cd4c7bb5e9412fabc013dba6e (patch) | |
tree | 42aa3eb306719436bb5c39c0ec55fedd35fbdaa6 | |
parent | Update matrix test, add square matrix trace and fix comments (diff) | |
parent | Update CMakeLists and structure under include (diff) | |
download | libmm-4234e4adf62d035cd4c7bb5e9412fabc013dba6e.tar.gz libmm-4234e4adf62d035cd4c7bb5e9412fabc013dba6e.zip |
Merge branch 'master' into matrices
-rw-r--r-- | CMakeLists.txt | 4 | ||||
-rw-r--r-- | include/mm/mm.hpp (renamed from include/mm) | 0 | ||||
-rw-r--r-- | include/mm/mmmatrix.hpp (renamed from include/mmmatrix.hpp) | 0 | ||||
-rw-r--r-- | include/mm/mmvec.hpp (renamed from include/mmvec.hpp) | 17 | ||||
-rw-r--r-- | mmmatrix.cpp | 2 | ||||
-rw-r--r-- | mmvec.cpp | 2 | ||||
-rw-r--r-- | test/matrix_example.cpp | 2 | ||||
-rw-r--r-- | test/vec_example.cpp | 2 |
8 files changed, 9 insertions, 20 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f9e8468..7a14759 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,8 +68,8 @@ set_target_properties(mm PROPERTIES EXPORT_NAME MM) # install public headers install( FILES - ${CMAKE_CURRENT_SOURCE_DIR}/include/mmvec.hpp - ${CMAKE_CURRENT_SOURCE_DIR}/include/mm + ${CMAKE_CURRENT_SOURCE_DIR}/include/mm/mmvec.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/include/mm/mm.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/mm ) diff --git a/include/mm b/include/mm/mm.hpp index 7e9f02b..7e9f02b 100644 --- a/include/mm +++ b/include/mm/mm.hpp diff --git a/include/mmmatrix.hpp b/include/mm/mmmatrix.hpp index 5285429..5285429 100644 --- a/include/mmmatrix.hpp +++ b/include/mm/mmmatrix.hpp diff --git a/include/mmvec.hpp b/include/mm/mmvec.hpp index 21e91b5..1939388 100644 --- a/include/mmvec.hpp +++ b/include/mm/mmvec.hpp @@ -222,10 +222,7 @@ std::ostream& operator<<(std::ostream& os, const mm::basic_vec<T, d>& v) { template<typename T, std::size_t d> class mm::vec: public mm::basic_vec<T, d> { public: - vec(std::initializer_list<T> l) : basic_vec<T, d>(l) {} - - template<std::size_t n> - vec(const basic_vec<T, n>& other) : basic_vec<T, d>(other) {} + using mm::basic_vec<T, d>::basic_vec; }; @@ -235,11 +232,7 @@ public: template<typename T> class mm::vec3 : public mm::basic_vec<T, 3> { public: - vec3() : basic_vec<T, 3>() {} - vec3(std::initializer_list<T> l) : basic_vec<T, 3>(l) {} - - template<std::size_t n> - vec3(const basic_vec<T, n>& other) : basic_vec<T, 3>(other) {} + using mm::basic_vec<T, 3>::basic_vec; T& x() { return this->at(0); } T& y() { return this->at(1); } @@ -293,11 +286,7 @@ mm::vec3<T> mm::vec3<T>::cross(const vec3<T>& rhs, const vec3<T>& lhs) { template<typename T> class mm::vec2: public mm::basic_vec<T, 2> { public: - vec2() : basic_vec<T, 2>() {} - vec2(std::initializer_list<T> l) : basic_vec<T, 2>(l) {} - - template<std::size_t n> - vec2(const basic_vec<T, n>& other) : basic_vec<T, 2>(other) {} + using mm::basic_vec<T, 2>::basic_vec; T& x() { return this->at(0); } T& y() { return this->at(1); } diff --git a/mmmatrix.cpp b/mmmatrix.cpp index a352413..c0ce9eb 100644 --- a/mmmatrix.cpp +++ b/mmmatrix.cpp @@ -1 +1 @@ -#include "mmmatrix.hpp" +#include "mm/mmmatrix.hpp" @@ -1 +1 @@ -#include "mmvec.hpp" +#include "mm/mmvec.hpp" diff --git a/test/matrix_example.cpp b/test/matrix_example.cpp index 469cbff..e7f6580 100644 --- a/test/matrix_example.cpp +++ b/test/matrix_example.cpp @@ -1,4 +1,4 @@ -#include "mmmatrix.hpp" +#include "mm/mmmatrix.hpp" #include <iostream> #include <complex> diff --git a/test/vec_example.cpp b/test/vec_example.cpp index 3a00f58..14b9680 100644 --- a/test/vec_example.cpp +++ b/test/vec_example.cpp @@ -1,4 +1,4 @@ -#include "mmvec.hpp" +#include "mm/mmvec.hpp" #include <iostream> #include <complex> |