Re: [eigen] Dead code in Pardiso

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi Rasmus,

Actually, `p_null` gets initialized to an empty/nullptr array (in the highest superclass [1]) which then gets converted to a nullptr that the assignment checks for and ignores. I did a quick try by removing it which seems to show it has no effect. However, I only have limited tests.

Thanks,
-Edward

1. I had to step through the debugger to find it

On Wed, Mar 23, 2022 at 8:15 PM Rasmus Munk Larsen <rmlarsen@xxxxxxxxxx> wrote:
It looks like p_null is uninitialized, so it looks like undefined behavior to me, but I'm not entirely sure. Did you try to remove .twistedby(p_null); ?

On Tue, Mar 22, 2022 at 2:03 PM Edward Lam <edward@xxxxxxxxxx> wrote:
Hi,

void getMatrix(const MatrixType& matrix)
{
  // PARDISO supports only upper, row-major matrices
  PermutationMatrix<Dynamic,Dynamic,StorageIndex> p_null;
  m_matrix.resize(matrix.rows(), matrix.cols());
  m_matrix.template selfadjointView<Upper>() = matrix.template selfadjointView<UpLo>().twistedBy(p_null);
  m_matrix.makeCompressed();
}
As far as I can tell, the call to twistedBy(p_null) in the code is a no-op right? Or does it serve some purpose that I'm missing?

Thanks,
-Edward


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/