fix(eigen): validate basis operands before dense dispatch
This commit is contained in:
@@ -118,6 +118,22 @@ Result<NodalLift> MakeLift(const Matrix& mass,
|
||||
if (positive == 0U) return Result<NodalLift>::Success(std::move(result));
|
||||
|
||||
const Matrix scaled = ScaledMass(mass, length);
|
||||
// Raw frame tangents can enter this internal boundary independently of
|
||||
// Domain validation. Check the actual operands before any dense dispatch.
|
||||
for (std::size_t row = 0; row < 6U; ++row) {
|
||||
for (std::size_t j = 0; j < basis.Columns(); ++j) {
|
||||
if (!std::isfinite(basis(row, j)))
|
||||
return Result<NodalLift>::Failure(
|
||||
Failure("invalid-eigen-mass-space", node,
|
||||
"Invalid positive mass basis."));
|
||||
}
|
||||
for (std::size_t j = 0; j < 6U; ++j) {
|
||||
if (!std::isfinite(scaled(row, j)))
|
||||
return Result<NodalLift>::Failure(
|
||||
Failure("invalid-eigen-mass-space", node,
|
||||
"Scaled mass is nonfinite."));
|
||||
}
|
||||
}
|
||||
Matrix mp = dense_blas_internal::MultiplyTransposeLeft(basis, scaled)
|
||||
.Multiply(basis);
|
||||
double scale = 0.0;
|
||||
|
||||
Reference in New Issue
Block a user