[Trilinos-Users] Usage of Epetra_RowMatrixTransposer
Heroux, Michael A
maherou at sandia.gov
Tue Nov 11 09:44:33 MST 2008
Great. I will make sure that the constructor of this class checks for a zero pointer in the future, so this kind of mistake can be caught.
On 11/11/08 10:35 AM, "andrea3.villa at mail.polimi.it" <andrea3.villa at mail.polimi.it> wrote:
Ok I've fixed the problem, I've made 2 mistakes:
1) The CreateTranspose function call the NEW operator on the pointer
Rcut. Therefore the line:
Epetra_CrsMatrix* Rcut = new Epetra_CrsMatrix(Copy,*mapXp,1);
is useless and creates a memory leak.
2) The destructor of the class Epetra_RowMatrixTransposer DELETEs the
memory pointed by Rcut. This creates a conflict with:
Thank you very much.
Citando "Heroux, Michael A" <maherou at sandia.gov>:
> Hi Andrea,
> Have you checked the return code on the call to CreateTranspose?
> Also, you should not need the "Rcut->FillComplete();" call since
> this is done for you when CreateTranspose is called.
> Finally, unless you know that Tcut has exactly 1 nonzero per row,
> you should not use a "1" for the third argument to the Rcut
> constructor. Instead use a "0".
> If you cannot figure out the error and have a small test case, I am
> happy to look at it.
> On 11/8/08 4:01 AM, "andrea3.villa at mail.polimi.it"
> <andrea3.villa at mail.polimi.it> wrote:
> Good morning.
> I have a problem using Epetra_RowMatrixTransposer. I'm running a test
> code like:
> Epetra_CrsMatrix* Rcut = new Epetra_CrsMatrix(Copy,*mapXp,1);
> Epetra_RowMatrixTransposer Traspositore(Tcut);
> delete Rcut;
> Where Tcut is an already filled FECrsMatrix. I get several
> segmentation fault problems. I've also used valgrind and it defines
> the last code line as: "Invalid free() / delete / delete". Did I use
> the Epetra_RowMatrixTransposer properly?
> Thank you very much.
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Trilinos-Users