Zoltan 2 Version 0.5
Public Member Functions
Zoltan2::StridedData< lno_t, scalar_t > Class Template Reference

The StridedData class manages lists of weights or coordinates. More...

#include <Zoltan2_StridedData.hpp>

Collaboration diagram for Zoltan2::StridedData< lno_t, scalar_t >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 StridedData (ArrayRCP< const scalar_t > x, int stride)
 Constructor.
 StridedData ()
 Default constructor. A zero-length strided array.
lno_t size () const
 Return the length of the strided array.
scalar_t operator[] (lno_t idx) const
 Access an element of the input array.
template<typename T >
void getInputArray (ArrayRCP< const T > &array) const
 Create a contiguous array of the required type, perhaps for a TPL.
void getStridedList (ArrayRCP< const scalar_t > &vec, int &stride) const
 Get a reference counted pointer to the input.
void getStridedList (size_t &len, const scalar_t *&vec, int &stride) const
 Get the raw input information.
StridedDataoperator= (const StridedData &sInput)
 Assignment operator.

Detailed Description

template<typename lno_t, typename scalar_t>
class Zoltan2::StridedData< lno_t, scalar_t >

The StridedData class manages lists of weights or coordinates.

A likely representation for multi-dimensional weights or coordinates is an array ordered by identifier by dimension, or vice versa. The purposes of this class:

If we need to modify weights (say convert floating point weights to integers for a third party library) methods to do this could be added here.

Definition at line 76 of file Zoltan2_StridedData.hpp.


Constructor & Destructor Documentation

template<typename lno_t , typename scalar_t >
Zoltan2::StridedData< lno_t, scalar_t >::StridedData ( ArrayRCP< const scalar_t x,
int  stride 
) [inline]

Constructor.

Parameters:
xx[0] is the first element of the array. The subsequent elements are at x[i * stride].
stridethe stride of the elements in the strided array.

Definition at line 89 of file Zoltan2_StridedData.hpp.

template<typename lno_t , typename scalar_t >
Zoltan2::StridedData< lno_t, scalar_t >::StridedData ( ) [inline]

Default constructor. A zero-length strided array.

Definition at line 94 of file Zoltan2_StridedData.hpp.


Member Function Documentation

template<typename lno_t , typename scalar_t >
lno_t Zoltan2::StridedData< lno_t, scalar_t >::size ( ) const [inline]

Return the length of the strided array.

The length may be longer than the number of values because the stride may be greater than one.

Definition at line 101 of file Zoltan2_StridedData.hpp.

template<typename lno_t , typename scalar_t >
scalar_t Zoltan2::StridedData< lno_t, scalar_t >::operator[] ( lno_t  idx) const [inline]

Access an element of the input array.

Parameters:
idxThe logical index of the element in the strided array.

For performance, this is inline and no error checking.

Definition at line 109 of file Zoltan2_StridedData.hpp.

template<typename lno_t , typename scalar_t >
template<typename T >
void Zoltan2::StridedData< lno_t, scalar_t >::getInputArray ( ArrayRCP< const T > &  array) const

Create a contiguous array of the required type, perhaps for a TPL.

TODO: if are there particular conversions we would like to do for TPLs, we can add methods to do that. Here we just essentially cast. If the cast is not valid (like double to float) an exception is thrown.

Definition at line 160 of file Zoltan2_StridedData.hpp.

template<typename lno_t , typename scalar_t >
void Zoltan2::StridedData< lno_t, scalar_t >::getStridedList ( ArrayRCP< const scalar_t > &  vec,
int &  stride 
) const [inline]

Get a reference counted pointer to the input.

Parameters:
vecon return is a reference counted pointer to the input. Element k is at vec[k*stride].
strideis describes the layout of the input in vec.

Definition at line 127 of file Zoltan2_StridedData.hpp.

template<typename lno_t , typename scalar_t >
void Zoltan2::StridedData< lno_t, scalar_t >::getStridedList ( size_t &  len,
const scalar_t *&  vec,
int &  stride 
) const [inline]

Get the raw input information.

Parameters:
lenon return is the length of storage at vec. This will be some multiple of stride.
vecon return is a pointer to the input. Element k is at vec[k*stride].
strideis describes the layout of the input in vec.

Definition at line 140 of file Zoltan2_StridedData.hpp.

template<typename lno_t , typename scalar_t >
StridedData& Zoltan2::StridedData< lno_t, scalar_t >::operator= ( const StridedData< lno_t, scalar_t > &  sInput) [inline]

Assignment operator.

Definition at line 149 of file Zoltan2_StridedData.hpp.


The documentation for this class was generated from the following file: