fix(math): preflight finite dense operands at dispatch boundary
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <cmath>
|
||||
#include <limits>
|
||||
#include <map>
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@@ -226,7 +227,7 @@ Result<EigenReduction> BuildEigenReduction(
|
||||
const SparseMatrix& stiffness, const std::vector<Matrix>& mass,
|
||||
const std::vector<ShellNodeInitialFrame>& frames,
|
||||
const std::vector<std::uint8_t>& mask, const std::vector<double>& drilling,
|
||||
const double length) {
|
||||
const double length) try {
|
||||
const std::size_t count = mass.size();
|
||||
const Status valid = stiffness.Validate();
|
||||
if (!valid.IsOk()) return Result<EigenReduction>::Failure(valid);
|
||||
@@ -401,6 +402,10 @@ Result<EigenReduction> BuildEigenReduction(
|
||||
return Result<EigenReduction>::Success(
|
||||
{std::move(reduced.Value()), std::move(lifts), free_count, null_count,
|
||||
length, eta_mz, eta_kz, pz_norm});
|
||||
} catch (const std::invalid_argument&) {
|
||||
return Result<EigenReduction>::Failure(
|
||||
Failure("invalid-eigen-mass-space", 0U,
|
||||
"Eigen product operands must be finite and shape compatible."));
|
||||
}
|
||||
|
||||
Vector RestoreScaledMode(const EigenReduction& reduction, const Matrix& vectors,
|
||||
|
||||
Reference in New Issue
Block a user