I've been searching for examples via Google searches and here on StackOverflow, and I still haven't found anything conclusive to satisfy my understanding.
I've seen posts about the differences between the types and what they are, but nothing conclusive on when I should prefer to use one over the other...
For my current project, I'm working on a Matrix class that will be used to perform the calculations for a Neural Network in the field of A.I. programming and I'm looking for fast calculations with a high probability to utilize AVX instructions or other Vector type registers...
consider the following code snippet:
#incluce <cstdint>
#include <limits>
#include <numeric>
class Matrix64 {
std::int64_t rows_, columns_;
std::int64_t size_;
public:
Matrix64(std::int64_t rows, std::int64_t cols)
: rows_{rows}, cols_{cols}, size_{rows*cols}
{}
};
class MatrixFast64 {
std::int_fast64_t rows_, columns_;
std::int_fast64_t size_;
public:
MatrixFast64(std::int_fast64_t rows, std::int_fast64_t cols)
: rows_{rows}, cols_{cols}, size_{rows*cols}
{}
};
Which of the two-class examples would be the appropriate choice? When should one type be preferred over the other? This question is centered around the context of knowing when it is appropriate to use one or the other. I feel that this is important when making design decisions.