[Trilinos-Users] tuple-indexable matrices?

Bartlett, Roscoe A rabartl at sandia.gov
Wed Feb 3 10:58:49 MST 2010


Nico,

I am not sure what you are asking.  Is this a class of your own that you are writing that represents 'A'?  If you want to accept an array of indexes, I would declare this as:

    someFunc( const ArrayView<dconst int> &indexes );

You would then call this as:

    someFunc(i);

Note that all the Teuchos array types Tuple, Array, and ArrayRCP can all be converted into an ArrayView.  You can declare 'i' to be any of these Array types and the implicit conversion to ArrayView will take place.

Does this help?

- Ross



> -----Original Message-----
> From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-
> users-bounces at software.sandia.gov] On Behalf Of Nico Schlömer
> Sent: Wednesday, February 03, 2010 10:14 AM
> To: trilinos-users at software.sandia.gov
> Subject: [Trilinos-Users] tuple-indexable matrices?
> 
> Hi all,
> 
> I'm looking at dense vectors which can be indexed by some sort of tuple
> (e.g., Teuchos::Tuple).
> Currently I find myself writing something like
> 
>    A( i[0], i[1], i[2] )
> 
> a lot of times, when it's semantically nothing more than
> 
>    A( i )
> 
> Any ideas?
> 
> Cheers,
> Nico
> 
> _______________________________________________
> Trilinos-Users mailing list
> Trilinos-Users at software.sandia.gov
> http://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list