[Trilinos-Users] [EXTERNAL] Constructing a CrsMatrix with just a row map

Bradley, Andrew Michael ambradl at sandia.gov
Mon Sep 21 17:44:53 EDT 2015


Hi Christopher,


I think the ctor taking row map only used to default the second argument, maxNumEntriesPerRow, to 0. Now it doesn't. But you can set it to 0 to achieve what you want. So pass the row map as the first arg and 0 as the second.


Cheers,

Andrew


________________________________
From: Trilinos-Users <trilinos-users-bounces at trilinos.org> on behalf of Christopher Thiele <christopher.thiele92 at gmail.com>
Sent: Monday, September 21, 2015 3:38 PM
To: trilinos-users at trilinos.org
Subject: [EXTERNAL] [Trilinos-Users] Constructing a CrsMatrix with just a row map

Hello,

I want to construct a Tpetra::CrsMatrix, but I do not know the number of non-zeros in advance. According to the Tpetra introduction (https://trilinos.org/docs/r12.2/packages/tpetra/doc/html/Tpetra_Lesson04.html) it should be possible to construct one with just a row map. However, when I try to do it as in the example, I get a compilation error, because there seems to be no constructor for this. The only constructor for CrsMatrix that takes only one argument wants a CrsGraph instead of a Map. I am using Trilinos 12.2.2.1, i.e. the same version as in the introduction.

Is there another way to create an "empty" matrix?

I appreciate any suggestions.

Regards,
Christopher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://trilinos.org/pipermail/trilinos-users/attachments/20150921/f4858818/attachment.html>


More information about the Trilinos-Users mailing list