NeuralEngine
A Game Engine with embeded Machine Learning algorithms based on Gaussian Processes.
NeLexicoArray2.h
1
11#pragma once
12
13#include <NeCoreLib.h>
14
15namespace NeuralEngine
16{
17
18 // A template class to provide 2D array access that conforms to row-major
19 // order (RowMajor = true) or column-major order (RowMajor = false). The
20 template <bool RowMajor, typename Real, int... Dimensions>
21 class LexicoArray2 {};
22
23 // The array dimensions are known only at run time.
24 template <typename Real>
25 class LexicoArray2<true, Real>
26 {
27 public:
28 inline LexicoArray2(int numRows, int numCols, Real* matrix);
29
30 inline int GetNumRows() const;
31 inline int GetNumCols() const;
32 inline Real& operator()(int r, int c);
33 inline Real const& operator()(int r, int c) const;
34
35 private:
36 int mNumRows, mNumCols;
37 Real* mMatrix;
38 };
39
40 template <typename Real>
41 class LexicoArray2<false, Real>
42 {
43 public:
44 inline LexicoArray2(int numRows, int numCols, Real* matrix);
45
46 inline int GetNumRows() const;
47 inline int GetNumCols() const;
48 inline Real& operator()(int r, int c);
49 inline Real const& operator()(int r, int c) const;
50
51 private:
52 int mNumRows, mNumCols;
53 Real* mMatrix;
54 };
55#include "NeLexicoArray2.inl"
56}