Generic class libraries for 1D array and 2D array: Array and Matrix. 1次元および2次元配列用の汎用クラスライブラリ: Array と Matrix.

Dependents:   F746_SD_WavPlayer CW_Decoder_using_FFT_on_F446 F446_MySoundMachine F446_ADF_Nlms ... more

Revision:
4:d3aa1ddb57e1
Parent:
0:efe9b1f01090
--- a/Matrix.hpp	Tue Nov 19 05:44:54 2019 +0000
+++ b/Matrix.hpp	Sat Dec 19 08:22:52 2020 +0000
@@ -1,7 +1,7 @@
 //------------------------------------------------------------------------------
 //  Generic 2-dimensional array class ---- Matrix
 //
-//  2016/05/22, Copyright (c) 2016 MIKAMI, Naoki
+//  2020/12/19, Copyright (c) 2020 MIKAMI, Naoki
 //------------------------------------------------------------------------------
 
 #ifndef MIKAMI_MATRIX_HPP
@@ -15,11 +15,11 @@
     {
     public:
         explicit Matrix(int rows = 1, int cols = 1);
-        Matrix(int rows, int cols, T initialValue);
+        Matrix(int rows, int cols, T initialVal);
         void Fill(T val);
         void SetSize(int rows, int cols);                           // setting size
         Array<T>& operator[](int i) { return vv_[i]; }              // assign by element
-        const Array<T>& operator[](int i) const { return vv_[i]; }  //get element
+        const Array<T>& operator[](int i) const { return vv_[i]; }  // get element
         int Rows() const { return vv_.Length(); }
         int Cols() const { return vv_[0].Length(); }
     private:
@@ -35,10 +35,10 @@
         for (int i=0; i<rows; i++) vv_[i] = a;
     }
 
-    template <class T> Matrix<T>::Matrix(int rows, int cols, T initialValue)
+    template <class T> Matrix<T>::Matrix(int rows, int cols, T initialVal)
             : vv_(rows)
     {
-        Array<T> a(cols, initialValue);
+        Array<T> a(cols, initialVal);
         for (int i=0; i<rows; i++) vv_[i] = a;
     }
 
@@ -54,5 +54,4 @@
         for (int i=0; i<rows; i++) vv_[i] = a;
     }
 }
-#endif  // MIKAMI_MATRIX_HPP
-
+#endif  // MIKAMI_MATRIX_HPP
\ No newline at end of file