FasTensor  1.0.0
Transform Supercomputing for AI
Macros | Functions
ft_array_iterator.h File Reference
#include <array>
#include <iostream>
#include <vector>

Go to the source code of this file.

Macros

#define ITERATOR_MACRO(ordinates_p, start_p, end_p)
 

Functions

void iterate (std::vector< int > &ordinates_p, const std::vector< int > start_p, const std::vector< int > end_p)
 get the next ordinates_p from current ordinates_p call More...
 

Macro Definition Documentation

◆ ITERATOR_MACRO

#define ITERATOR_MACRO (   ordinates_p,
  start_p,
  end_p 
)
Value:
{ \
int dimensions = start_p.size(); \
for (int dimension_index = dimensions - 1; dimension_index >= 0; dimension_index--) \
{ \
if (ordinates_p[dimension_index] < end_p[dimension_index]) \
{ \
ordinates_p[dimension_index]++; \
break; \
} \
ordinates_p[dimension_index] = start_p[dimension_index]; \
} \
}

Function Documentation

◆ iterate()

void iterate ( std::vector< int > &  ordinates_p,
const std::vector< int >  start_p,
const std::vector< int >  end_p 
)
inline

get the next ordinates_p from current ordinates_p call

Author: Bin Dong dbin@.nosp@m.lbl..nosp@m.gov Web: https://crd.lbl.gov/bin-dong Scientific Data Management Research Group Lawrence Berkeley National Laboratory

Parameters
ordinates_p,inputand output for current and next coordinate
start_pis the start range, n-dimensional, including
end_pis the end range, n-dimensional. including