make vectors actually have bipolar function
parent
dafbe6ea8b
commit
ce4e1807de
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.20)
|
||||
include(cmake/color.cmake)
|
||||
set(BLT_VERSION 2.1.0)
|
||||
set(BLT_VERSION 2.1.1)
|
||||
|
||||
set(BLT_TARGET BLT)
|
||||
|
||||
|
|
|
@ -168,10 +168,7 @@ namespace blt
|
|||
{
|
||||
matrix_t copy = *this;
|
||||
for (auto& v : copy.data)
|
||||
{
|
||||
for (auto& d : blt::iterate(v.begin(), v.end()))
|
||||
d = d >= 0 ? 1 : -1;
|
||||
}
|
||||
v = v.bipolar();
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
|
@ -134,6 +134,14 @@ namespace blt
|
|||
return copy;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr inline vec<T, size> bipolar() const
|
||||
{
|
||||
auto copy = *this;
|
||||
for (auto& v : copy.elements)
|
||||
v = v >= 0 ? 1 : -1;
|
||||
return copy;
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr inline T magnitude() const
|
||||
{
|
||||
T total = 0;
|
||||
|
|
Loading…
Reference in New Issue