diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 1c6b5b6..d2ba2fb 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -13,16 +13,16 @@ env: jobs: deploy: - runs-on: macos-12 + runs-on: macos-latest steps: - uses: actions/checkout@v3 - name: Install Doxygen - run: brew install doxygen + run: brew install doxygen pipx - name: Install pip3 packages - run: pip3 install Sphinx sphinx-rtd-theme breathe sphinx-mdinclude + run: pip3 install Sphinx sphinx-rtd-theme breathe sphinx-mdinclude --break-system-packages - name: Configure CMake with DOCS run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DDOCS=ON diff --git a/.github/workflows/unittest_macos_appleclang.yml b/.github/workflows/unittest_macos_appleclang.yml index b674105..f92d311 100644 --- a/.github/workflows/unittest_macos_appleclang.yml +++ b/.github/workflows/unittest_macos_appleclang.yml @@ -12,7 +12,7 @@ env: jobs: build: - runs-on: macos-12 + runs-on: macos-latest steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/unittest_macos_clang.yml b/.github/workflows/unittest_macos_clang.yml index 59ef095..69b03b3 100644 --- a/.github/workflows/unittest_macos_clang.yml +++ b/.github/workflows/unittest_macos_clang.yml @@ -12,7 +12,7 @@ env: jobs: build: - runs-on: macos-12 + runs-on: macos-latest steps: - uses: actions/checkout@v3 @@ -21,7 +21,7 @@ jobs: run: brew install llvm - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_C_COMPILER=/usr/local/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=/usr/local/opt/llvm/bin/clang++ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTEST=ON + run: cmake -B ${{github.workspace}}/build -DCMAKE_C_COMPILER=/opt/homebrew/opt/llvm/bin/clang -DCMAKE_CXX_COMPILER=/opt/homebrew/opt/llvm/bin/clang++ -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTEST=ON - name: Build # Build your program with the given configuration diff --git a/.github/workflows/unittest_ubuntu.yml b/.github/workflows/unittest_ubuntu.yml index af9167d..2eff1a6 100644 --- a/.github/workflows/unittest_ubuntu.yml +++ b/.github/workflows/unittest_ubuntu.yml @@ -1,30 +1,32 @@ -name: Unit Test (Ubuntu) - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -env: - # Run unittest on debug config only - BUILD_TYPE: Debug - -jobs: - build: - runs-on: ubuntu-22.04 - - steps: - - uses: actions/checkout@v3 - - - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTEST=ON - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build/test - run: ./PeanutTest - +# TODO +# +#name: Unit Test (Ubuntu) +# +#on: +# push: +# branches: [ "main" ] +# pull_request: +# branches: [ "main" ] +# +#env: +# # Run unittest on debug config only +# BUILD_TYPE: Debug +# +#jobs: +# build: +# runs-on: ubuntu-22.04 +# +# steps: +# - uses: actions/checkout@v3 +# +# - name: Configure CMake +# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DTEST=ON +# +# - name: Build +# # Build your program with the given configuration +# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} +# +# - name: Test +# working-directory: ${{github.workspace}}/build/test +# run: ./PeanutTest +# diff --git a/.gitignore b/.gitignore index dd19447..a1d58fb 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,7 @@ build/ cmake-build-debug/ cmake-build-release/ +cmake-build-relwithdebinfo/ +armadillo-code/ +eigen/ .vs/ diff --git a/LICENSE b/LICENSE index 4ba97d0..36161ac 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Jino Park +Copyright (c) 2022-2024 Jino Park Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4dfdc68..dad0f96 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Unit Test (macOS, AppleClang)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_appleclang.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_appleclang.yml) [![Unit Test (macOS, Clang)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_clang.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_macos_clang.yml) -[![Unit Test (Ubuntu)](https://github.com/pjessesco/peanut/actions/workflows/unittest_ubuntu.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_ubuntu.yml) [![Unit Test (Windows MSVC)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_msvc.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_msvc.yml) [![Unit Test (Windows Clang)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_clang.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/unittest_windows_clang.yml) [![Deploy doxygen documents](https://github.com/pjessesco/peanut/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/pjessesco/peanut/actions/workflows/docs.yml) diff --git a/docs/conf.py b/docs/conf.py index 64b957b..722c071 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # -- Project information ----------------------------------------------------- project = 'Peanut' -copyright = '2022, Jino Park' +copyright = '2022-2024, Jino Park' author = 'Jino Park' diff --git a/include/Peanut/Peanut.h b/include/Peanut/Peanut.h index a9adab9..a25d066 100644 --- a/include/Peanut/Peanut.h +++ b/include/Peanut/Peanut.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/binary_expr/matrix_div_scalar.h b/include/Peanut/impl/binary_expr/matrix_div_scalar.h index c802339..ed12dd7 100644 --- a/include/Peanut/impl/binary_expr/matrix_div_scalar.h +++ b/include/Peanut/impl/binary_expr/matrix_div_scalar.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/binary_expr/matrix_emult.h b/include/Peanut/impl/binary_expr/matrix_emult.h index 853c0aa..efc1922 100644 --- a/include/Peanut/impl/binary_expr/matrix_emult.h +++ b/include/Peanut/impl/binary_expr/matrix_emult.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/binary_expr/matrix_mult.h b/include/Peanut/impl/binary_expr/matrix_mult.h index dd44e91..7f7392d 100644 --- a/include/Peanut/impl/binary_expr/matrix_mult.h +++ b/include/Peanut/impl/binary_expr/matrix_mult.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/binary_expr/matrix_mult_scalar.h b/include/Peanut/impl/binary_expr/matrix_mult_scalar.h index 86e1dab..67ff8c5 100644 --- a/include/Peanut/impl/binary_expr/matrix_mult_scalar.h +++ b/include/Peanut/impl/binary_expr/matrix_mult_scalar.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/binary_expr/matrix_subtract.h b/include/Peanut/impl/binary_expr/matrix_subtract.h index d23d83d..19ed56e 100644 --- a/include/Peanut/impl/binary_expr/matrix_subtract.h +++ b/include/Peanut/impl/binary_expr/matrix_subtract.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/binary_expr/matrix_sum.h b/include/Peanut/impl/binary_expr/matrix_sum.h index d1b4625..963fd61 100644 --- a/include/Peanut/impl/binary_expr/matrix_sum.h +++ b/include/Peanut/impl/binary_expr/matrix_sum.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/common.h b/include/Peanut/impl/common.h index 4542fa2..b2de6f0 100644 --- a/include/Peanut/impl/common.h +++ b/include/Peanut/impl/common.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -34,7 +34,11 @@ // Dependencies headers +#if defined(_MSC_VER) && !defined(__llvm__) && !defined(__INTEL_COMPILER) +#define INLINE __forceinline +#else #define INLINE __attribute__((always_inline)) inline +#endif namespace Peanut { using Index = unsigned int; diff --git a/include/Peanut/impl/matrix.h b/include/Peanut/impl/matrix.h index 571d210..70c53f5 100644 --- a/include/Peanut/impl/matrix.h +++ b/include/Peanut/impl/matrix.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -96,9 +96,9 @@ namespace Peanut { static constexpr Index Col = C; /** - * @brief Constructor without any parameters initialize to zero matrix. + * @brief Constructor without any initialization */ - Matrix() {m_data.d1.fill(t_0);} + Matrix() {} /** * @brief Constructor with row-major elements. @@ -114,13 +114,15 @@ namespace Peanut { template requires std::conjunction_v...> && (sizeof...(TList) == Row*Col) - Matrix(TList ... tlist) : m_data{{std::forward(tlist)...}} {} + Matrix(TList ... tlist) : m_data{std::forward(tlist)...} {} /** * @brief Constructor with std::array. * @param data A std::array having `T` type and \p R * \p C size. */ - explicit Matrix(const std::array &data) : m_data{data} {} + explicit Matrix(const std::array &data) { + memcpy(m_data.data(), data.data(), sizeof(T)*R*C); + } /** * @brief Constructor with std::vector. @@ -138,16 +140,20 @@ namespace Peanut { Matrix(const MatrixExpr &expr) requires is_equal_type_size_v{ for(Index r=0;r< R;r++){ for(Index c=0;c< C;c++){ - m_data.d2[r][c] = expr.elem(r, c); + m_data[r*C+c] = expr.elem(r, c); } } } /** - * @brief Equivalent with `Matrix::Matrix()`, but for explicit purpose. + * @brief Factory function for zero matrix * @return Zero matrix with given \p R and \p C . */ - static Matrix zeros() {return Matrix();} + static Matrix zeros() { + auto m = Matrix(); + memset(m.m_data.data(), 0, sizeof(T)*R*C); + return m; + } /** * @brief Construct identity matrix. Available only for square matrix case. @@ -155,9 +161,9 @@ namespace Peanut { */ static Matrix identity() requires is_square_v { Matrix a; - a.m_data.d1.fill(t_0); + memset(a.m_data.data(), 0, sizeof(T)*R*C); for (Index i = 0; i < R; i++) { - a.m_data.d2[i][i] = t_1; + a.m_data[i*C+i] = t_1; } return a; } @@ -185,7 +191,7 @@ namespace Peanut { int idx = 0; constexpr size_t copy_byte = sizeof(Type) * Col; for(const Matrix p : {rlist...}){ - memcpy(ret.m_data.d2[idx], p.m_data.d2, copy_byte); + memcpy(&(ret.m_data[idx*C]), p.m_data.data(), copy_byte); idx++; } return ret; @@ -215,7 +221,7 @@ namespace Peanut { int c = 0; for(const Matrix p : {clist...}){ for(int r=0;r get_row(Index idx) const{ Matrix ret; - memcpy(ret.m_data.d2, m_data.d2[idx], sizeof(Type)*Col); + memcpy(ret.m_data.data(), &(m_data[idx*C]), sizeof(Type)*Col); return ret; } @@ -261,7 +267,7 @@ namespace Peanut { * @param row Row matrix which will be assigned to the r'th row of the matrix. */ void set_row(Index idx, const Matrix &row){ - memcpy(m_data.d2[idx], row.m_data.d2, sizeof(Type)*Col); + memcpy(&(m_data[idx*C]), row.m_data.data(), sizeof(Type)*Col); } /** @@ -272,7 +278,7 @@ namespace Peanut { Matrix get_col(Index idx) const{ Matrix ret; for(int i=0;i &col){ for(int i=0;i{ if constexpr(C ==1){ - return m_data.d2[0][0]; + return m_data[0]; } else if constexpr (C ==2){ - return m_data.d2[0][0] * m_data.d2[1][1] - m_data.d2[0][1] * m_data.d2[1][0]; + return m_data[0] * m_data[C+1] - m_data[1] * m_data[C]; } else{ T ret = static_cast(0); for_([&] (auto c) { - ret += (c.value % 2 ? -1 : 1) * m_data.d2[0][c.value] * SubMat<0, c.value>(*this).eval().det(); + ret += (c.value % 2 ? -1 : 1) * m_data[c.value] * SubMat<0, c.value>(*this).eval().det(); }); return ret; } @@ -470,7 +476,7 @@ namespace Peanut { */ constexpr T det2() const requires is_square_v{ if constexpr(C ==1){ - return m_data.d2[0][0]; + return m_data[0]; } else if constexpr (C ==2){ return elem(0, 0) * elem(1, 1) - elem(0, 1) * elem(1, 0); @@ -484,10 +490,11 @@ namespace Peanut { } // Matrix data - union { - std::array d1; - T d2[R][C]; - } m_data; + std::array m_data; + // union { + // std::array d1; + // T d2[R][C]; + // } m_data; private: static constexpr T t_1 = static_cast(1); diff --git a/include/Peanut/impl/matrix_binary_op.h b/include/Peanut/impl/matrix_binary_op.h index 78f77a2..03a08c3 100644 --- a/include/Peanut/impl/matrix_binary_op.h +++ b/include/Peanut/impl/matrix_binary_op.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/matrix_type_traits.h b/include/Peanut/impl/matrix_type_traits.h index dd211ce..be417de 100644 --- a/include/Peanut/impl/matrix_type_traits.h +++ b/include/Peanut/impl/matrix_type_traits.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/matrix_unary_op.h b/include/Peanut/impl/matrix_unary_op.h index e68c217..c842944 100644 --- a/include/Peanut/impl/matrix_unary_op.h +++ b/include/Peanut/impl/matrix_unary_op.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/adjugate.h b/include/Peanut/impl/unary_expr/adjugate.h index baeb095..12266ad 100644 --- a/include/Peanut/impl/unary_expr/adjugate.h +++ b/include/Peanut/impl/unary_expr/adjugate.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/block.h b/include/Peanut/impl/unary_expr/block.h index 756bb7b..03d6225 100644 --- a/include/Peanut/impl/unary_expr/block.h +++ b/include/Peanut/impl/unary_expr/block.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/cast.h b/include/Peanut/impl/unary_expr/cast.h index 3177d2d..44a5ffe 100644 --- a/include/Peanut/impl/unary_expr/cast.h +++ b/include/Peanut/impl/unary_expr/cast.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/cofactor.h b/include/Peanut/impl/unary_expr/cofactor.h index 77f93e4..fcdadeb 100644 --- a/include/Peanut/impl/unary_expr/cofactor.h +++ b/include/Peanut/impl/unary_expr/cofactor.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/inverse.h b/include/Peanut/impl/unary_expr/inverse.h index ddf6ccb..5f2b2e9 100644 --- a/include/Peanut/impl/unary_expr/inverse.h +++ b/include/Peanut/impl/unary_expr/inverse.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/minor.h b/include/Peanut/impl/unary_expr/minor.h index 233ff5a..69ca40f 100644 --- a/include/Peanut/impl/unary_expr/minor.h +++ b/include/Peanut/impl/unary_expr/minor.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/negation.h b/include/Peanut/impl/unary_expr/negation.h index b7e721f..5bdecd0 100644 --- a/include/Peanut/impl/unary_expr/negation.h +++ b/include/Peanut/impl/unary_expr/negation.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/submatrix.h b/include/Peanut/impl/unary_expr/submatrix.h index 031a3c3..7d7cfa1 100644 --- a/include/Peanut/impl/unary_expr/submatrix.h +++ b/include/Peanut/impl/unary_expr/submatrix.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/include/Peanut/impl/unary_expr/transpose.h b/include/Peanut/impl/unary_expr/transpose.h index f993f8b..4efad0d 100644 --- a/include/Peanut/impl/unary_expr/transpose.h +++ b/include/Peanut/impl/unary_expr/transpose.h @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/test/test_matrix.cpp b/test/test_matrix.cpp index 0238dd5..6af9c62 100644 --- a/test/test_matrix.cpp +++ b/test/test_matrix.cpp @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -33,20 +33,6 @@ #include "catch_amalgamated.hpp" -TEST_CASE("Default constructor : zero matrix"){ - Peanut::Matrix zero_22_int_mat; - CHECK(zero_22_int_mat.elem(0, 0) == 0); - CHECK(zero_22_int_mat.elem(0, 1) == 0); - CHECK(zero_22_int_mat.elem(1, 0) == 0); - CHECK(zero_22_int_mat.elem(1, 1) == 0); - - Peanut::Matrix zero_22_float_mat; - CHECK(zero_22_float_mat.elem(0, 0) == Catch::Approx(0.0f)); - CHECK(zero_22_float_mat.elem(0, 1) == Catch::Approx(0.0f)); - CHECK(zero_22_float_mat.elem(1, 0) == Catch::Approx(0.0f)); - CHECK(zero_22_float_mat.elem(1, 1) == Catch::Approx(0.0f)); -} - TEST_CASE("Construct using parameter pack"){ Peanut::Matrix intmat(1,2,3,4); CHECK(intmat.elem(0, 0) == 1); diff --git a/test/test_matrix_binary_op.cpp b/test/test_matrix_binary_op.cpp index 11b0c63..3960407 100644 --- a/test/test_matrix_binary_op.cpp +++ b/test/test_matrix_binary_op.cpp @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/test/test_matrix_unary_op.cpp b/test/test_matrix_unary_op.cpp index 8d463a7..fb463e7 100644 --- a/test/test_matrix_unary_op.cpp +++ b/test/test_matrix_unary_op.cpp @@ -1,7 +1,7 @@ // // This software is released under the MIT license. // -// Copyright (c) 2022 Jino Park +// Copyright (c) 2022-2024 Jino Park // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal