diff --git a/quad/computation_graph/src/node_pow.c b/quad/computation_graph/src/node_pow.c index 2e817fc39d8bc227b7d876ad98f7f3c40bd03448..dbbc1d707d7833254e5a96a4dc8ba2b9c954ae4d 100644 --- a/quad/computation_graph/src/node_pow.c +++ b/quad/computation_graph/src/node_pow.c @@ -1,26 +1,26 @@ -#include "node_pow.h" -#include <stdlib.h> -#include <math.h> - -static void pow_nodes(void *state, const double* params, const double *inputs, double *outputs) { - outputs[POW_RESULT] = pow(inputs[POW_BASE], params[POW_EXP]); -} -static void reset(void *state) {} - -static const char* const in_names[1] = {"Base"}; -static const char* const out_names[1] = {"Result"}; -static const char* const param_names[1] = {"Exponent"}; -const struct graph_node_type node_pow_type = { - .input_names = in_names, - .output_names = out_names, - .param_names = param_names, - .n_inputs = 1, - .n_outputs = 1, - .n_params = 1, - .execute = pow_nodes, - .reset = reset -}; - -int graph_add_node_pow(struct computation_graph *graph, const char* name) { - return graph_add_node(graph, name, &node_pow_type, NULL); -} +#include "node_pow.h" +#include <stdlib.h> +#include <math.h> + +static void pow_nodes(void *state, const double* params, const double *inputs, double *outputs) { + outputs[POW_RESULT] = pow(inputs[POW_BASE], params[POW_EXP]); +} +static void reset(void *state) {} + +static const char* const in_names[1] = {"Base"}; +static const char* const out_names[1] = {"Result"}; +static const char* const param_names[1] = {"Exponent"}; +const struct graph_node_type node_pow_type = { + .input_names = in_names, + .output_names = out_names, + .param_names = param_names, + .n_inputs = 1, + .n_outputs = 1, + .n_params = 1, + .execute = pow_nodes, + .reset = reset +}; + +int graph_add_node_pow(struct computation_graph *graph, const char* name) { + return graph_add_node(graph, name, &node_pow_type, NULL); +}