mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
replaced with STL relization
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include "omath/vector3.hpp"
|
#include "omath/vector3.hpp"
|
||||||
|
#include <numeric>
|
||||||
|
|
||||||
|
|
||||||
#ifdef near
|
#ifdef near
|
||||||
@@ -141,12 +142,7 @@ namespace omath
|
|||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
constexpr Type Sum() const noexcept
|
constexpr Type Sum() const noexcept
|
||||||
{
|
{
|
||||||
Type sum = 0;
|
return std::accumulate(m_data.begin(), m_data.end(), Type(0));
|
||||||
for (size_t i = 0; i < Rows; ++i)
|
|
||||||
for (size_t j = 0; j < Columns; ++j)
|
|
||||||
sum += At(i, j);
|
|
||||||
|
|
||||||
return sum;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr void Clear() noexcept
|
constexpr void Clear() noexcept
|
||||||
|
|||||||
Reference in New Issue
Block a user