#include <math.h>
#include <stdio.h>
#include "riscv_math.h"
#define NB_OF_CLASSES 3
#define VECTOR_DIMENSION 2
#define SEMIHOSTING
const float32_t theta[NB_OF_CLASSES*VECTOR_DIMENSION] = {
1.4539529436590528f, 0.8722776016801852f,
-1.5267934452462473f, 0.903204577814203f,
-0.15338006360932258f, -2.9997913665803964f
};
const float32_t sigma[NB_OF_CLASSES*VECTOR_DIMENSION] = {
1.0063470889514925f, 0.9038018246524426f,
1.0224479953244736f, 0.7768764290432544f,
1.1217662403241206f, 1.2303890106020325f
};
const float32_t classPriors[NB_OF_CLASSES] = {
0.3333333333333333f, 0.3333333333333333f, 0.3333333333333333f
};
int32_t main(void)
{
#if (defined(__riscv_vector))
__RV_CSR_SET(CSR_MSTATUS, 0x200);
#endif
uint32_t index;
in[0] = 1.5f;
in[1] = 1.0f;
maxProba = result[index];
#if defined(SEMIHOSTING)
printf("Class = %d\n", index);
#endif
in[0] = -1.5f;
in[1] = 1.0f;
maxProba = result[index];
#if defined(SEMIHOSTING)
printf("Class = %d\n", index);
#endif
in[0] = 0.0f;
in[1] = -3.0f;
maxProba = result[index];
#if defined(SEMIHOSTING)
printf("Class = %d\n", index);
#endif
printf("Passed\n");
return 0;
}