Weather casting with Machine Learning (SVM and SRNN).
Dependencies: EthernetInterface GraphicHandler NTPClient SRNN SVM SensorModule mbed-rtos mbed
Diff: debug/debug.cpp
- Revision:
- 0:f6cdb984f638
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/debug/debug.cpp Sun Feb 15 09:28:23 2015 +0000 @@ -0,0 +1,25 @@ +#include "debug.hpp" + +void print_mat_func(float* mat, int row, int col) { + for (int i = 0; i < row; i++) { + for (int j = 0; j < col; j++) { + if (j == 0) { printf("|"); } + float val = MATRIX_AT(mat,col,i,j); + if (val > 0) { printf(" "); } + printf("%3.3f ",val); + if (j == col-1) { printf("| \r\n"); }; + } + } +} + +void print_vec_func(float* vec, int dim) { + for (int i = 0; i < dim; i++) { + printf("%f ", vec[i]); + } + printf("\r\n"); +} + +void no_memory(void) { + fprintf( stderr, "panic: can't allocate to memory! \r\n"); + exit(1); +}