Kokkos::Permutation< OrdinalType, ScalarType > Class Template Reference

Kokkos::Permutation: Kokkos permutation base class. More...

#include <Kokkos_Permutation.hpp>

Collaboration diagram for Kokkos::Permutation< OrdinalType, ScalarType >:

[legend]
List of all members.

Public Member Functions

Constructors/Destructor.
 Permutation (void)
 Default constructor.
 Permutation (OrdinalType length, const OrdinalType *indices)
 Non-identity permutation constructor.
 Permutation (const Permutation &source)
 Copy constructor.
virtual ~Permutation ()
 Permutation Destructor.
Intialization methods.
virtual int initialize (OrdinalType length, const OrdinalType *indices)
 Defines a nontrivial permutation.
Computational methods.
virtual int apply (const Vector< OrdinalType, ScalarType > &x, Vector< OrdinalType, ScalarType > &y) const
 Returns the result of a Kokkos::Permutation applied to a vector x in y.
virtual int apply (const MultiVector< OrdinalType, ScalarType > &x, MultiVector< OrdinalType, ScalarType > &y) const
 Returns the result of a Kokkos::Permutation applied to multiple vectors in x, results in y.
virtual int applyInverse (const Vector< OrdinalType, ScalarType > &x, Vector< OrdinalType, ScalarType > &y) const
 Returns the result of a Kokkos::Permutation inverse applied to a vector x in y.
virtual int applyInverse (const MultiVector< OrdinalType, ScalarType > &x, MultiVector< OrdinalType, ScalarType > &y) const
 Returns the result of a Kokkos::Permutation inverse applied to multiple vectors in x, results in y.
Permutation Attribute access methods.
virtual OrdinalType getLength () const
 Length (dimension) of permutation operator.
virtual OrdinalType * getIndices () const
 Pointer to the array of indices, returns 0 if permutation is the identity.
virtual bool getIsIdentity () const
 Returns true if the permutation is the identity, otherwise returns false.

Public Attributes

bool isIdentity_
bool dataInitialized_
OrdinalType length_
OrdinalType * indices_

Detailed Description

template<typename OrdinalType, typename ScalarType>
class Kokkos::Permutation< OrdinalType, ScalarType >

Kokkos::Permutation: Kokkos permutation base class.

The Kokkos::Permutation specifies the interface that any permutation class which is intended for use with the Kokkos::Vector and Kokkos::MultiVector classes must implement.

Formally a permutation is a rearrangement of the rows of the identity matrix. Permutations can applied to the left of a matrix or vector, rearranging the rows or entries, respectively. A permutation can also be applied on the right of a matrix (or a vector tranpose), thereby rearranging the columns of the matrix. Permutations also have the property that the inverse and the transpose are identical.

In this class, the default constructors builds an identity permutation (the identity matrix). Non-identity permutations require the specification of an integer array where the array indices will be interpreted as a left permutation by the apply() method such that if j = indices[i], then row j of the operand becomes row i of the result. They will be interpreted as a left inverse permutation by the applyInverse() methods, in which case row i gets mapped back to row j.

This class is most important as a way for a Kokkos::SparseOperation object to define a row, column or two-sided permutation of the matrix that presumably improves performance of the sparse operation. The Kokkos::SparseOperation object is responsible for producing the left and right permutations objects on demand. In turn, these permutation objects can be used to pre-permute vectors and multivectors so that their ordering is compatible with what is required for the sparse operation.


Member Function Documentation

template<typename OrdinalType, typename ScalarType>
int Kokkos::Permutation< OrdinalType, ScalarType >::apply const MultiVector< OrdinalType, ScalarType > &  x,
MultiVector< OrdinalType, ScalarType > &  y
const [virtual]
 

Returns the result of a Kokkos::Permutation applied to multiple vectors in x, results in y.

Parameters:
x (In) A Kokkos::MultiVector to permute.
y (Out) A Kokkos::MultiVector containing results.
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
int Kokkos::Permutation< OrdinalType, ScalarType >::apply const Vector< OrdinalType, ScalarType > &  x,
Vector< OrdinalType, ScalarType > &  y
const [virtual]
 

Returns the result of a Kokkos::Permutation applied to a vector x in y.

Parameters:
x (In) A Kokkos::Vector to permute.
y (Out) A Kokkos::Vector containing results.
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
int Kokkos::Permutation< OrdinalType, ScalarType >::applyInverse const MultiVector< OrdinalType, ScalarType > &  x,
MultiVector< OrdinalType, ScalarType > &  y
const [virtual]
 

Returns the result of a Kokkos::Permutation inverse applied to multiple vectors in x, results in y.

Parameters:
x (In) A Kokkos::MultiVector to permute.
y (Out) A Kokkos::MultiVector containing results.
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
int Kokkos::Permutation< OrdinalType, ScalarType >::applyInverse const Vector< OrdinalType, ScalarType > &  x,
Vector< OrdinalType, ScalarType > &  y
const [virtual]
 

Returns the result of a Kokkos::Permutation inverse applied to a vector x in y.

Parameters:
x (In) A Kokkos::Vector to permute.
y (Out) A Kokkos::Vector containing results.
Returns:
Integer error code, set to 0 if successful.

template<typename OrdinalType, typename ScalarType>
virtual int Kokkos::Permutation< OrdinalType, ScalarType >::initialize OrdinalType  length,
const OrdinalType *  indices
[inline, virtual]
 

Defines a nontrivial permutation.

Post-construction definition of the permutation. The array indices will be interpreted as a left permutation by the apply() method such that if j = indices[i], then row j of the operand becomes row i of the result.

Parameters:
length (Out) Dimension of the permutation.
indices (In) An array of OrdinalType values used to define the permutation.
Warning:
The array indices is NOT copies. The caller of this method is responsible for retaining the indices array for the life of the permutation class.
Returns:
Integer error code, set to 0 if successful.


The documentation for this class was generated from the following file:
Generated on Thu Sep 18 12:37:00 2008 for Kokkos by doxygen 1.3.9.1