New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1487 - cwise Operations
Summary: cwise Operations
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Documentation
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-16 11:13 UTC by Timo Sachsenberg
Modified: 2017-11-16 11:13 UTC (History)
2 users (show)



Attachments

Description Timo Sachsenberg 2017-11-16 11:13:13 UTC
Hi,
I love the tables that show what/how operations can be performed on matrices and vectors. Unfortunately, documentation falls a bit short for sparse matrices and sparse vectors. Assuming that most of you guys probably spend their precious time working on other topics I think it would still make a great difference to provide such a table on e.g.: https://eigen.tuxfamily.org/dox/group__TutorialSparse.html

I had some troubles (and still don't fully understand) why:
(sv1 - sv2).cwiseAbs() or sv1.sum() works but e.g.:
sv1.cwiseMin(1.0) doesn't (requires sv1.coeffs().cwiseMin(1.0))

I also quite often run into errors like:
error: ‘const CwiseAbsReturnType’ has no member named ‘coeffs’
float sum = (sv1 - sv2).cwiseAbs().coeffs().cwiseMax(0).sum();

or error: ‘Constant’ is not a member of ‘Eigen::CwiseUnaryOp<Eigen::internal::scalar_abs_op<float>, const Eigen::SparseVector<float> >’
float sum = sv1.cwiseAbs().cwiseMax(0).sum();

while: float sum = sv1.coeffs().cwiseMax(0).sum(); compiles

I guess these are probably newbie errors but I thought it might be worth to give feedback and some hints where the documentation could be improved,
Timo

Note You need to log in before you can comment on or make changes to this bug.