diff --git a/.vscode/settings.json b/.vscode/settings.json index 71e5c54..d269529 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -70,7 +70,8 @@ "thread": "cpp", "typeinfo": "cpp", "variant": "cpp", - "shared_mutex": "cpp" + "shared_mutex": "cpp", + "charconv": "cpp" }, "clangd.enable": false, "C_Cpp.dimInactiveRegions": false diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fb853f..9337e92 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,34 +7,51 @@ set(CMAKE_CXX_STANDARD 11) add_compile_options(-fdiagnostics-color=always) +# Vector 3D Interface +add_library(vector-3d-intf + INTERFACE +) + +target_include_directories(vector-3d-intf + INTERFACE + . +) + +# Matrix +add_library(matrix + STATIC + Matrix.cpp +) + +target_link_libraries(matrix + PUBLIC + vector-3d-intf + PRIVATE +) + +set_target_properties(matrix + PROPERTIES + LINKER_LANGUAGE CXX +) + # Vector3d -add_library(Vector3D +add_library(vector-3d STATIC Vector3D.hpp ) -set_target_properties(Vector3D - PROPERTIES - LINKER_LANGUAGE CXX -) - -target_include_directories(Vector3D PUBLIC - include -) - -# Matrix -add_library(Matrix - STATIC - Matrix.hpp - Matrix.cpp -) - -set_target_properties(Matrix - PROPERTIES - LINKER_LANGUAGE CXX -) - -target_include_directories(Matrix +target_include_directories(vector-3d PUBLIC . +) + +target_link_libraries(vector-3d + PUBLIC + vector-3d-intf + PRIVATE +) + +set_target_properties(vector-3d + PROPERTIES + LINKER_LANGUAGE CXX ) \ No newline at end of file diff --git a/Matrix.cpp b/Matrix.cpp index 11954b7..6cd1373 100644 --- a/Matrix.cpp +++ b/Matrix.cpp @@ -8,18 +8,21 @@ #include template -Matrix::Matrix(float value) { +Matrix::Matrix(float value) +{ this->Fill(value); } template -Matrix::Matrix(const std::array &array) { +Matrix::Matrix(const std::array &array) +{ this->setMatrixToArray(array); } template template -Matrix::Matrix(Args... args) { +Matrix::Matrix(Args... args) +{ constexpr uint16_t arraySize{static_cast(rows) * static_cast(columns)}; @@ -31,9 +34,12 @@ Matrix::Matrix(Args... args) { } template -Matrix::Matrix(const Matrix &other) { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { +Matrix::Matrix(const Matrix &other) +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { this->matrix[row_idx * columns + column_idx] = other.Get(row_idx, column_idx); } @@ -42,15 +48,21 @@ Matrix::Matrix(const Matrix &other) { template void Matrix::setMatrixToArray( - const std::array &array) { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + const std::array &array) +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { uint16_t array_idx = static_cast(row_idx) * static_cast(columns) + static_cast(column_idx); - if (array_idx < array.size()) { + if (array_idx < array.size()) + { this->matrix[row_idx * columns + column_idx] = array[array_idx]; - } else { + } + else + { this->matrix[row_idx * columns + column_idx] = 0; } } @@ -60,9 +72,12 @@ void Matrix::setMatrixToArray( template Matrix & Matrix::Add(const Matrix &other, - Matrix &result) const { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + Matrix &result) const +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { result[row_idx][column_idx] = this->Get(row_idx, column_idx) + other.Get(row_idx, column_idx); } @@ -73,9 +88,12 @@ Matrix::Add(const Matrix &other, template Matrix & Matrix::Sub(const Matrix &other, - Matrix &result) const { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + Matrix &result) const +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { result[row_idx][column_idx] = this->Get(row_idx, column_idx) - other.Get(row_idx, column_idx); } @@ -88,16 +106,19 @@ template template Matrix & Matrix::Mult(const Matrix &other, - Matrix &result) const { + Matrix &result) const +{ // allocate some buffers for all of our dot products Matrix<1, columns> this_row; Matrix other_column; Matrix<1, rows> other_column_t; - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { // get our row this->GetRow(row_idx, this_row); - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { // get the other matrix'ss column other.GetColumn(column_idx, other_column); // transpose the other matrix's column @@ -114,9 +135,12 @@ Matrix::Mult(const Matrix &other, template Matrix & -Matrix::Mult(float scalar, Matrix &result) const { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { +Matrix::Mult(float scalar, Matrix &result) const +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { result[row_idx][column_idx] = this->Get(row_idx, column_idx) * scalar; } } @@ -126,7 +150,8 @@ Matrix::Mult(float scalar, Matrix &result) const { template Matrix & -Matrix::Invert(Matrix &result) const { +Matrix::Invert(Matrix &result) const +{ // since all matrix sizes have to be statically specified at compile time we // can do this static_assert(rows == columns, @@ -135,7 +160,8 @@ Matrix::Invert(Matrix &result) const { // unfortunately we can't calculate this at compile time so we'll just reurn // zeros float determinant{this->Det()}; - if (determinant == 0) { + if (determinant == 0) + { // you can't invert a matrix with a negative determinant result.Fill(0); return result; @@ -161,9 +187,12 @@ Matrix::Invert(Matrix &result) const { template Matrix & -Matrix::Transpose(Matrix &result) const { - for (uint8_t column_idx{0}; column_idx < rows; column_idx++) { - for (uint8_t row_idx{0}; row_idx < columns; row_idx++) { +Matrix::Transpose(Matrix &result) const +{ + for (uint8_t column_idx{0}; column_idx < rows; column_idx++) + { + for (uint8_t row_idx{0}; row_idx < columns; row_idx++) + { result[row_idx][column_idx] = this->Get(column_idx, row_idx); } } @@ -173,20 +202,26 @@ Matrix::Transpose(Matrix &result) const { // explicitly define the determinant for a 2x2 matrix because it is definitely // the fastest way to calculate a 2x2 matrix determinant -template <> float Matrix<0, 0>::Det() const { return 1e+6; } -template <> float Matrix<1, 1>::Det() const { return this->matrix[0]; } -template <> float Matrix<2, 2>::Det() const { +template <> +float Matrix<0, 0>::Det() const { return 1e+6; } +template <> +float Matrix<1, 1>::Det() const { return this->matrix[0]; } +template <> +float Matrix<2, 2>::Det() const +{ return this->matrix[0] * this->matrix[3] - this->matrix[1] * this->matrix[2]; } template -float Matrix::Det() const { +float Matrix::Det() const +{ static_assert(rows == columns, "You can't take the determinant of a non-square matrix."); Matrix MinorMatrix{}; float determinant{0}; - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { // for odd indices the sign is negative float sign = (column_idx % 2 == 0) ? 1 : -1; determinant += sign * this->matrix[column_idx] * @@ -199,9 +234,12 @@ float Matrix::Det() const { template Matrix & Matrix::ElementMultiply(const Matrix &other, - Matrix &result) const { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + Matrix &result) const +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { result[row_idx][column_idx] = this->Get(row_idx, column_idx) * other.Get(row_idx, column_idx); } @@ -213,9 +251,12 @@ Matrix::ElementMultiply(const Matrix &other, template Matrix & Matrix::ElementDivide(const Matrix &other, - Matrix &result) const { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + Matrix &result) const +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { result[row_idx][column_idx] = this->Get(row_idx, column_idx) / other.Get(row_idx, column_idx); } @@ -226,8 +267,10 @@ Matrix::ElementDivide(const Matrix &other, template float Matrix::Get(uint8_t row_index, - uint8_t column_index) const { - if (row_index > rows - 1 || column_index > columns - 1) { + uint8_t column_index) const +{ + if (row_index > rows - 1 || column_index > columns - 1) + { return 1e+10; // TODO: We should throw something here instead of failing // quietly } @@ -237,7 +280,8 @@ float Matrix::Get(uint8_t row_index, template Matrix<1, columns> & Matrix::GetRow(uint8_t row_index, - Matrix<1, columns> &row) const { + Matrix<1, columns> &row) const +{ memcpy(&(row[0]), this->matrix.begin() + row_index * columns, columns * sizeof(float)); @@ -247,8 +291,10 @@ Matrix::GetRow(uint8_t row_index, template Matrix & Matrix::GetColumn(uint8_t column_index, - Matrix &column) const { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { + Matrix &column) const +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { column[row_idx][0] = this->Get(row_idx, column_index); } @@ -256,13 +302,17 @@ Matrix::GetColumn(uint8_t column_index, } template -void Matrix::ToString(std::string &stringBuffer) const { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { +void Matrix::ToString(std::string &stringBuffer) const +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { stringBuffer += "|"; - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { stringBuffer += std::to_string(this->matrix[row_idx * columns + column_idx]); - if (column_idx != columns - 1) { + if (column_idx != columns - 1) + { stringBuffer += "\t"; } } @@ -272,8 +322,10 @@ void Matrix::ToString(std::string &stringBuffer) const { template std::array &Matrix:: -operator[](uint8_t row_index) { - if (row_index > rows - 1) { +operator[](uint8_t row_index) +{ + if (row_index > rows - 1) + { // TODO: We should throw something here instead of failing quietly. row_index = 0; } @@ -285,9 +337,12 @@ operator[](uint8_t row_index) { template Matrix &Matrix:: -operator=(const Matrix &other) { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { +operator=(const Matrix &other) +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { this->matrix[row_idx * columns + column_idx] = other.Get(row_idx, column_idx); } @@ -298,7 +353,8 @@ operator=(const Matrix &other) { template Matrix Matrix:: -operator+(const Matrix &other) const { +operator+(const Matrix &other) const +{ Matrix buffer{}; this->Add(other, buffer); return buffer; @@ -306,7 +362,8 @@ operator+(const Matrix &other) const { template Matrix Matrix:: -operator-(const Matrix &other) const { +operator-(const Matrix &other) const +{ Matrix buffer{}; this->Sub(other, buffer); return buffer; @@ -314,14 +371,16 @@ operator-(const Matrix &other) const { template Matrix Matrix:: -operator*(const Matrix &other) const { +operator*(const Matrix &other) const +{ Matrix buffer{}; this->Mult(other, buffer); return buffer; } template -Matrix Matrix::operator*(float scalar) const { +Matrix Matrix::operator*(float scalar) const +{ Matrix buffer{}; this->Mult(scalar, buffer); return buffer; @@ -330,9 +389,11 @@ Matrix Matrix::operator*(float scalar) const { template template float Matrix::dotProduct(const Matrix<1, vector_size> &vec1, - const Matrix<1, vector_size> &vec2) { + const Matrix<1, vector_size> &vec2) +{ float sum{0}; - for (uint8_t i{0}; i < vector_size; i++) { + for (uint8_t i{0}; i < vector_size; i++) + { sum += vec1.Get(0, i) * vec2.Get(0, i); } @@ -342,9 +403,11 @@ float Matrix::dotProduct(const Matrix<1, vector_size> &vec1, template template float Matrix::dotProduct(const Matrix &vec1, - const Matrix &vec2) { + const Matrix &vec2) +{ float sum{0}; - for (uint8_t i{0}; i < vector_size; i++) { + for (uint8_t i{0}; i < vector_size; i++) + { sum += vec1.Get(i, 0) * vec2.Get(i, 0); } @@ -352,9 +415,12 @@ float Matrix::dotProduct(const Matrix &vec1, } template -void Matrix::Fill(float value) { - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { +void Matrix::Fill(float value) +{ + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { this->matrix[row_idx * columns + column_idx] = value; } } @@ -362,11 +428,14 @@ void Matrix::Fill(float value) { template Matrix & -Matrix::MatrixOfMinors(Matrix &result) const { +Matrix::MatrixOfMinors(Matrix &result) const +{ Matrix MinorMatrix{}; - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { this->MinorMatrix(MinorMatrix, row_idx, column_idx); result[row_idx][column_idx] = MinorMatrix.Det(); } @@ -378,15 +447,20 @@ Matrix::MatrixOfMinors(Matrix &result) const { template Matrix & Matrix::MinorMatrix(Matrix &result, - uint8_t row_idx, uint8_t column_idx) const { + uint8_t row_idx, uint8_t column_idx) const +{ std::array subArray{}; uint16_t array_idx{0}; - for (uint8_t row_iter{0}; row_iter < rows; row_iter++) { - if (row_iter == row_idx) { + for (uint8_t row_iter{0}; row_iter < rows; row_iter++) + { + if (row_iter == row_idx) + { continue; } - for (uint8_t column_iter{0}; column_iter < columns; column_iter++) { - if (column_iter == column_idx) { + for (uint8_t column_iter{0}; column_iter < columns; column_iter++) + { + if (column_iter == column_idx) + { continue; } subArray[array_idx] = this->Get(row_iter, column_iter); @@ -400,9 +474,12 @@ Matrix::MinorMatrix(Matrix &result, template Matrix & -Matrix::adjugate(Matrix &result) const { - for (uint8_t row_iter{0}; row_iter < rows; row_iter++) { - for (uint8_t column_iter{0}; column_iter < columns; column_iter++) { +Matrix::adjugate(Matrix &result) const +{ + for (uint8_t row_iter{0}; row_iter < rows; row_iter++) + { + for (uint8_t column_iter{0}; column_iter < columns; column_iter++) + { float sign = ((row_iter + 1) % 2) == 0 ? -1 : 1; sign *= ((column_iter + 1) % 2) == 0 ? -1 : 1; result[column_iter][row_iter] = this->Get(row_iter, column_iter) * sign; @@ -414,16 +491,20 @@ Matrix::adjugate(Matrix &result) const { template Matrix & -Matrix::Normalize(Matrix &result) const { +Matrix::Normalize(Matrix &result) const +{ float sum{0}; - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { float val{this->Get(row_idx, column_idx)}; sum += val * val; } } - if (sum == 0) { + if (sum == 0) + { // this wouldn't do anything anyways result.Fill(1e+6); return result; @@ -431,8 +512,10 @@ Matrix::Normalize(Matrix &result) const { sum = sqrt(sum); - for (uint8_t row_idx{0}; row_idx < rows; row_idx++) { - for (uint8_t column_idx{0}; column_idx < columns; column_idx++) { + for (uint8_t row_idx{0}; row_idx < rows; row_idx++) + { + for (uint8_t column_idx{0}; column_idx < columns; column_idx++) + { result[row_idx][column_idx] = this->Get(row_idx, column_idx) / sum; } } diff --git a/Matrix.hpp b/Matrix.hpp index 4b5479b..644aedf 100644 --- a/Matrix.hpp +++ b/Matrix.hpp @@ -9,7 +9,9 @@ // TODO: Add a function for SVD decomposition // TODO: Add a function for LQ decomposition -template class Matrix { +template +class Matrix +{ public: /** * @brief create a matrix but leave all of its values unitialized @@ -34,7 +36,8 @@ public: /** * @brief Initialize a matrix directly with any number of arguments */ - template Matrix(Args... args); + template + Matrix(Args... args); /** * @brief Set all elements in this to value */ @@ -95,8 +98,8 @@ public: Matrix &result) const; Matrix & - MinorMatrix(Matrix &result, uint8_t row_idx, - uint8_t column_idx) const; + MinorMatrix(Matrix &result, uint8_t row_idx, + uint8_t column_idx) const; /** * @return Get the determinant of the matrix diff --git a/Vector3D.cpp b/Vector3D.cpp new file mode 100644 index 0000000..9c5182c --- /dev/null +++ b/Vector3D.cpp @@ -0,0 +1,103 @@ +#ifdef MATRIX_H_ // since the .cpp file has to be included by the .hpp file this + // will evaluate to true +#include "Vector3D.hpp" + +template +constexpr V3D::V3D(const Matrix<1, 3> &other) : x(other[0][0]), y(other[0][1]), z(other[0][2]) {} + +template +constexpr V3D::V3D(const Matrix<3, 1> &other) : x(other[0][0]), y(other[1][0]), z(other[2][0]) {} + +template +constexpr V3D::V3D(const V3D &other) : x(other.x), + y(other.y), + z(other.z) +{ + static_assert(std::is_arithmetic::value, "Type must be a number"); +} + +template +constexpr V3D::V3D(Type x = 0, Type y = 0, Type z = 0) : x(x), + y(y), + z(z) +{ + static_assert(std::is_arithmetic::value, "Type must be a number"); +} + +template +constexpr V3D::V3D(const V3D other) : x(static_cast(other.x)), + y(static_cast(other.y)), + z(static_cast(other.z)) +{ + static_assert(std::is_arithmetic::value, "Type must be a number"); + static_assert(std::is_arithmetic::value, "OtherType must be a number"); +} + +template +std::array V3D::ToArray() +{ + return {this->x, this->y, this->z}; +} + +template +V3D &V3D::operator=(const V3D &other) +{ + this->x = other.x; + this->y = other.y; + this->z = other.z; + return *this; +} + +template +V3D &V3D::operator+=(const V3D &other) +{ + this->x += other.x; + this->y += other.y; + this->z += other.z; + return *this; +} + +template +V3D &V3D::operator-=(const V3D &other) +{ + this->x -= other.x; + this->y -= other.y; + this->z -= other.z; + return *this; +} + +template +V3D &V3D::operator/=(const Type scalar) +{ + if (scalar == 0) + { + return *this; + } + this->x /= scalar; + this->y /= scalar; + this->z /= scalar; + return *this; +} + +template +V3D &V3D::operator*=(const Type scalar) +{ + this->x *= scalar; + this->y *= scalar; + this->z *= scalar; + return *this; +} + +template +bool V3D::operator==(const V3D &other) +{ + return this->x == other.x && this->y == other.y && this->z == other.z; +} + +template +float V3D::magnitude() +{ + return std::sqrt(static_cast(this->x * this->x + this->y * this->y + this->z * this->z)); +} + +#endif // MATRIX_H_ \ No newline at end of file diff --git a/Vector3D.hpp b/Vector3D.hpp index f625f16..c35ada0 100644 --- a/Vector3D.hpp +++ b/Vector3D.hpp @@ -1,81 +1,44 @@ -#pragma once +#ifndef VECTOR3D_H_ +#define VECTOR3D_H_ #include #include #include +#include "Matrix.hpp" + template -class V3D{ - public: - constexpr V3D(const V3D& other): - x(other.x), - y(other.y), - z(other.z){ - static_assert(std::is_arithmetic::value, "Type must be a number"); - } - - constexpr V3D(Type x=0, Type y=0, Type z=0): - x(x), - y(y), - z(z){ - static_assert(std::is_arithmetic::value, "Type must be a number"); - } +class V3D +{ +public: + constexpr V3D(const Matrix<1, 3> &other); + constexpr V3D(const Matrix<3, 1> &other); + + constexpr V3D(const V3D &other); + + constexpr V3D(Type x = 0, Type y = 0, Type z = 0); template - constexpr V3D(const V3D other): - x(static_cast(other.x)), - y(static_cast(other.y)), - z(static_cast(other.z)){ - static_assert(std::is_arithmetic::value, "Type must be a number"); - static_assert(std::is_arithmetic::value, "OtherType must be a number"); - } + constexpr V3D(const V3D other); - V3D& operator=(const V3D &other){ - this->x = other.x; - this->y = other.y; - this->z = other.z; - return *this; - } + std::array ToArray(); - V3D& operator+=(const V3D &other){ - this->x += other.x; - this->y += other.y; - this->z += other.z; - return *this; - } + V3D &operator=(const V3D &other); - V3D& operator-=(const V3D &other){ - this->x -= other.x; - this->y -= other.y; - this->z -= other.z; - return *this; - } + V3D &operator+=(const V3D &other); - V3D& operator/=(const Type scalar){ - if(scalar == 0){ - return *this; - } - this->x /= scalar; - this->y /= scalar; - this->z /= scalar; - return *this; - } + V3D &operator-=(const V3D &other); - V3D& operator*=(const Type scalar){ - this->x *= scalar; - this->y *= scalar; - this->z *= scalar; - return *this; - } + V3D &operator/=(const Type scalar); - bool operator==(const V3D &other){ - return this->x == other.x && this->y == other.y && this->z == other.z; - } + V3D &operator*=(const Type scalar); - float magnitude(){ - return std::sqrt(static_cast(this->x * this->x + this->y * this->y + this->z * this->z)); - } + bool operator==(const V3D &other); + + float magnitude(); Type x; Type y; Type z; -}; \ No newline at end of file +}; + +#endif // VECTOR3D_H_ \ No newline at end of file diff --git a/unit-tests/CMakeLists.txt b/unit-tests/CMakeLists.txt index 83f3807..fd8684e 100644 --- a/unit-tests/CMakeLists.txt +++ b/unit-tests/CMakeLists.txt @@ -7,7 +7,7 @@ include(FetchContent) FetchContent_Declare( Catch2 GIT_REPOSITORY https://github.com/catchorg/Catch2.git - GIT_TAG v3.0.1 # or a later release + GIT_TAG v3.8.0 # or a later release ) FetchContent_MakeAvailable(Catch2) @@ -16,6 +16,6 @@ add_executable(matrix-tests matrix-tests.cpp) target_link_libraries(matrix-tests PRIVATE - Matrix + vector-3d-intf Catch2::Catch2WithMain ) \ No newline at end of file