New user self-registration is disabled due to spam. Please email eigen-core-team @ if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 520 - DiagonalMatrix interface lacking
Summary: DiagonalMatrix interface lacking
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - general (show other bugs)
Version: 3.2
Hardware: All All
: Normal enhancement
Assignee: Nobody
Depends on: ExprEval
Blocks: 610 3.x
  Show dependency treegraph
Reported: 2012-10-12 23:16 UTC by Bastiaan Ober
Modified: 2018-10-10 21:51 UTC (History)
3 users (show)


Description Bastiaan Ober 2012-10-12 23:16:23 UTC
The interface of the DiagonalMatrix lacks some methods that generic matrices do have. Examples I encountered are operator(row,col), setConstant, coeff, but there might be more. These are meaningful and should not be hard to add.
Comment 1 Bastiaan Ober 2012-10-19 23:02:22 UTC
On an additional note: multiplication, addition, subtraction of two diagonal matrices does not seem to be supported
Comment 2 Gael Guennebaud 2012-10-24 10:04:28 UTC
The lack of accessors is on purpose. We don't want to permit diagmat(i,j) because this is a very inefficient way of using a diagonal matrix. We could allow it in the case i==j, but then it is equivalent to use .diagonal()(i) instead of (i,i).

Regarding higher level operations, yes they are planed. Need the evaluator refactoring first.
Comment 3 Gael Guennebaud 2018-10-10 21:51:43 UTC
Added diagmat +/- diagmat:

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