IncompleteCholesky fails for SparseMatrix of size 1,1 with 0 as entry

Summary

IncompleteCholesky stops working for my arguable very limited corner case. I stumbled upon this due to my unit test, where I have this as a corner case. It worked before with 3.4 though.

Environment

  • Eigen Version : master
  • Compiler Version : Gcc13.2

Minimal Example

https://godbolt.org/z/54T6WqfM8

#include <Eigen/IterativeLinearSolvers>
#include <iostream>
using Matrix = Eigen::SparseMatrix<double>;
using Solver = Eigen::IncompleteCholesky<double>;
int main() {
Solver s;

Matrix A(1,1);
A.insert(0,0)=0;

s.analyzePattern(A);
s.factorize(A);
std::cout<<s.matrixL();
    return 0;
}

Steps to reproduce

  1. See godbolt

What is the current bug behavior?

IncompleteCholesky fails with assert.

What is the expected correct behavior?

I don't know what to expect but it didn'*'t throw this assert in 3.4. In 3.4 the returned L matrix contains a non-zero value, due to shifting?. Which seems reasonable to me.

Relevant logs

output.s: /opt/compiler-explorer/libs/eigen/vtrunk/Eigen/src/SparseCore/SparseMatrix.h:556: Eigen::SparseMatrix<Scalar_, Flags_, StorageIndex_>::Scalar& Eigen::SparseMatrix<Scalar_, Flags_, StorageIndex_>::insertByOuterInner(Eigen::Index, Eigen::Index) [with Scalar_ = double; int Options_ = 0; StorageIndex_ = int; Scalar = double; Eigen::Index = long int]: Assertion `(dst == end || m_data.index(dst) != i) && "you cannot insert an element that already exists, you must call coeffRef to this end"' failed.
Program terminated with signal: SIGSEGV
Edited by Alex_M