125 |
getSliceRegion(0:1) => < <0,1> <0,4> <0,6> > |
getSliceRegion(0:1) => < <0,1> <0,4> <0,6> > |
126 |
getSliceRegion(:1,0:2) => < <0,1> <0,2> <0,6> > |
getSliceRegion(:1,0:2) => < <0,1> <0,2> <0,6> > |
127 |
|
|
128 |
|
|
129 |
|
Note: Not unit tested in c++. |
130 |
*/ |
*/ |
131 |
ESCRIPT_DLL_API |
ESCRIPT_DLL_API |
132 |
DataTypes::RegionType |
DataTypes::RegionType |
171 |
getRelIndex(const DataTypes::ShapeType& shape, DataTypes::ValueType::size_type i, |
getRelIndex(const DataTypes::ShapeType& shape, DataTypes::ValueType::size_type i, |
172 |
DataTypes::ValueType::size_type j) |
DataTypes::ValueType::size_type j) |
173 |
{ |
{ |
174 |
EsysAssert((getRank()==2),"Incorrect number of indices for the rank of this object."); |
EsysAssert((getRank(shape)==2),"Incorrect number of indices for the rank of this object."); |
175 |
DataTypes::ValueType::size_type temp=i+j*shape[0]; |
DataTypes::ValueType::size_type temp=i+j*shape[0]; |
176 |
EsysAssert((temp < DataTypes::noValues(shape)), "Error - Invalid index."); |
EsysAssert((temp < DataTypes::noValues(shape)), "Error - Invalid index."); |
177 |
return temp; |
return temp; |
183 |
getRelIndex(const DataTypes::ShapeType& shape, DataTypes::ValueType::size_type i, |
getRelIndex(const DataTypes::ShapeType& shape, DataTypes::ValueType::size_type i, |
184 |
DataTypes::ValueType::size_type j, DataTypes::ValueType::size_type k) |
DataTypes::ValueType::size_type j, DataTypes::ValueType::size_type k) |
185 |
{ |
{ |
186 |
EsysAssert((getRank()==3),"Incorrect number of indices for the rank of this object."); |
EsysAssert((getRank(shape)==3),"Incorrect number of indices for the rank of this object."); |
187 |
DataTypes::ValueType::size_type temp=i+j*shape[0]+k*shape[1]*shape[0]; |
DataTypes::ValueType::size_type temp=i+j*shape[0]+k*shape[1]*shape[0]; |
188 |
EsysAssert((temp < DataTypes::noValues(shape)), "Error - Invalid index."); |
EsysAssert((temp < DataTypes::noValues(shape)), "Error - Invalid index."); |
189 |
return temp; |
return temp; |
196 |
DataTypes::ValueType::size_type j, DataTypes::ValueType::size_type k, |
DataTypes::ValueType::size_type j, DataTypes::ValueType::size_type k, |
197 |
DataTypes::ValueType::size_type m) |
DataTypes::ValueType::size_type m) |
198 |
{ |
{ |
199 |
EsysAssert((getRank()==4),"Incorrect number of indices for the rank of this object."); |
EsysAssert((getRank(shape)==4),"Incorrect number of indices for the rank of this object."); |
200 |
DataTypes::ValueType::size_type temp=i+j*shape[0]+k*shape[1]*shape[0]+m*shape[2]*shape[1]*shape[0]; |
DataTypes::ValueType::size_type temp=i+j*shape[0]+k*shape[1]*shape[0]+m*shape[2]*shape[1]*shape[0]; |
201 |
EsysAssert((temp < DataTypes::noValues(m_shape)), "Error - Invalid index."); |
EsysAssert((temp < DataTypes::noValues(shape)), "Error - Invalid index."); |
202 |
return temp; |
return temp; |
203 |
} |
} |
204 |
|
|
215 |
const DataTypes::ShapeType& other, |
const DataTypes::ShapeType& other, |
216 |
const DataTypes::ShapeType& thisShape); |
const DataTypes::ShapeType& thisShape); |
217 |
|
|
218 |
|
|
219 |
|
/** |
220 |
|
\brief |
221 |
|
Copy a data slice specified by the given region and offset from the |
222 |
|
given view into this view at the given offset. |
223 |
|
|
224 |
|
\param thisOffset - Input - |
225 |
|
Copy the slice to this offset in this view. |
226 |
|
\param other - Input - |
227 |
|
View to copy data from. |
228 |
|
\param otherOffset - Input - |
229 |
|
Copy the slice from this offset in the given view. |
230 |
|
\param region - Input - |
231 |
|
Region in other view to copy data from. |
232 |
|
*/ |
233 |
|
void |
234 |
|
copySlice(ValueType& left, |
235 |
|
const ShapeType& leftShape, |
236 |
|
ValueType::size_type thisOffset, |
237 |
|
const ValueType& other, |
238 |
|
const ShapeType& otherShape, |
239 |
|
ValueType::size_type otherOffset, |
240 |
|
const RegionLoopRangeType& region); |
241 |
|
|
242 |
|
/** |
243 |
|
\brief |
244 |
|
Copy data into a slice specified by the given region and offset in |
245 |
|
this view from the given view at the given offset. |
246 |
|
|
247 |
|
\param thisOffset - Input - |
248 |
|
Copy the slice to this offset in this view. |
249 |
|
\param other - Input - |
250 |
|
View to copy data from. |
251 |
|
\param otherOffset - Input - |
252 |
|
Copy the slice from this offset in the given view. |
253 |
|
\param region - Input - |
254 |
|
Region in this view to copy data to. |
255 |
|
*/ |
256 |
|
void |
257 |
|
copySliceFrom(ValueType& left, |
258 |
|
const ShapeType& leftShape, |
259 |
|
ValueType::size_type thisOffset, |
260 |
|
const ValueType& other, |
261 |
|
const ShapeType& otherShape, |
262 |
|
ValueType::size_type otherOffset, |
263 |
|
const RegionLoopRangeType& region); |
264 |
|
|
265 |
|
|
266 |
} // End namespace DataTypes |
} // End namespace DataTypes |
267 |
|
|
268 |
|
|