Remove utest

feature/simd
Andrew Cassidy 2 years ago
parent 1c06cccd5c
commit 10ba6b2bd6

1
.gitignore vendored

@ -33,3 +33,4 @@ compile_commands.json
CTestTestfile.cmake
_deps
cmake-build-*
*.a

3
.gitmodules vendored

@ -1,6 +1,3 @@
[submodule "external/xsimd"]
path = external/xsimd
url = https://github.com/xtensor-stack/xsimd.git
[submodule "external/utest"]
path = external/utest
url = https://github.com/sheredom/utest.h.git

@ -11,4 +11,4 @@ add_subdirectory(quicktex)
add_subdirectory(tests)
enable_testing ()
add_test (NAME MyTest COMMAND Test)
add_test (NAME QuicktexTest COMMAND Test)

1
external/utest vendored

@ -1 +0,0 @@
Subproject commit 06abbd1978f7e9c5f61642d80b9d300e3a8c4ccf

@ -35,9 +35,7 @@ template <typename T, size_t M> using Vec = Matrix<T, 1, M>;
// region helper concepts
template <typename L, typename R, typename Op>
concept operable = requires(L &l, R &r, Op &op) {
{ op(l, r) } -> std::same_as<L>;
};
concept operable = requires(L &l, R &r, Op &op) { op(l, r); };
template <typename V>
concept is_matrix = requires(V &v) {
@ -121,7 +119,7 @@ class Matrix : public VecBase<std::conditional_t<N == 1, T, VecBase<T, N>>, M> {
* Create a vector from a scalar value
* @param scalar value to populate with
*/
Matrix(const T &scalar) { std::fill(this->all_begin(), this->all_end(), scalar); }
Matrix(const T &scalar) { std::fill(this->begin(), this->end(), scalar); }
/**
* Create a vector from an iterator
@ -431,7 +429,7 @@ class Matrix : public VecBase<std::conditional_t<N == 1, T, VecBase<T, N>>, M> {
linear_iterator(V *matrix = nullptr, size_t index = 0) : base(index), _matrix(matrix){};
auto operator*() const { return _matrix->element(this->_index); }
auto *operator->() const { &(_matrix->element(this->_index)); }
auto *operator->() const { return &(_matrix->element(this->_index)); }
friend bool operator==(const linear_iterator &lhs, const linear_iterator &rhs) {
return (lhs._matrix == rhs._matrix) && (lhs._index == rhs._index);

@ -54,6 +54,7 @@ TEST(Vec_float, mul) {
auto b = Vec<float, 3>{3.0f, 1.5f, 0.0f};
expect_matrix_eq(a * b, {3.0f, 2.25f, 0.0f});
expect_matrix_eq(a * 2, {2.0f, 3.00f, 4.0f});
}
TEST(Vec_float, div) {
@ -61,6 +62,7 @@ TEST(Vec_float, div) {
auto b = Vec<float, 3>{2.0f, 1.5f, 1.0f};
expect_matrix_eq(a / b, {0.5f, 1.0f, 2.0f});
expect_matrix_eq(a / 2, {0.5f, 0.75f, 1.0f});
}
TEST(Vec_float, vsum) {
@ -79,9 +81,8 @@ TEST(Vec_float, dot) {
TEST(Vec_float, abs) {
auto a = Vec<float, 3>{1.0f, -5.0f, -1.0f};
auto expected = Vec<float, 3>{1.0f, 5.0f, 1.0f};
expect_matrix_eq(a.abs(), expected);
expect_matrix_eq(a.abs(), {1.0f, 5.0f, 1.0f});
}
TEST(Vec_float, clamp) {
@ -132,7 +133,7 @@ TEST(Vec_int, getters) {
EXPECT_EQ(a.element(i), a[i]);
}
EXPECT_EQ(a.get_column(0), a); // the 0th column of a column-vector is itself
expect_matrix_eq(a.get_column(0), a); // the 0th column of a column-vector is itself
}
TEST(Vec_int, copy) {

Loading…
Cancel
Save