40 template<typename P_numtype>
59 VectorPick(T_vector& vector, T_indexVector& indexarg)
60 : vector_(vector), index_(indexarg)
63 VectorPick(
const T_pick& vecpick)
64 : vector_(const_cast<T_vector&>(vecpick.vector_)),
65 index_(const_cast<T_indexVector&>(vecpick.index_))
69 : vector_(vecpick.vector_), index_(vecpick.index_[r])
76 T_iterator beginFast()
79 T_constIterator beginFast()
const
88 T_indexVector& indexSet()
91 const T_indexVector& indexSet()
const
95 {
return index_.
length(); }
98 { vector_.reference(x); }
101 { index_.reference(index); }
106 const T_vector& vector()
const
115 int _bz_suggestLength()
const
116 {
return index_.length(); }
118 bool _bz_hasFastAccess()
const
119 {
return vector_._bz_hasFastAccess() && index_._bz_hasFastAccess(); }
121 T_numtype& _bz_fastAccess(
int i)
122 {
return vector_._bz_fastAccess(index_._bz_fastAccess(i)); }
124 T_numtype _bz_fastAccess(
int i)
const
125 {
return vector_._bz_fastAccess(index_._bz_fastAccess(i)); }
127 _bz_VecExpr<T_constIterator> _bz_asVecExpr()
const
128 {
return _bz_VecExpr<T_constIterator>(beginFast()); }
134 T_numtype operator()(
int i)
const
136 BZPRECONDITION(index_.stride() == 1);
137 BZPRECONDITION(vector_.stride() == 1);
138 BZPRECONDITION(i < index_.length());
139 BZPRECONDITION(index_[i] < vector_.length());
140 return vector_(index_(i));
143 T_numtype& operator()(
int i)
145 BZPRECONDITION(index_.stride() == 1);
146 BZPRECONDITION(vector_.stride() == 1);
147 BZPRECONDITION(i < index_.length());
148 BZPRECONDITION(index_[i] < vector_.length());
149 return vector_(index_(i));
152 T_numtype operator[](
int i)
const
154 BZPRECONDITION(index_.stride() == 1);
155 BZPRECONDITION(vector_.stride() == 1);
156 BZPRECONDITION(i < index_.length());
157 BZPRECONDITION(index_[i] < vector_.length());
158 return vector_[index_[
i]];
161 T_numtype& operator[](
int i)
163 BZPRECONDITION(index_.stride() == 1);
164 BZPRECONDITION(vector_.stride() == 1);
165 BZPRECONDITION(i < index_.length());
166 BZPRECONDITION(index_[i] < vector_.length());
167 return vector_[index_[
i]];
172 return T_pick(*
this, index_[r]);
177 return T_pick(*
this, index_[r]);
185 T_pick& operator=(T_numtype);
186 T_pick& operator+=(T_numtype);
187 T_pick& operator-=(T_numtype);
188 T_pick& operator*=(T_numtype);
189 T_pick& operator/=(T_numtype);
190 T_pick& operator%=(T_numtype);
191 T_pick& operator^=(T_numtype);
192 T_pick& operator&=(T_numtype);
193 T_pick& operator|=(T_numtype);
194 T_pick& operator>>=(
int);
195 T_pick& operator<<=(
int);
208 template<
typename P_numtype2> T_pick& operator<<=(const Vector<P_numtype2> &);
211 template<
typename P_expr> T_pick& operator=(_bz_VecExpr<P_expr>);
212 template<
typename P_expr> T_pick& operator+=(_bz_VecExpr<P_expr>);
213 template<
typename P_expr> T_pick& operator-=(_bz_VecExpr<P_expr>);
214 template<
typename P_expr> T_pick& operator*=(_bz_VecExpr<P_expr>);
215 template<
typename P_expr> T_pick& operator/=(_bz_VecExpr<P_expr>);
216 template<
typename P_expr> T_pick& operator%=(_bz_VecExpr<P_expr>);
217 template<
typename P_expr> T_pick& operator^=(_bz_VecExpr<P_expr>);
218 template<
typename P_expr> T_pick& operator&=(_bz_VecExpr<P_expr>);
219 template<
typename P_expr> T_pick& operator|=(_bz_VecExpr<P_expr>);
220 template<
typename P_expr> T_pick& operator>>=(_bz_VecExpr<P_expr>);
221 template<
typename P_expr> T_pick& operator<<=(_bz_VecExpr<P_expr>);
224 T_pick& operator=(
Range);
225 T_pick& operator+=(
Range);
226 T_pick& operator-=(
Range);
227 T_pick& operator*=(
Range);
228 T_pick& operator/=(
Range);
229 T_pick& operator%=(
Range);
230 T_pick& operator^=(
Range);
231 T_pick& operator&=(
Range);
232 T_pick& operator|=(
Range);
233 T_pick& operator>>=(
Range);
234 T_pick& operator<<=(
Range);
237 template<
typename P_numtype2>
239 template<
typename P_numtype2>
241 template<
typename P_numtype2>
243 template<
typename P_numtype2>
245 template<
typename P_numtype2>
247 template<
typename P_numtype2>
249 template<
typename P_numtype2>
251 template<
typename P_numtype2>
253 template<
typename P_numtype2>
255 template<
typename P_numtype2>
257 template<
typename P_numtype2>
258 T_pick& operator<<=(const VectorPick<P_numtype2> &);
261 template<
typename P_distribution>
263 template<
typename P_distribution>
265 template<
typename P_distribution>
267 template<
typename P_distribution>
269 template<
typename P_distribution>
271 template<
typename P_distribution>
273 template<
typename P_distribution>
275 template<
typename P_distribution>
277 template<
typename P_distribution>
283 template<
typename P_expr,
typename P_updater>
284 inline void _bz_assign(P_expr, P_updater);
293 #include <blitz/vecpick.cc>
294 #include <blitz/vecpickio.cc>
297 #endif // BZ_VECPICK_H