Weather casting with Machine Learning (SVM and SRNN).

Dependencies:   EthernetInterface GraphicHandler NTPClient SRNN SVM SensorModule mbed-rtos mbed

debug/debug.cpp

Committer:
yukari_hinata
Date:
2015-02-15
Revision:
0:f6cdb984f638

File content as of revision 0:f6cdb984f638:

#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);
}