Go to the documentation of this file.
50 #ifndef _ZOLTAN2_BASICIDENTIFIERADAPTER_HPP_
51 #define _ZOLTAN2_BASICIDENTIFIERADAPTER_HPP_
81 template <
typename User>
107 std::vector<const scalar_t *> &
weights, std::vector<int> &weightStrides);
117 numIds_(numIds), idList_(idPtr), weights_() {}
130 if (idx < 0 || idx >= weights_.size()) {
131 std::ostringstream emsg;
132 emsg << __FILE__ <<
":" << __LINE__
133 <<
" Invalid weight index " << idx << std::endl;
134 throw std::runtime_error(emsg.str());
137 weights_[idx].getStridedList(length,
weights, stride);
142 const gno_t *idList_;
143 ArrayRCP<StridedData<lno_t, scalar_t> > weights_;
150 template <
typename User>
153 std::vector<const scalar_t *> &
weights, std::vector<int> &weightStrides):
154 numIds_(numIds), idList_(idPtr), weights_()
157 size_t numWeights =
weights.size();
160 weights_ = arcp(
new input_t [numWeights], 0, numWeights,
true);
163 for (
size_t i = 0; i < numWeights; i++){
164 int stride = weightStrides.size() ? weightStrides[i] : 1;
165 ArrayRCP<const scalar_t> wgtV(
weights[i], 0, stride * numIds,
false);
166 weights_[i] = input_t(wgtV, stride);
BasicIdentifierAdapter(lno_t numIds, const gno_t *idPtr, std::vector< const scalar_t * > &weights, std::vector< int > &weightStrides)
Constructor.
void getIDsView(const gno_t *&Ids) const
Provide a pointer to this process' identifiers.
int getNumWeightsPerID() const
Returns the number of weights per object. Number of weights per object should be zero or greater....
This file defines the StridedData class.
This class represents a collection of global Identifiers and their associated weights,...
void getWeightsView(const scalar_t *&weights, int &stride, int idx) const
BasicIdentifierAdapter(lno_t numIds, const gno_t *idPtr)
Constructor.
InputTraits< User >::gno_t gno_t
size_t getLocalNumIDs() const
Returns the number of objects on this process.
InputTraits< User >::scalar_t scalar_t
InputTraits< User >::node_t node_t
InputTraits< User >::part_t part_t
IdentifierAdapter defines the interface for identifiers.
InputTraits< User >::lno_t lno_t
Defines the IdentifierAdapter interface.
The StridedData class manages lists of weights or coordinates.