This bugzilla service is closed. All entries have been migrated to

Bug 520

Summary: DiagonalMatrix interface lacking
Product: Eigen Reporter: Bastiaan Ober <blijmoedig>
Component: Core - generalAssignee: Nobody <eigen.nobody>
Status: CONFIRMED ---    
Severity: enhancement CC: blijmoedig, gael.guennebaud, jacob.benoit.1
Priority: Normal    
Version: 3.2   
Hardware: All   
OS: All   
Bug Depends on: 99    
Bug Blocks: 610, 1608    

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:
Comment 4 Nobody 2019-12-04 11:55:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: