Demo program for Array class and Matrix class.

Dependencies:   Array_Matrix mbed

Revision:
3:2649800966bb
Parent:
1:3df59f65bdcc
Child:
4:c6d4d3e9ddd7
--- a/main.cpp	Mon Aug 15 07:11:44 2016 +0000
+++ b/main.cpp	Tue Nov 19 05:45:33 2019 +0000
@@ -1,7 +1,7 @@
 //------------------------------------------------------------
 //  Demo program for Array class and Matrix class
 //
-//  2016/07/25, Copyright (c) 2016 MIKAMI, Naoki
+//  2019/11/19, Copyright (c) 2016 MIKAMI, Naoki
 //------------------------------------------------------------
 
 #define DEBUG_ARRAY_CHECK   // Range check of index available
@@ -17,14 +17,14 @@
 
 int main()
 {
-
     // Test of Array class
     Array<int> sn(10);
     sn[9] = 0;
+//    sn[10] = 0;   // Out of range error
     
-//    Array<uint8_t> a1(100000);  // Size error
+//    Array<uint8_t> a1(1000000);  // Size error (Nucleo-F446RE)
     Array<uint8_t> a1(10000);
-    printf("OK\r\n");
+    printf("\r\nMemory allocation: OK\r\n");
     
     const int N1 = 10;
     Array<float> x1(N1), x2, x3;
@@ -37,7 +37,7 @@
         printf("%8.4f, %8.4f, %8.4f\r\n", x1[n], x2[n], x3[n]);
     printf("\r\n");
     
-    // Initialized by built-in array
+    // Initialization by built-in array
     Array<int> xInt(5, (int[]){ 4, 1, -3, 9, -5});
     for (int n=0; n<xInt.Length(); n++)
         printf("xInt[%d] = %d\r\n", n, xInt[n]);
@@ -75,5 +75,4 @@
             printf("%3d", x[n1][n2]);
         printf("\r\n");
     }
-}
-
+}
\ No newline at end of file