To:
x = index % 3;
y = index / 3 % 3;
z = index / 9;
Back:
index = ((z) * 3 + y) * 3 + x;
More Related Contents:
- C++ sorting and keeping track of indexes
- Efficient implementation of log2(__m256d) in AVX2
- How to do an integer log2() in C++?
- how provide a vertex_index property for my graph
- Fast fixed point pow, log, exp and sqrt
- Mapping elements in 2D upper triangle and lower triangle to linear structure
- Find index of returned list result C#
- How to get the CPU cycle count in x86_64 from C++?
- What are the main purposes of using std::forward and which problems it solves?
- How to initialize private static members in C++?
- What are access specifiers? Should I inherit with private, protected or public?
- How do I print UTF-8 from c++ console application on Windows
- Compiling multithread code with g++
- In C/C++ what’s the simplest way to reverse the order of bits in a byte?
- What is shared_ptr’s aliasing constructor for?
- Effective C++ Item 23 Prefer non-member non-friend functions to member functions
- Bjarne Stroustrup says we must avoid linked lists
- How to choose between map and unordered_map?
- Converting from signed char to unsigned char and back again?
- Difference between Enum and Define Statements
- Boost::asio – how to interrupt a blocked tcp server thread?
- What distinguishes the declaration, the definition and the initialization of a variable?
- What does X f() mean?
- accessing a protected member of a base class in another subclass
- Increase stack size in c++
- What is a scalar Object in C++?
- error: Class has not been declared despite header inclusion, and the code compiling fine elsewhere
- Are the character digits [‘0’..’9′] required to have contiguous numeric values?
- Is there a guarantee of stdout auto-flush before exit? How does it work?
- C++ — How to overload operator+=?