Below is a short test case that causes a segfault with DenseMatrix::svd
with --enable-complex. I think that the issue is related to the fact that
LAPACK clears the "number_val" array, and then it gets cleared again when
it goes out of scope. I wasn't able to fix it so far, though (seems like
allocating the array with new would do the job, but that didn't seem to
work for me), so another pair of eyes on this would be appreciated.

This is related to the PR 1042 that I just closed based on comments from
John and Roy (I agree that it'd be better to fix this than to require the
user to call the SVD themselves).

David

------------------

int main (int argc, char** argv)
{
  LibMeshInit init (argc, argv);
  DenseMatrix< Complex > A(3,3);

  A(0,0) = Complex(2.18904,4.44523e-18); A(0,1) =
Complex(-3.20491,-0.136699);   A(0,2) = Complex(0.716316,-0.964802);
  A(1,0) = Complex(-3.20491,0.136699);   A(1,1) =
Complex(4.70076,-3.25261e-18); A(1,2) = Complex(-0.98849,1.45727);
  A(2,0) = Complex(0.716316,0.964802);   A(2,1) =
Complex(-0.98849,-1.45727);    A(2,2) = Complex(0.659629,-4.01155e-18);

  std::cout << "A = " << std::endl << A << std::endl;
  DenseVector< Real > sigma;
  A.svd( sigma );
  std::cout << "sigma = " << std::endl << sigma << std::endl;

  return 0;
}
------------------------------------------------------------------------------
_______________________________________________
Libmesh-devel mailing list
Libmesh-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-devel

Reply via email to