Skip to content

fix #1230: Heat geodesics example crashes#1237

Closed
xinyazhang wants to merge 5 commits intolibigl:devfrom
xinyazhang:pr-1230-rev1
Closed

fix #1230: Heat geodesics example crashes#1237
xinyazhang wants to merge 5 commits intolibigl:devfrom
xinyazhang:pr-1230-rev1

Conversation

@xinyazhang
Copy link
Copy Markdown

[Describe your changes and what you've already done to test it.]

Check all that apply (change to [x])

  • All changes meet libigl style-guidelines.
  • Adds new .cpp file.
  • Adds corresponding unit test.
  • Adds corresponding python binding.
  • This is a minor change.

This change swap the calling of transpose() and sparseView() and fixed the igl::heat_geodesics_precompute on Windows.

tutorial/716_HeatGeodesics has been tested on Windows with cmake -DLIBIGL_USE_STATIC_LIBRARY=OFF ..

P.S. I'm not an expert of Eigen so I've no idea this comes from misusing of Eigen, a Windows bug in Eigen, or a compiler bug from Visual C++.

This bug is a combination of three components: Visual C++, Eigen,
and how igl::heat_geodesics_precompute uses Eigen::SparseMatrix.

For some reason, if transpose() is called before sparseView() on Windows,
the returned SparseMatrix cannot be iterated over with the the standard
method (more precisely, the InnerIterator may have invalid indices
during the iteration).  Thus, a lot of functions would fail, including
functions from Eigen itself.

This patch let heat_geodesics_precompute() calls sparseView() BEFORE
transpose(), and solved the problem.
@alecjacobson
Copy link
Copy Markdown
Contributor

Thanks for doing the hard working of tracking down this issue. Looks like a great candidate to submit as a possible but to Eigen, too.

@jdumas
Copy link
Copy Markdown
Collaborator

jdumas commented Jun 24, 2019

Hmm why are we even transposing a diagonal sparse matrix in the first place? Anyway thanks for finding this, esp. as we don't have that many Windows maintainers. I would also love to hear a bit more from upstream as to what is causing this.

@alecjacobson
Copy link
Copy Markdown
Contributor

alecjacobson commented Jun 24, 2019 via email

@jdumas
Copy link
Copy Markdown
Collaborator

jdumas commented Jun 24, 2019

Ah, right, I got confused with .asDiagonal(). So it looks like one of the typical temporary evaluation with Eigen then, and should be reported.

jdumas and others added 2 commits June 26, 2019 17:48
…bigl#1239)

* Add conda environment file for boost (helpful for Windows users).

* Try to update Travis image for macOS.
jdumas and others added 2 commits June 28, 2019 15:46
…r-clang

update IGL_DEPRECATED to handle clang (e.g. on macOS) as well.
@stnoh stnoh mentioned this pull request Sep 16, 2019
5 tasks
jdumas added a commit that referenced this pull request Oct 17, 2019
@jdumas
Copy link
Copy Markdown
Collaborator

jdumas commented Oct 17, 2019

Fixed by #1288

@jdumas jdumas closed this Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants