This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1536 - Assign double times selfadjointview at to sparseMatrix does not compile
Summary: Assign double times selfadjointview at to sparseMatrix does not compile
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Core - expression templates (show other bugs)
Version: 3.3 (current stable)
Hardware: All All
: Normal Compilation Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-04 18:52 UTC by Vincent Huber
Modified: 2019-12-04 17:36 UTC (History)
4 users (show)



Attachments
result of compilation (19.01 KB, text/plain)
2018-04-04 18:52 UTC, Vincent Huber
no flags Details

Description Vincent Huber 2018-04-04 18:52:26 UTC
Created attachment 845 [details]
result of compilation

The following does not compile


```c++
#include <iostream>
#include <fstream>
#include <Eigen/Sparse>

using namespace std;
using namespace Eigen;

int main(int argc, char **args)
{
  SparseMatrix<double> A; 
  SparseMatrix<double> B = 1.*A; 
  SparseMatrix<double> C = A.selfadjointView<Upper>(); 
  SparseMatrix<double> D = 1.*A.selfadjointView<Upper>(); 
  return 0;
}
```
Comment 1 Gael Guennebaud 2018-04-04 21:26:58 UTC
Workaround:

(1.*A).selfadjointView<Upper>();
Comment 2 Vincent Huber 2018-04-05 07:41:28 UTC
This expression compiles, but the assignment does not.
Comment 3 Vincent Huber 2018-04-05 07:43:31 UTC
The (massively ugly) workaround I've found is to put the double into a SparseMatrix that have only one coefficient.
Comment 4 Vincent Huber 2018-04-05 07:59:57 UTC
(In reply to Vincent Huber from comment #3)
> The (massively ugly) workaround I've found is to put the double into a
> SparseMatrix that have only one coefficient.

I mean the identity times the coef
Comment 5 Nobody 2019-12-04 17:36:08 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com'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: https://gitlab.com/libeigen/eigen/issues/1536.

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