Cleanup: Various clang-tidy warnings in intern

Pull Request: https://projects.blender.org/blender/blender/pulls/133734
This commit is contained in:
Brecht Van Lommel
2025-01-26 20:08:09 +01:00
parent c721c1a7e8
commit 0d92a7f57a
132 changed files with 1395 additions and 1450 deletions

View File

@@ -20,10 +20,10 @@
/* Eigen data structures */
typedef Eigen::SparseMatrix<double, Eigen::ColMajor> EigenSparseMatrix;
typedef Eigen::SparseLU<EigenSparseMatrix> EigenSparseLU;
typedef Eigen::VectorXd EigenVectorX;
typedef Eigen::Triplet<double> EigenTriplet;
using EigenSparseMatrix = Eigen::SparseMatrix<double, Eigen::ColMajor>;
using EigenSparseLU = Eigen::SparseLU<EigenSparseMatrix>;
using EigenVectorX = Eigen::VectorXd;
using EigenTriplet = Eigen::Triplet<double>;
/* Linear Solver data structure */
@@ -63,7 +63,7 @@ struct LinearSolver {
state = STATE_VARIABLES_CONSTRUCT;
m = 0;
n = 0;
sparseLU = NULL;
sparseLU = nullptr;
num_variables = num_variables_;
num_rhs = num_rhs_;
num_rows = num_rows_;
@@ -99,14 +99,16 @@ struct LinearSolver {
bool least_squares;
};
LinearSolver *EIG_linear_solver_new(int num_rows, int num_columns, int num_rhs)
LinearSolver *EIG_linear_solver_new(int num_rows, int num_columns, int num_right_hand_sides)
{
return new LinearSolver(num_rows, num_columns, num_rhs, false);
return new LinearSolver(num_rows, num_columns, num_right_hand_sides, false);
}
LinearSolver *EIG_linear_least_squares_solver_new(int num_rows, int num_columns, int num_rhs)
LinearSolver *EIG_linear_least_squares_solver_new(int num_rows,
int num_columns,
int num_right_hand_sides)
{
return new LinearSolver(num_rows, num_columns, num_rhs, true);
return new LinearSolver(num_rows, num_columns, num_right_hand_sides, true);
}
void EIG_linear_solver_delete(LinearSolver *solver)

View File

@@ -10,15 +10,13 @@
#pragma once
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/* Solvers for Ax = b and AtAx = Atb */
typedef struct LinearSolver LinearSolver;
struct LinearSolver;
LinearSolver *EIG_linear_solver_new(int num_rows, int num_columns, int num_right_hand_sides);

View File

@@ -33,7 +33,7 @@ bool EIG_invert_m4_m4(float inverse[4][4], const float matrix[4][4])
bool invertible = true;
M.computeInverseWithCheck(R, invertible, 0.0f);
if (!invertible) {
R = R.Zero();
R = Matrix4f::Zero();
}
memcpy(inverse, R.data(), sizeof(float) * 4 * 4);
return invertible;