Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of isometric expansion when collapsing sparsity. #62

Merged
merged 7 commits into from
Jun 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Move the IEEE checks to another commit.
LTLA committed Jun 16, 2023
commit 4f94bb4b0a34c04ece0cb79e91ab723b8f35a952
13 changes: 1 addition & 12 deletions include/tatami/isometric/arith_utils.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
#ifndef TATAMI_ARITH_UTILS_HPP
#define TATAMI_ARITH_UTILS_HPP

#include <limits>

/**
* @file arith_utils.hpp
*
@@ -37,19 +35,10 @@ void delayed_arith_run(Value_& val, Scalar_ scalar) {
val = scalar - val;
}
} else {
// Assume IEEE behavior if divisor is zero.
if constexpr(right_) {
if constexpr(!std::numeric_limits<Value_>::is_iec559) {
if (scalar == 0) {
throw std::runtime_error("IEEE division by zero is not supported");
}
}
val /= scalar;
} else {
if constexpr(!std::numeric_limits<Value_>::is_iec559) {
if (val == 0) {
throw std::runtime_error("IEEE division by zero is not supported");
}
}
val = scalar / val;
}
}