#define ADOLC_TAPELESS #define NUMBER_DIRECTIONS 9 #include "adolc/adouble.h" #include #include using namespace std; #define N_SAMPLES 4 #define N_IN 2 #define N_OUT 1 #define LAYERS 2 #define ELEMENTS_LAYER1 2 #define ELEMENTS_LAYER2 1 #define ELEMENTS_LAYER_MAX 2 #define WEIGHTS 3 struct w_layer { int n; int w; adtl::adouble **layer;}; adtl::adouble magnitude_squared(int n_x, adtl::adouble *x) { adtl::adouble r = 0.0; int j; for (j = 0; j