[Trilinos-Users] tuple-indexable matrices?
nico.schloemer at ua.ac.be
Wed Feb 3 16:54:42 MST 2010
sorry for being so sloppy with the question.
The thing is that I got a bit lost amongst the different array-like types
in Trilinos (Teuchos::Array, Teuchos::SerialDenseMatrix,
Teuchos::ArrayView,...) and what the can and cannot do for me.
Are there any directives saying something like "In case you use an array
as this-and-this way, you want to use Teuchos::xyz"?
One particular situation I run into regularly is that I have
Teuchos::Tuple<int,2> objects which I would like to use as indices in an
array, say, and Teuchos::SerialDenseMatrix. I'd now write something like
Teuchos::SerialDenseMatrix<double> A( 100, 100 );
double elementAtI = A( i, i );
It seems a bit silly to ask, but I was asking myself whether there is a
matrix type that could be used like
double elementAtI = A( i );
-- Well, I guess the real problem that I don't know all the array types
after all, so if you could send my links to the Doxygen documentation of
all array-like types, that'd be really helpful.
On Wed, 3 Feb 2010 10:58:49 -0700, "Bartlett, Roscoe A"
<rabartl at sandia.gov> wrote:
> 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:
> 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, i, i )
>> a lot of times, when it's semantically nothing more than
>> A( i )
>> Any ideas?
>> Trilinos-Users mailing list
>> Trilinos-Users at software.sandia.gov
More information about the Trilinos-Users