Skip to content

Rework sparse repmat#1819

Merged
alecjacobson merged 5 commits intolibigl:mainfrom
paul0noah:reworkSparseRepmat
Mar 27, 2022
Merged

Rework sparse repmat#1819
alecjacobson merged 5 commits intolibigl:mainfrom
paul0noah:reworkSparseRepmat

Conversation

@paul0noah
Copy link
Copy Markdown
Contributor

@paul0noah paul0noah commented May 30, 2021

Fixes # .

Repmat not working for colum major sparse matrices.
Improves performance of repmat

Checklist

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

@jdumas jdumas added this to the v3.0.0 milestone May 30, 2021
@alecjacobson
Copy link
Copy Markdown
Contributor

Thanks!

Does https://eigen.tuxfamily.org/dox/classEigen_1_1Replicate.html in Eigen work for sparse matrices? If so, we could deprecate this.

If not, we should keep repmat and merge this helpful fix. Unless I'm misremembering some functions, I think every where we use Eigen::SparseMatrix in libigl we just expose the numeric type (e.g., Eigen::SparseMatrix<T> where T could be double or float). This means we assume/force the storage ordering to be the default (which I believe is column-major). If we merge this, it will be a bit of an outlier in that this function will template on the order, but all(?) other libigl functions will expect default ordering.

@paul0noah
Copy link
Copy Markdown
Contributor Author

Sorry for the late reply.

As far as i know, replicate() is not supported for sparse matrices (at least it does not appear in the sparse matrix manipulations tutorial https://eigen.tuxfamily.org/dox/group__TutorialSparse.html and my experiments with it did also fail)

I understand that it might be nice to not expose the major type to the outside but it does limit the functionality quite a lot (you can only use RowMajor or ColMajor format). I pledge to expose the major type to the outside to increase the functionality.

@jdumas jdumas removed this from the v2.4.0 milestone Mar 25, 2022
@alecjacobson alecjacobson merged commit d444bb1 into libigl:main Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants