[Trilinos-Users] Teuchos:: RCP function arguments, reference, derived types

Nico Schlömer nico.schloemer at ua.ac.be
Wed Jan 20 12:37:29 MST 2010


Hi Eric,

> Then you arguments you supply just need to be the same type as the
> argument declaration.  You can always cast them back to a derived type
> later. 
Exactly! I guess for the MultiVector-->Vector conversion I'll just use
Tpetra::MultiVectors's getVectorNonConst(0); that'd be the quickest way
to get the code working.

Thanks!
Nico




On 01/20/2010 08:32 PM, Phipps, Eric T wrote:
> Hi Nico,
>
> Then you arguments you supply just need to be the same type as the
> argument declaration.  You can always cast them back to a derived type
> later.  
>
> -Eric
>
>
> On 1/20/10 11:45 AM, "Nico Schlömer" <nico.schloemer at ua.ac.be> wrote:
>
>     Hi Eric,
>
>     thanks for the clarification.
>
>         The former is preferred because it avoids a copy and is
>         probably what you intended anyway as I assume you do not want
>         to change the RCP itself.
>          
>
>
>     I actually *do -- or so I thought. I'm actually tossing a null
>     pointer into the function, together with a file name and other
>     null pointers, waiting for the function to return pointers to
>     Tpetra::MultiVectors nicely filled from the file.
>
>     Well, I guess I could make sure that the RCPs are non-null at
>     input, and then within the function work on their dereferenced
>     contents.
>
>     Cheers,
>     Nico
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20100120/94acc225/attachment.html 


More information about the Trilinos-Users mailing list