patch-src_Matrix_hpp 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. $OpenBSD: patch-src_Matrix_hpp,v 1.3 2017/04/27 21:09:57 espie Exp $
  2. --- src/Matrix.hpp.orig Tue Mar 11 16:47:04 2008
  3. +++ src/Matrix.hpp Thu Apr 27 22:43:53 2017
  4. @@ -187,14 +187,14 @@ namespace gpstk
  5. * @warning be careful that array is as large as the matrix is!
  6. */
  7. inline Matrix& operator=(const T* array)
  8. - { return assignFrom(array); }
  9. + { return this->assignFrom(array); }
  10. /// Assigns the contents of this matrix to those in array in column
  11. /// major order.
  12. inline Matrix& operator=(const std::valarray<T> array)
  13. - { return assignFrom(array); }
  14. + { return this->assignFrom(array); }
  15. /// Assigns all elements of the matrix to \c t.
  16. inline Matrix& operator=(const T t)
  17. - { return assignFrom(t); }
  18. + { return this->assignFrom(t); }
  19. /// Copies the other matrix.
  20. inline Matrix& operator=(const Matrix& mat)
  21. { v = mat.v; r = mat.r; c = mat.c; s = mat.s; return *this; }
  22. @@ -206,12 +206,12 @@ namespace gpstk
  23. r=mat.rows();
  24. c=mat.cols();
  25. s=mat.size();
  26. - return assignFrom(mat);
  27. + return this->assignFrom(mat);
  28. }
  29. /// Copies from any vector.
  30. template <class BaseClass>
  31. inline Matrix& operator=(const ConstVectorBase<T, BaseClass>& mat)
  32. - { return assignFrom(mat); }
  33. + { return this->assignFrom(mat); }
  34. private:
  35. /// the matrix stored in column major order
  36. @@ -238,7 +238,7 @@ namespace gpstk
  37. : m(&mat), rSlice(std::slice(0, mat.rows(), 1)),
  38. cSlice(std::slice(0,mat.cols(), 1)), s(mat.size())
  39. {
  40. - matSliceCheck(mat.rows(), mat.cols());
  41. + this->matSliceCheck(mat.rows(), mat.cols());
  42. }
  43. /// Makes a partial slice of a matrix.
  44. @@ -247,7 +247,7 @@ namespace gpstk
  45. : m(&mat), rSlice(rowSlice), cSlice(colSlice),
  46. s(rSlice.size() * cSlice.size())
  47. {
  48. - matSliceCheck(mat.rows(), mat.cols());
  49. + this->matSliceCheck(mat.rows(), mat.cols());
  50. }
  51. /// Submatrix slice.
  52. @@ -257,28 +257,28 @@ namespace gpstk
  53. cSlice(std::slice(topCol, numCols, 1)),
  54. s(rSlice.size() * cSlice.size())
  55. {
  56. - matSliceCheck(mat.rows(), mat.cols());
  57. + this->matSliceCheck(mat.rows(), mat.cols());
  58. }
  59. /// Copies from x to (*this).
  60. template <class V>
  61. MatrixSlice& operator=(const ConstMatrixBase<T, V>& x)
  62. - { return assignFrom(x); }
  63. + { return this->assignFrom(x); }
  64. /// Copies from x to (*this).
  65. template <class V>
  66. MatrixSlice& operator=(const ConstVectorBase<T, V>& x)
  67. - { return assignFrom(x); }
  68. + { return this->assignFrom(x); }
  69. /// Copies from x to (*this).
  70. MatrixSlice& operator=(const std::valarray<T>& x)
  71. - { return assignFrom(x); }
  72. + { return this->assignFrom(x); }
  73. /// Copies from x to (*this).
  74. MatrixSlice& operator=(const T x)
  75. - { return assignFrom(x); }
  76. + { return this->assignFrom(x); }
  77. /// Copies from x to (*this).
  78. MatrixSlice& operator=(const T* x)
  79. - { return assignFrom(x); }
  80. + { return this->assignFrom(x); }
  81. /// returns the size of this slice
  82. size_t size() const { return s; }
  83. @@ -334,7 +334,7 @@ namespace gpstk
  84. : m(&mat), rSlice(std::slice(0, mat.rows(), 1)),
  85. cSlice(std::slice(0,mat.cols(), 1)), s(mat.size())
  86. {
  87. - matSliceCheck(mat.rows(), mat.cols());
  88. + this->matSliceCheck(mat.rows(), mat.cols());
  89. }
  90. /// makes a slice given std::slices for rows and columns
  91. @@ -343,7 +343,7 @@ namespace gpstk
  92. : m(&mat), rSlice(rowSlice), cSlice(colSlice),
  93. s(rSlice.size() * cSlice.size())
  94. {
  95. - matSliceCheck(mat.rows(), mat.cols());
  96. + this->matSliceCheck(mat.rows(), mat.cols());
  97. }
  98. /// submatrix slice
  99. @@ -353,7 +353,7 @@ namespace gpstk
  100. cSlice(std::slice(topCol, numCols, 1)),
  101. s(rSlice.size() * cSlice.size())
  102. {
  103. - matSliceCheck(mat.rows(), mat.cols());
  104. + this->matSliceCheck(mat.rows(), mat.cols());
  105. }
  106. /// the size of the slice
  107. @@ -400,7 +400,7 @@ namespace gpstk
  108. MatrixColSlice(Matrix<T>& mat, size_t col)
  109. : m(&mat), c(col), rSlice(std::slice(0,mat.rows(),1))
  110. {
  111. - matSliceCheck(mat.rows(), mat.cols());
  112. + this->matSliceCheck(mat.rows(), mat.cols());
  113. }
  114. /// makes a slice of the column from the matrix using \c s to
  115. /// further slice the column.
  116. @@ -408,27 +408,27 @@ namespace gpstk
  117. : m(&mat), c(col), rSlice(s)
  118. {
  119. // decide if the input is reasonable
  120. - matSliceCheck(mat.rows(), mat.cols());
  121. + this->matSliceCheck(mat.rows(), mat.cols());
  122. }
  123. /// assigns this column to x
  124. template <class V>
  125. MatrixColSlice& operator=(const ConstMatrixBase<T, V>& x)
  126. - { return assignFrom(x); }
  127. + { return this->assignFrom(x); }
  128. /// assigns this column to x
  129. template <class V>
  130. MatrixColSlice& operator=(const ConstVectorBase<T, V>& x)
  131. - { return assignFrom(x); }
  132. + { return this->assignFrom(x); }
  133. /// assigns this column to x
  134. MatrixColSlice& operator=(const std::valarray<T>& x)
  135. - { return assignFrom(x); }
  136. + { return this->assignFrom(x); }
  137. /// assigns this column to x
  138. MatrixColSlice& operator=(const T x)
  139. - { return assignFrom(x); }
  140. + { return this->assignFrom(x); }
  141. /// assigns this column to x
  142. MatrixColSlice& operator=(const T* x)
  143. - { return assignFrom(x); }
  144. + { return this->assignFrom(x); }
  145. /// returns the i'th element of the column, non-const
  146. T& operator[] (size_t i)
  147. @@ -495,7 +495,7 @@ namespace gpstk
  148. /// constructor taking a slice of column \c col from the matrix.
  149. ConstMatrixColSlice(const Matrix<T>& mat, size_t col)
  150. : m(&mat), c(col), rSlice(std::slice(0,mat.rows(),1))
  151. - { matSliceCheck(mat.rows(), mat.cols()); }
  152. + { this->matSliceCheck(mat.rows(), mat.cols()); }
  153. /// constructor taking a slice of column \c col from the matrix,
  154. /// slicing the column by \c s.
  155. @@ -504,7 +504,7 @@ namespace gpstk
  156. : m(&mat), c(col), rSlice(s)
  157. {
  158. // decide if the input is reasonable
  159. - matSliceCheck(mat.rows(), mat.cols());
  160. + this->matSliceCheck(mat.rows(), mat.cols());
  161. }
  162. /// returns the i'th element of the column slice
  163. @@ -560,7 +560,7 @@ namespace gpstk
  164. /// makes a slice of row \c row from the matrix.
  165. MatrixRowSlice(Matrix<T>& mat, size_t row)
  166. : m(&mat), r(row), cSlice(std::slice(0,mat.cols(),1))
  167. - { matSliceCheck(mat.rows(), mat.cols()); }
  168. + { this->matSliceCheck(mat.rows(), mat.cols()); }
  169. /// makes a slice of row \c row from the matrix, slicing it by \c s.
  170. MatrixRowSlice(Matrix<T>& mat, size_t row,
  171. @@ -568,26 +568,26 @@ namespace gpstk
  172. : m(&mat), r(row), cSlice(s)
  173. {
  174. // decide if the input is reasonable
  175. - matSliceCheck(mat.rows(), mat.cols());
  176. + this->matSliceCheck(mat.rows(), mat.cols());
  177. }
  178. /// assigns this row to x.
  179. template <class V>
  180. MatrixRowSlice& operator=(const ConstMatrixBase<T, V>& x)
  181. - { return assignFrom(x); }
  182. + { return this->assignFrom(x); }
  183. /// assigns this row to x.
  184. template <class V>
  185. MatrixRowSlice& operator=(const ConstVectorBase<T, V>& x)
  186. - { return assignFrom(x); }
  187. + { return this->assignFrom(x); }
  188. /// assigns this row to x.
  189. MatrixRowSlice& operator=(const std::valarray<T>& x)
  190. - { return assignFrom(x); }
  191. + { return this->assignFrom(x); }
  192. /// assigns this row to x.
  193. MatrixRowSlice& operator=(const T x)
  194. - { return assignFrom(x); }
  195. + { return this->assignFrom(x); }
  196. /// assigns this row to x.
  197. MatrixRowSlice& operator=(const T* x)
  198. - { return assignFrom(x); }
  199. + { return this->assignFrom(x); }
  200. /// returns the j'th element of the slice, non-const
  201. T& operator[] (size_t j)
  202. @@ -651,7 +651,7 @@ namespace gpstk
  203. /// makes a const row slice from the matrix
  204. ConstMatrixRowSlice(const Matrix<T>& mat, size_t row)
  205. : m(&mat), r(row), cSlice(std::slice(0,mat.cols(),1))
  206. - { matSliceCheck(mat.rows(), mat.cols()); }
  207. + { this->matSliceCheck(mat.rows(), mat.cols()); }
  208. /// makes a const row slice from the matrix, slicing that row by \c s.
  209. ConstMatrixRowSlice(const Matrix<T>& mat, size_t row,
  210. @@ -659,7 +659,7 @@ namespace gpstk
  211. : m(&mat), r(row), cSlice(s)
  212. {
  213. // decide if the input is reasonable
  214. - matSliceCheck(mat.rows(), mat.cols());
  215. + this->matSliceCheck(mat.rows(), mat.cols());
  216. }
  217. /// returns the i'th element of the slice