Fix clang16 compiler warnings

Fixes the following two warnings:

preconditioner.h:64:11: warning: field 'f_block_size' will be initialized after field 'elimination_groups' [-Wreorder-ctor]
block_sparse_matrix.cc:70:19: warning: unused parameter 'values' [-Wunused-parameter]

Change-Id: I5cc55ca387b3f12259096c1531c263279650bd49
This commit is contained in:
Johannes Schönberger
2024-04-17 08:25:45 +00:00
parent 1f2e6313a5
commit cd2dd06e9a
2 changed files with 3 additions and 4 deletions
+2 -3
View File
@@ -67,7 +67,6 @@ void ComputeCumulativeNumberOfNonZeros(std::vector<CompressedList>& rows) {
template <bool transpose>
std::unique_ptr<CompressedRowSparseMatrix>
CreateStructureOfCompressedRowSparseMatrix(
const double* values,
int num_rows,
int num_cols,
int num_nonzeros,
@@ -451,7 +450,7 @@ std::unique_ptr<CompressedRowSparseMatrix>
BlockSparseMatrix::ToCompressedRowSparseMatrixTranspose() const {
auto bs = transpose_block_structure_.get();
auto crs_matrix = CreateStructureOfCompressedRowSparseMatrix<true>(
values(), num_cols_, num_rows_, num_nonzeros_, bs);
num_cols_, num_rows_, num_nonzeros_, bs);
SetBlockStructureOfCompressedRowSparseMatrix(crs_matrix.get(), bs);
@@ -462,7 +461,7 @@ BlockSparseMatrix::ToCompressedRowSparseMatrixTranspose() const {
std::unique_ptr<CompressedRowSparseMatrix>
BlockSparseMatrix::ToCompressedRowSparseMatrix() const {
auto crs_matrix = CreateStructureOfCompressedRowSparseMatrix<false>(
values(), num_rows_, num_cols_, num_nonzeros_, block_structure_.get());
num_rows_, num_cols_, num_nonzeros_, block_structure_.get());
SetBlockStructureOfCompressedRowSparseMatrix(crs_matrix.get(),
block_structure_.get());
+1 -1
View File
@@ -59,10 +59,10 @@ class CERES_NO_EXPORT Preconditioner : public LinearOperator {
sparse_linear_algebra_library_type(
linear_solver_options.sparse_linear_algebra_library_type),
num_threads(linear_solver_options.num_threads),
elimination_groups(linear_solver_options.elimination_groups),
row_block_size(linear_solver_options.row_block_size),
e_block_size(linear_solver_options.e_block_size),
f_block_size(linear_solver_options.f_block_size),
elimination_groups(linear_solver_options.elimination_groups),
context(linear_solver_options.context) {}
PreconditionerType type = JACOBI;