Search code examples
c++mathsparse-matrixeigenglm-math

What's the equivalent feature of SparseMatrix in GLM?


Eigen has Eigen::SparseMatrix, what's the equivalent feature in GLM? I've looked through its documentation, and googled, couldn't find it. But it's hard to believe glm doesn't have sparse matrix.


Solution

  • But it's hard to believe glm doesn't have sparse matrix.

    Why is that so hard to believe? Sparse matrices are outside of GLM's job description.

    GLM is intended to mimic the OpenGL shading language's vector/matrix facilities. Obviously it adds its own stuff, but that's the core of the system.

    Sparse matrices aren't part of GLSL, so they're not part of GLM. And sparse matrices are kind of outside of standard graphics work, at least as far as common 3D or 2D transformation tasks are concerned.

    This is also why its predefined vector and matrix types only go up to 4.

    GLM is not a generic matrix/vector library.