示例#1
0
 IndexMapType indexmap() const {
  // extract strides and lengths
  const size_t dim =arr_obj->nd; 
  std::vector<size_t> lengths (dim);
  std::vector<std::ptrdiff_t> strides(dim); 
  for (size_t i=0; i< dim ; ++i) {
   lengths[i] = size_t(arr_obj-> dimensions[i]); 
   strides[i] = std::ptrdiff_t(arr_obj-> strides[i])/sizeof(ValueType);
  }
  return IndexMapType (mini_vector<size_t,IndexMapType::rank>(lengths), mini_vector<std::ptrdiff_t,IndexMapType::rank>(strides),0);
 }
示例#2
0
 IndexMapType indexmap() const { return IndexMapType (lengths,strides,0); }