From 9548c8b91f17e2705f004c562b9015d2e9ab5b33 Mon Sep 17 00:00:00 2001 From: Peter Boyle Date: Thu, 11 Feb 2016 07:40:09 -0600 Subject: [PATCH] Had to break this out for universal access through the code base. --- lib/Lexicographic.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 lib/Lexicographic.h diff --git a/lib/Lexicographic.h b/lib/Lexicographic.h new file mode 100644 index 00000000..2d4e5df5 --- /dev/null +++ b/lib/Lexicographic.h @@ -0,0 +1,32 @@ +#ifndef GRID_LEXICOGRAPHIC_H +#define GRID_LEXICOGRAPHIC_H + + +namespace Grid{ + + class Lexicographic { + public: + + static inline void CoorFromIndex (std::vector& coor,int index,std::vector &dims){ + int nd= dims.size(); + coor.resize(nd); + for(int d=0;d& coor,int &index,std::vector &dims){ + int nd=dims.size(); + int stride=1; + index=0; + for(int d=0;d