@@ -30,9 +30,9 @@ class NdMatrixProxy {
30
30
* @brief Construct a matrix proxy object
31
31
*
32
32
* @param dim_sizes: Array of dimension sizes
33
- * @param idim: The dimension associated with this proxy
34
33
* @param dim_stride: The stride of this dimension (i.e. how many element in memory between indicies of this dimension)
35
- * @param start: Pointer to the start of the sub-matrix this proxy represents
34
+ * @param offset: The offset from the start that this sub-matrix starts at.
35
+ * @param start: Pointer to the start of the base NDMatrix of this proxy
36
36
*/
37
37
NdMatrixProxy (const size_t * dim_sizes, const size_t * dim_strides, size_t offset, const std::unique_ptr<T[]>& start)
38
38
: dim_sizes_(dim_sizes)
@@ -62,9 +62,21 @@ class NdMatrixProxy {
62
62
}
63
63
64
64
private:
65
+ // / @brief The sizes of each dimension of this proxy. This is an array of
66
+ // / length N.
65
67
const size_t * dim_sizes_;
68
+
69
+ // / @brief The stride of each dimension of this proxy. This is an array of
70
+ // / length N.
66
71
const size_t * dim_strides_;
72
+
73
+ // / @brief The offset from the base NDMatrix object that this sub-matrix
74
+ // / starts at.
67
75
size_t offset_;
76
+
77
+ // / @brief The pointer to the start of the base NDMatrix data. Since the
78
+ // / base NDMatrix object owns the memory, we hold onto a reference
79
+ // / to its unique pointer. This is safer than passing a bare pointer.
68
80
const std::unique_ptr<T[]>& start_;
69
81
};
70
82
@@ -77,7 +89,8 @@ class NdMatrixProxy<T, 1> {
77
89
*
78
90
* @param dim_sizes: Array of dimension sizes
79
91
* @param dim_stride: The stride of this dimension (i.e. how many element in memory between indicies of this dimension)
80
- * @param start: Pointer to the start of the sub-matrix this proxy represents
92
+ * @param offset: The offset from the start that this sub-matrix starts at.
93
+ * @param start: Pointer to the start of the base NDMatrix of this proxy
81
94
*/
82
95
NdMatrixProxy (const size_t * dim_sizes, const size_t * dim_stride, size_t offset, const std::unique_ptr<T[]>& start)
83
96
: dim_sizes_(dim_sizes)
@@ -122,9 +135,21 @@ class NdMatrixProxy<T, 1> {
122
135
}
123
136
124
137
private:
138
+ // / @brief The sizes of each dimension of this proxy. This is an array of
139
+ // / length N.
125
140
const size_t * dim_sizes_;
141
+
142
+ // / @brief The stride of each dimension of this proxy. This is an array of
143
+ // / length N.
126
144
const size_t * dim_strides_;
145
+
146
+ // / @brief The offset from the base NDMatrix object that this sub-matrix
147
+ // / starts at.
127
148
size_t offset_;
149
+
150
+ // / @brief The pointer to the start of the base NDMatrix data. Since the
151
+ // / base NDMatrix object owns the memory, we hold onto a reference
152
+ // / to its unique pointer. This is safer than passing a bare pointer.
128
153
const std::unique_ptr<T[]>& start_;
129
154
};
130
155
0 commit comments