[libfann] 190/242: changed indention scheme to use "-l100 -lc100 -ts4 -i4 -sc -bli0 -bl0 -cbi0 -ss -npcs -npsl -di2 -nbc -bls -lp -nbbo -nsaf -nsai -nsaw -bap"

Christian Kastner chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:10:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

chrisk-guest pushed a commit to tag Version2_0_0
in repository libfann.

commit 0f03bb7c65268d6d116adfc90d1ca707d62ab3c5
Author: Steffen Nissen <lukesky at diku.dk>
Date:   Mon Aug 1 20:51:43 2005 +0000

    changed indention scheme to use "-l100 -lc100 -ts4 -i4 -sc -bli0 -bl0 -cbi0 -ss -npcs -npsl -di2 -nbc -bls -lp -nbbo -nsaf -nsai -nsaw -bap"
---
 benchmarks/parity.c           |  95 +++---
 benchmarks/performance.cc     | 185 ++++++-----
 benchmarks/quality.cc         | 383 +++++++++++++----------
 benchmarks/quality_fixed.c    |  39 ++-
 benchmarks/shuffle.c          |  34 +-
 benchmarks/two-spirals.c      | 155 ++++-----
 examples/cascade_train.c      | 129 ++++----
 examples/mushroom.c           |  21 +-
 examples/robot.c              |  21 +-
 examples/simple_test.c        |   7 +-
 examples/simple_train.c       |  15 +-
 examples/steepness_train.c    |  64 ++--
 examples/xor_test.c           |  19 +-
 examples/xor_train.c          |  34 +-
 src/fann_cascade.c            | 705 ++++++++++++++++++++++++-----------------
 src/fann_error.c              |  48 ++-
 src/fann_io.c                 | 487 +++++++++++++++++------------
 src/fann_options.c            | 162 ++++++----
 src/fann_train.c              | 509 +++++++++++++++++-------------
 src/include/compat_time.h     | 202 ++++++------
 src/include/doublefann.h      |   1 +
 src/include/fann.h            | 707 ++++++++++++++++++++++++------------------
 src/include/fann_activation.h |  99 +++---
 src/include/fann_data.h       |  78 ++---
 src/include/fann_errno.h      |  74 ++---
 src/include/fann_internal.h   |  41 ++-
 src/include/fixedfann.h       |   1 +
 src/include/floatfann.h       |   1 +
 28 files changed, 2450 insertions(+), 1866 deletions(-)

diff --git a/benchmarks/parity.c b/benchmarks/parity.c
index 8269fc2..ca2e81a 100755
--- a/benchmarks/parity.c
+++ b/benchmarks/parity.c
@@ -16,7 +16,7 @@
 	 ~~~~~~~~~~~
 	   This program generates parity benchmark data in the CMU Neural 
          Network Benchmark format. 
-*/ 
+*/
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -26,18 +26,18 @@
 
 /*      Function Prototypes      */
 
-void getCommandLine ( int *, int, char ** );
-void printHeader    ( int );
-void printSet       ( int );
+void getCommandLine(int *, int, char **);
+void printHeader(int);
+void printSet(int);
 
 
-int main  ( int argc, char **argv )
+int main(int argc, char **argv)
 {
-  int inputs;    /* Number of inputs into the neural network */   
+	int inputs;					/* Number of inputs into the neural network */
 
-  getCommandLine ( &inputs, argc, argv );
-  printHeader    ( inputs );
-  printSet       ( inputs );
+	getCommandLine(&inputs, argc, argv);
+	printHeader(inputs);
+	printSet(inputs);
 }
 
 
@@ -47,18 +47,18 @@ int main  ( int argc, char **argv )
         Invalid arguments are flagged and an error is produced.
 */
 
-void getCommandLine  ( int *inputs, int argc, char **argv )
+void getCommandLine(int *inputs, int argc, char **argv)
 {
-  if  ( argc < 2 )
-    *inputs = 2;
-  else  
-    if  ( ( **(argv+1) >= '0' ) && ( **(argv+1) <= '9' ) )
-      *inputs = atoi( *(argv+1) );
-    else  {
-      fprintf (stderr, "Invalid argument: %s\n",*(argv+1));
-      fprintf (stderr, "Value should be an integer.\n");
-      exit( 1 );
-    }
+	if(argc < 2)
+		*inputs = 2;
+	else if((**(argv + 1) >= '0') && (**(argv + 1) <= '9'))
+		*inputs = atoi(*(argv + 1));
+	else
+	{
+		fprintf(stderr, "Invalid argument: %s\n", *(argv + 1));
+		fprintf(stderr, "Value should be an integer.\n");
+		exit(1);
+	}
 }
 
 
@@ -67,13 +67,13 @@ void getCommandLine  ( int *inputs, int argc, char **argv )
 	It also prints the $SETUP segment for the data set.
 */
 
-void printHeader ( int inputs )
+void printHeader(int inputs)
 {
-  unsigned int num_points;
+	unsigned int num_points;
 
-  num_points = pow(2,inputs);
-  
-  printf("%d %d 1\n", num_points, inputs);
+	num_points = pow(2, inputs);
+
+	printf("%d %d 1\n", num_points, inputs);
 }
 
 
@@ -81,36 +81,35 @@ void printHeader ( int inputs )
 	number of inputs.
 */
 
-void printSet  ( int inputs )  
+void printSet(int inputs)
 {
-	unsigned int num_points,  /* Number of points of data to generate */
-		num_pos,     /* Number of positive bits in this number */
-		this_point,  /* Number being analyzed */
-		i,	    /* General indexing variables */
-		j;
+	unsigned int num_points,	/* Number of points of data to generate */
+	  num_pos,					/* Number of positive bits in this number */
+	  this_point,				/* Number being analyzed */
+	  i,						/* General indexing variables */
+	  j;
 
-	num_points = pow(2,inputs);	/* Figure out how many points to generate */
+	num_points = pow(2, inputs);	/* Figure out how many points to generate */
 
-	for  ( i = 0 ; i < num_points ; i++ )  {
+	for(i = 0; i < num_points; i++)
+	{
 		num_pos = 0;
 		this_point = i;
-		for  ( j = 0 ; j < inputs ; j++ )  {	/* Analyze the number */
-			if  ( (this_point & 1) == 1 )  {		/* Get a bit and use it */
-				printf ("1 ");
+		for(j = 0; j < inputs; j++)
+		{						/* Analyze the number */
+			if((this_point & 1) == 1)
+			{					/* Get a bit and use it */
+				printf("1 ");
 				num_pos++;
-			} else
-				printf ("-1 ");
-			this_point >>= 1;				/* Shift to the next bit */
+			}
+			else
+				printf("-1 ");
+			this_point >>= 1;	/* Shift to the next bit */
 		}
 
-		if  ( (num_pos % 2) == 1 )			/* Print the expected output */
-			printf  ("1\n");
+		if((num_pos % 2) == 1)	/* Print the expected output */
+			printf("1\n");
 		else
-			printf  ("0\n"); 
-	}  
+			printf("0\n");
+	}
 }
-
-
-
-
-
diff --git a/benchmarks/performance.cc b/benchmarks/performance.cc
index 4101c0e..7d09a87 100644
--- a/benchmarks/performance.cc
+++ b/benchmarks/performance.cc
@@ -40,26 +40,27 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #endif
 
 #ifdef JNEURAL
-void performance_benchmark_jneural(FILE *out, fann_type *input,
-	unsigned int num_neurons, unsigned int seconds_per_test)
+void performance_benchmark_jneural(FILE * out, fann_type * input,
+								   unsigned int num_neurons, unsigned int seconds_per_test)
 {
 	unsigned int i, total_connections;
 	fann_type *output;
 
 	backprop *ann = new backprop(0.7, num_neurons, num_neurons, 2, num_neurons, num_neurons);
-	
-	total_connections = (num_neurons+1) * num_neurons * 3;
+
+	total_connections = (num_neurons + 1) * num_neurons * 3;
 
 	start_timer();
-	
-	for(i = 0; time_elapsed() < (double)seconds_per_test; i++){
+
+	for(i = 0; time_elapsed() < (double) seconds_per_test; i++)
+	{
 		ann->set_input(input);
 		output = ann->query_output();
 	}
 
 	stop_timer();
 
-	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i)/total_connections);
+	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i) / total_connections);
 	fprintf(stderr, "%d ", num_neurons);
 
 	delete ann;
@@ -67,122 +68,129 @@ void performance_benchmark_jneural(FILE *out, fann_type *input,
 #endif
 
 #ifdef LWNN
-void performance_benchmark_lwnn(FILE *out, fann_type *input,
-	unsigned int num_neurons, unsigned int seconds_per_test)
+void performance_benchmark_lwnn(FILE * out, fann_type * input,
+								unsigned int num_neurons, unsigned int seconds_per_test)
 {
 	unsigned int i, total_connections;
 	fann_type *output;
 
-	output = (fann_type*)calloc(num_neurons, sizeof(fann_type));
-	network_t *ann = net_allocate (4, num_neurons, num_neurons, num_neurons, num_neurons);
+	output = (fann_type *) calloc(num_neurons, sizeof(fann_type));
+	network_t *ann = net_allocate(4, num_neurons, num_neurons, num_neurons, num_neurons);
 
 	total_connections = num_neurons * num_neurons * 3;
-	
+
 	start_timer();
-	
-	for(i = 0; time_elapsed() < (double)seconds_per_test; i++){
-		net_compute (ann, input, output);
+
+	for(i = 0; time_elapsed() < (double) seconds_per_test; i++)
+	{
+		net_compute(ann, input, output);
 	}
 
 	stop_timer();
 
-	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i)/total_connections);
+	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i) / total_connections);
 	fprintf(stderr, "%d ", num_neurons);
 
-	net_free(ann);	
+	net_free(ann);
 	free(output);
 }
 #endif
 
-void performance_benchmark_fann_noopt(FILE *out, fann_type *input,
-	unsigned int num_neurons, unsigned int seconds_per_test)
+void performance_benchmark_fann_noopt(FILE * out, fann_type * input,
+									  unsigned int num_neurons, unsigned int seconds_per_test)
 {
 	unsigned int i, total_connections;
 	fann_type *output;
 
 	struct fann *ann = fann_create(1, 0.7, 4,
-		num_neurons, num_neurons, num_neurons, num_neurons);
+								   num_neurons, num_neurons, num_neurons, num_neurons);
 
 	//just to fool the optimizer into thinking that the network is not fully connected
 	ann->connection_rate = 0.9;
-	
-	total_connections = (num_neurons+1) * num_neurons * 3;
-		
+
+	total_connections = (num_neurons + 1) * num_neurons * 3;
+
 	start_timer();
-	
-	for(i = 0; time_elapsed() < (double)seconds_per_test; i++){
+
+	for(i = 0; time_elapsed() < (double) seconds_per_test; i++)
+	{
 		output = fann_run(ann, input);
 	}
 
 	stop_timer();
 
-	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i)/total_connections);
+	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i) / total_connections);
 	fprintf(stderr, "%d ", num_neurons);
-	fann_destroy(ann);	
+	fann_destroy(ann);
 }
 
-void performance_benchmark_fann_thres(FILE *out, fann_type *input,
-	unsigned int num_neurons, unsigned int seconds_per_test)
+void performance_benchmark_fann_thres(FILE * out, fann_type * input,
+									  unsigned int num_neurons, unsigned int seconds_per_test)
 {
 	unsigned int i, total_connections;
 	fann_type *output;
 
 	struct fann *ann = fann_create(1, 0.7, 4,
-		num_neurons, num_neurons, num_neurons, num_neurons);
+								   num_neurons, num_neurons, num_neurons, num_neurons);
 
 	fann_set_activation_function_hidden(ann, FANN_THRESHOLD);
 	fann_set_activation_function_output(ann, FANN_THRESHOLD);
-	
-	total_connections = (num_neurons+1) * num_neurons * 3;
-		
+
+	total_connections = (num_neurons + 1) * num_neurons * 3;
+
 	start_timer();
-	
-	for(i = 0; time_elapsed() < (double)seconds_per_test; i++){
+
+	for(i = 0; time_elapsed() < (double) seconds_per_test; i++)
+	{
 		output = fann_run(ann, input);
 	}
 
 	stop_timer();
 
-	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i)/total_connections);
+	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i) / total_connections);
 	fprintf(stderr, "%d ", num_neurons);
-	fann_destroy(ann);	
+	fann_destroy(ann);
 }
 
 #endif
 
-void performance_benchmark_fann(bool stepwise, FILE *out, fann_type *input,
-	unsigned int num_neurons, unsigned int seconds_per_test)
+void performance_benchmark_fann(bool stepwise, FILE * out, fann_type * input,
+								unsigned int num_neurons, unsigned int seconds_per_test)
 {
 	unsigned int i, total_connections;
 	fann_type *output;
 
 	struct fann *ann = fann_create(1, 0.7, 4,
-		num_neurons, num_neurons, num_neurons, num_neurons);
+								   num_neurons, num_neurons, num_neurons, num_neurons);
 
-	if(stepwise){
+	if(stepwise)
+	{
 		fann_set_activation_function_hidden(ann, FANN_SIGMOID_STEPWISE);
 		fann_set_activation_function_output(ann, FANN_SIGMOID_STEPWISE);
-	}else{
+	}
+	else
+	{
 		fann_set_activation_function_hidden(ann, FANN_SIGMOID);
 		fann_set_activation_function_output(ann, FANN_SIGMOID);
 	}
 
-	total_connections = (num_neurons+1) * num_neurons * 3;
-		
+	total_connections = (num_neurons + 1) * num_neurons * 3;
+
 	start_timer();
-	
-	for(i = 0; time_elapsed() < (double)seconds_per_test; i++){
+
+	for(i = 0; time_elapsed() < (double) seconds_per_test; i++)
+	{
 		output = fann_run(ann, input);
 	}
 
 	stop_timer();
 
-	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i)/total_connections);
+	fprintf(out, "%d %.20e\n", num_neurons, getNanoPerN(i) / total_connections);
 	fprintf(stderr, "%d ", num_neurons);
-	fann_destroy(ann);	
+	fann_destroy(ann);
 }
 
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
 {
 	/* parameters */
 	unsigned int num_neurons_first;
@@ -193,61 +201,76 @@ int main(int argc, char* argv[])
 
 	fann_type *input;
 	unsigned int num_neurons, i;
-	
-	if(argc != 7){
-		printf("usage %s net file_out num_neurons_first num_neurons_last multiplier seconds_per_test\n", argv[0]);
+
+	if(argc != 7)
+	{
+		printf
+			("usage %s net file_out num_neurons_first num_neurons_last multiplier seconds_per_test\n",
+			 argv[0]);
 		return -1;
 	}
 
 	calibrate_timer();
-	
+
 	num_neurons_first = atoi(argv[3]);
 	num_neurons_last = atoi(argv[4]);
 	multiplier = atof(argv[5]);
 	seconds_per_test = atoi(argv[6]);
 
-	if(strlen(argv[2]) == 1 && argv[2][0] == '-'){
+	if(strlen(argv[2]) == 1 && argv[2][0] == '-')
+	{
 		out = stdout;
-	}else{
+	}
+	else
+	{
 		out = fopen(argv[2], "w");
 	}
-	
+
 	fprintf(stderr, "Performance test of %s %s ", argv[1], argv[2]);
 
-	input = (fann_type*)calloc(num_neurons_last, sizeof(fann_type));
-	for(i = 0; i < num_neurons_last; i++){
-		input[i] = fann_random_weight(); //fill input with random variables
+	input = (fann_type *) calloc(num_neurons_last, sizeof(fann_type));
+	for(i = 0; i < num_neurons_last; i++)
+	{
+		input[i] = fann_random_weight();	//fill input with random variables
 	}
-	
+
 	for(num_neurons = num_neurons_first;
-		num_neurons <= num_neurons_last; num_neurons = (int)(num_neurons * multiplier)){
+		num_neurons <= num_neurons_last; num_neurons = (int) (num_neurons * multiplier))
+	{
 
 #ifndef FIXEDFANN
-		if(strcmp(argv[1], "fann") == 0){
+		if(strcmp(argv[1], "fann") == 0)
+		{
 #endif
-			performance_benchmark_fann(false, out, input,
-				num_neurons, seconds_per_test);
+			performance_benchmark_fann(false, out, input, num_neurons, seconds_per_test);
 #ifndef FIXEDFANN
-		}else if(strcmp(argv[1], "fann_noopt") == 0){
-			performance_benchmark_fann_noopt(out, input,
-				num_neurons, seconds_per_test);
-		}else if(strcmp(argv[1], "fann_stepwise") == 0){
-			performance_benchmark_fann(true, out, input,
-				num_neurons, seconds_per_test);
-		}else if(strcmp(argv[1], "fann_thres") == 0){
-			performance_benchmark_fann_thres(out, input,
-				num_neurons, seconds_per_test);
+		}
+		else if(strcmp(argv[1], "fann_noopt") == 0)
+		{
+			performance_benchmark_fann_noopt(out, input, num_neurons, seconds_per_test);
+		}
+		else if(strcmp(argv[1], "fann_stepwise") == 0)
+		{
+			performance_benchmark_fann(true, out, input, num_neurons, seconds_per_test);
+		}
+		else if(strcmp(argv[1], "fann_thres") == 0)
+		{
+			performance_benchmark_fann_thres(out, input, num_neurons, seconds_per_test);
 #ifdef LWNN
-		}else if(strcmp(argv[1], "lwnn") == 0){
-			performance_benchmark_lwnn(out, input,
-			  num_neurons, seconds_per_test);
+		}
+		else if(strcmp(argv[1], "lwnn") == 0)
+		{
+			performance_benchmark_lwnn(out, input, num_neurons, seconds_per_test);
 #endif
 #ifdef JNEURAL
-		}else if(strcmp(argv[1], "jneural") == 0){
-			performance_benchmark_jneural(out, input,
-				num_neurons, seconds_per_test);
+		}
+		else if(strcmp(argv[1], "jneural") == 0)
+		{
+			performance_benchmark_jneural(out, input, num_neurons, seconds_per_test);
 #endif
-		}else{
+		}
+		else
+		{
 			printf("unrecognized option %s\n", argv[1]);
 		}
 #endif
@@ -256,6 +279,6 @@ int main(int argc, char* argv[])
 
 	fprintf(stderr, "\n");
 	free(input);
-	
+
 	return 0;
 }
diff --git a/benchmarks/quality.cc b/benchmarks/quality.cc
index be5558d..5159418 100644
--- a/benchmarks/quality.cc
+++ b/benchmarks/quality.cc
@@ -48,16 +48,19 @@ void clear_error()
 	num_bit_fail = 0;
 }
 
-void update_error(fann_type *output, fann_type *desired_output, unsigned int num_output)
+void update_error(fann_type * output, fann_type * desired_output, unsigned int num_output)
 {
 	unsigned int i = 0;
 	double error_val = 0;
+
 	/* calculate the error */
-	for(i = 0; i < num_output; i++){
+	for(i = 0; i < num_output; i++)
+	{
 		error_val = (desired_output[i] - output[i]) * (desired_output[i] - output[i]);
 		error_value += error_val;
 
-		if(error_val >= 0.25){
+		if(error_val >= 0.25)
+		{
 			num_bit_fail++;
 		}
 	}
@@ -66,18 +69,17 @@ void update_error(fann_type *output, fann_type *desired_output, unsigned int num
 
 double mean_error()
 {
-	return error_value/(double)num_errors;
+	return error_value / (double) num_errors;
 }
 
 
 #ifdef JNEURAL
-void quality_benchmark_jneural(
-	struct fann_train_data *train_data,
-	struct fann_train_data *test_data,
-	FILE *train_out, FILE *test_out,
-	unsigned int num_input, unsigned int num_neurons_hidden1,
-	unsigned int num_neurons_hidden2, unsigned int num_output,
-	unsigned int seconds_of_training, double seconds_between_reports)
+void quality_benchmark_jneural(struct fann_train_data *train_data,
+							   struct fann_train_data *test_data,
+							   FILE * train_out, FILE * test_out,
+							   unsigned int num_input, unsigned int num_neurons_hidden1,
+							   unsigned int num_neurons_hidden2, unsigned int num_output,
+							   unsigned int seconds_of_training, double seconds_between_reports)
 {
 	float train_error, test_error;
 	unsigned int i, train_bit_fail, test_bit_fail;
@@ -86,23 +88,29 @@ void quality_benchmark_jneural(
 	double total_elapsed = 0;
 	fann_type *output;
 	struct backprop *ann;
-	
-	if(num_neurons_hidden2){
+
+	if(num_neurons_hidden2)
+	{
 		ann = new backprop(0.7, num_input, num_output, 2, num_neurons_hidden1, num_neurons_hidden2);
-	}else{
+	}
+	else
+	{
 		ann = new backprop(0.7, num_input, num_output, 1, num_neurons_hidden1);
 	}
-	
+
 	calibrate_timer();
 
-	while(total_elapsed < (double)seconds_of_training){
+	while(total_elapsed < (double) seconds_of_training)
+	{
 		/* train */
 		elapsed = 0;
 		start_timer();
-		while(elapsed < (double)seconds_between_reports){
-			for(i = 0; i != train_data->num_data; i++){
+		while(elapsed < (double) seconds_between_reports)
+		{
+			for(i = 0; i != train_data->num_data; i++)
+			{
 				ann->set_input(train_data->input[i]);
-				ann->train_on(train_data->output[i]); 
+				ann->train_on(train_data->output[i]);
 			}
 
 			elapsed = time_elapsed();
@@ -113,7 +121,8 @@ void quality_benchmark_jneural(
 
 		/* make report */
 		clear_error();
-		for(i = 0; i != train_data->num_data; i++){
+		for(i = 0; i != train_data->num_data; i++)
+		{
 			ann->set_input(train_data->input[i]);
 			output = ann->query_output();
 			update_error(output, train_data->output[i], train_data->num_output);
@@ -122,7 +131,8 @@ void quality_benchmark_jneural(
 		train_bit_fail = num_bit_fail;
 
 		clear_error();
-		for(i = 0; i != test_data->num_data; i++){
+		for(i = 0; i != test_data->num_data; i++)
+		{
 			ann->set_input(test_data->input[i]);
 			output = ann->query_output();
 			update_error(output, test_data->output[i], test_data->num_output);
@@ -132,23 +142,24 @@ void quality_benchmark_jneural(
 
 		fprintf(train_out, "%f %.20e %d\n", total_elapsed, train_error, epochs);
 		fprintf(test_out, "%f %.20e %d\n", total_elapsed, test_error, epochs);
-		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r", total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
+		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r",
+				total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
 	}
 
-	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs/total_elapsed);
+	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs / total_elapsed);
 
 	delete ann;
 }
 #endif
 
 void quality_benchmark_fann(bool stepwise, int training_algorithm,
-	char *filename,
-	struct fann_train_data *train_data,
-	struct fann_train_data *test_data,
-	FILE *train_out, FILE *test_out,
-	unsigned int num_input, unsigned int num_neurons_hidden1,
-	unsigned int num_neurons_hidden2, unsigned int num_output,
-	unsigned int seconds_of_training, double seconds_between_reports)
+							char *filename,
+							struct fann_train_data *train_data,
+							struct fann_train_data *test_data,
+							FILE * train_out, FILE * test_out,
+							unsigned int num_input, unsigned int num_neurons_hidden1,
+							unsigned int num_neurons_hidden2, unsigned int num_output,
+							unsigned int seconds_of_training, double seconds_between_reports)
 {
 	float train_error, test_error;
 	unsigned int i, decimal_point, j, train_bit_fail, test_bit_fail;
@@ -158,36 +169,44 @@ void quality_benchmark_fann(bool stepwise, int training_algorithm,
 	fann_type *output;
 	struct fann *ann;
 	char fixed_point_file[256];
-	
-	if(num_neurons_hidden2){
+
+	if(num_neurons_hidden2)
+	{
 		ann = fann_create(1, 0.7, 4,
-			num_input, num_neurons_hidden1, num_neurons_hidden2, num_output);
-	}else{
-		ann = fann_create(1, 0.7, 3,
-			num_input, num_neurons_hidden1, num_output);
+						  num_input, num_neurons_hidden1, num_neurons_hidden2, num_output);
+	}
+	else
+	{
+		ann = fann_create(1, 0.7, 3, num_input, num_neurons_hidden1, num_output);
 	}
 
 	fann_set_training_algorithm(ann, training_algorithm);
-	
-	if(stepwise){ 
+
+	if(stepwise)
+	{
 		fann_set_activation_function_hidden(ann, FANN_SIGMOID_STEPWISE);
 		fann_set_activation_function_output(ann, FANN_SIGMOID_STEPWISE);
-	}else{
+	}
+	else
+	{
 		fann_set_activation_function_hidden(ann, FANN_SIGMOID);
 		fann_set_activation_function_output(ann, FANN_SIGMOID);
 	}
 
-	if(training_algorithm == FANN_TRAIN_INCREMENTAL){
+	if(training_algorithm == FANN_TRAIN_INCREMENTAL)
+	{
 		fann_set_train_error_function(ann, FANN_ERRORFUNC_LINEAR);
 	}
 
 	calibrate_timer();
 
-	while(total_elapsed < (double)seconds_of_training){
+	while(total_elapsed < (double) seconds_of_training)
+	{
 		/* train */
 		elapsed = 0;
 		start_timer();
-		while(elapsed < (double)seconds_between_reports){
+		while(elapsed < (double) seconds_between_reports)
+		{
 			fann_train_epoch(ann, train_data);
 
 			elapsed = time_elapsed();
@@ -198,7 +217,8 @@ void quality_benchmark_fann(bool stepwise, int training_algorithm,
 
 		/* make report */
 		clear_error();
-		for(i = 0; i != train_data->num_data; i++){
+		for(i = 0; i != train_data->num_data; i++)
+		{
 			output = fann_run(ann, train_data->input[i]);
 			update_error(output, train_data->output[i], train_data->num_output);
 		}
@@ -206,7 +226,8 @@ void quality_benchmark_fann(bool stepwise, int training_algorithm,
 		train_bit_fail = num_bit_fail;
 
 		clear_error();
-		for(i = 0; i != test_data->num_data; i++){
+		for(i = 0; i != test_data->num_data; i++)
+		{
 			output = fann_run(ann, test_data->input[i]);
 			update_error(output, test_data->output[i], test_data->num_output);
 		}
@@ -215,11 +236,13 @@ void quality_benchmark_fann(bool stepwise, int training_algorithm,
 
 		fprintf(train_out, "%f %.20e %d\n", total_elapsed, train_error, epochs);
 		fprintf(test_out, "%f %.20e %d\n", total_elapsed, test_error, epochs);
-		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r", total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
+		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r",
+				total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
 
 		/* Save the data as fixed point, to allow for drawing of
-		   a fixed point graph */
-		if(filename){
+		 * a fixed point graph */
+		if(filename)
+		{
 			/* buffer overflow could occur here */
 			sprintf(fixed_point_file, "%08d_%f_%s_fixed.net", epochs, total_elapsed, filename);
 			decimal_point = fann_save_to_fixed(ann, fixed_point_file);
@@ -232,17 +255,16 @@ void quality_benchmark_fann(bool stepwise, int training_algorithm,
 		}
 	}
 
-	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs/total_elapsed);
+	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs / total_elapsed);
 
-	fann_destroy(ann);	
+	fann_destroy(ann);
 }
 
-void quality_benchmark_cascade(
-	struct fann_train_data *train_data,
-	struct fann_train_data *test_data,
-	FILE *train_out, FILE *test_out,
-	unsigned int num_input, unsigned int num_output,
-	unsigned int seconds_of_training, double seconds_between_reports)
+void quality_benchmark_cascade(struct fann_train_data *train_data,
+							   struct fann_train_data *test_data,
+							   FILE * train_out, FILE * test_out,
+							   unsigned int num_input, unsigned int num_output,
+							   unsigned int seconds_of_training, double seconds_between_reports)
 {
 	float train_error = 0;
 	float test_error = 0;
@@ -254,7 +276,7 @@ void quality_benchmark_cascade(
 	struct fann *ann;
 
 	ann = fann_create_shortcut(0.7, 2, num_input, num_output);
-	
+
 	fann_set_training_algorithm(ann, FANN_TRAIN_RPROP);
 	fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
 	fann_set_activation_function_output(ann, FANN_LINEAR);
@@ -271,14 +293,16 @@ void quality_benchmark_cascade(
 	ann->cascade_stagnation_epochs = 12;
 	ann->cascade_num_candidates = 16;
 	ann->cascade_weight_multiplier = 0.5;
-	
+
 	calibrate_timer();
 
-	while(total_elapsed < (double)seconds_of_training){
+	while(total_elapsed < (double) seconds_of_training)
+	{
 		/* train */
 		elapsed = 0;
 		start_timer();
-		while(elapsed < (double)seconds_between_reports){
+		while(elapsed < (double) seconds_between_reports)
+		{
 			fann_cascadetrain_on_data_callback(ann, train_data, 0, NULL, 150, 150, 1, 0);
 
 			elapsed = time_elapsed();
@@ -288,9 +312,10 @@ void quality_benchmark_cascade(
 		total_elapsed += getSecs();
 
 		/* make report */
-		
+
 		clear_error();
-		for(i = 0; i != train_data->num_data; i++){
+		for(i = 0; i != train_data->num_data; i++)
+		{
 			output = fann_run(ann, train_data->input[i]);
 			update_error(output, train_data->output[i], train_data->num_output);
 		}
@@ -298,32 +323,33 @@ void quality_benchmark_cascade(
 		train_bit_fail = num_bit_fail;
 
 		clear_error();
-		for(i = 0; i != test_data->num_data; i++){
+		for(i = 0; i != test_data->num_data; i++)
+		{
 			output = fann_run(ann, test_data->input[i]);
 			update_error(output, test_data->output[i], test_data->num_output);
 		}
 		test_error = mean_error();
 		test_bit_fail = num_bit_fail;
-		
+
 
 		fprintf(train_out, "%f %.20e %d\n", total_elapsed, train_error, epochs);
 		fprintf(test_out, "%f %.20e %d\n", total_elapsed, test_error, epochs);
-		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r", total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
+		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r",
+				total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
 	}
 
-	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs/total_elapsed);
+	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs / total_elapsed);
 
 	fann_destroy(ann);
 }
 
 #ifdef LWNN
-void quality_benchmark_lwnn(
-	struct fann_train_data *train_data,
-	struct fann_train_data *test_data,
-	FILE *train_out, FILE *test_out,
-	unsigned int num_input, unsigned int num_neurons_hidden1,
-	unsigned int num_neurons_hidden2, unsigned int num_output,
-	unsigned int seconds_of_training, double seconds_between_reports)
+void quality_benchmark_lwnn(struct fann_train_data *train_data,
+							struct fann_train_data *test_data,
+							FILE * train_out, FILE * test_out,
+							unsigned int num_input, unsigned int num_neurons_hidden1,
+							unsigned int num_neurons_hidden2, unsigned int num_output,
+							unsigned int seconds_of_training, double seconds_between_reports)
 {
 	float train_error = 0;
 	float test_error = 0;
@@ -334,32 +360,38 @@ void quality_benchmark_lwnn(
 	fann_type *output;
 	network_t *ann;
 
-	if(num_neurons_hidden2){
-		ann = net_allocate (4, num_input, num_neurons_hidden1, num_neurons_hidden2, num_output);
-	}else{
-		ann = net_allocate (3, num_input, num_neurons_hidden1, num_output);
+	if(num_neurons_hidden2)
+	{
+		ann = net_allocate(4, num_input, num_neurons_hidden1, num_neurons_hidden2, num_output);
+	}
+	else
+	{
+		ann = net_allocate(3, num_input, num_neurons_hidden1, num_output);
 	}
 
 	net_set_learning_rate(ann, 0.7);
-	
+
 	calibrate_timer();
 
-	output = (fann_type *)calloc(num_output, sizeof(fann_type));
+	output = (fann_type *) calloc(num_output, sizeof(fann_type));
 
-	while(total_elapsed < (double)seconds_of_training){
+	while(total_elapsed < (double) seconds_of_training)
+	{
 		/* train */
 		elapsed = 0;
 		start_timer();
-		while(elapsed < (double)seconds_between_reports){
-			for(i = 0; i != train_data->num_data; i++){
+		while(elapsed < (double) seconds_between_reports)
+		{
+			for(i = 0; i != train_data->num_data; i++)
+			{
 				/* compute the outputs for inputs(i) */
-				net_compute (ann, train_data->input[i], output);
-				
+				net_compute(ann, train_data->input[i], output);
+
 				/* find the error with respect to targets(i) */
-				net_compute_output_error (ann, train_data->output[i]);
-				
+				net_compute_output_error(ann, train_data->output[i]);
+
 				/* train the network one step */
-				net_train (ann);
+				net_train(ann);
 			}
 
 			elapsed = time_elapsed();
@@ -369,36 +401,39 @@ void quality_benchmark_lwnn(
 		total_elapsed += getSecs();
 
 		/* make report */
-		
+
 		clear_error();
-		for(i = 0; i != train_data->num_data; i++){
-			net_compute (ann, train_data->input[i], output);
+		for(i = 0; i != train_data->num_data; i++)
+		{
+			net_compute(ann, train_data->input[i], output);
 			update_error(output, train_data->output[i], train_data->num_output);
 		}
 		train_error = mean_error();
 		train_bit_fail = num_bit_fail;
 
 		clear_error();
-		for(i = 0; i != test_data->num_data; i++){
-			net_compute (ann, test_data->input[i], output);
+		for(i = 0; i != test_data->num_data; i++)
+		{
+			net_compute(ann, test_data->input[i], output);
 			update_error(output, test_data->output[i], test_data->num_output);
 		}
 		test_error = mean_error();
 		test_bit_fail = num_bit_fail;
-		
+
 
 		fprintf(train_out, "%f %.20e %d\n", total_elapsed, train_error, epochs);
 		fprintf(test_out, "%f %.20e %d\n", total_elapsed, test_error, epochs);
-		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r", total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
+		fprintf(stderr, "secs: %8.2f, train: %8.6f (%4d), test: %8.6f (%4d), epochs: %5d\r",
+				total_elapsed, train_error, train_bit_fail, test_error, test_bit_fail, epochs);
 	}
 
-	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs/total_elapsed);
+	fprintf(stdout, "\nepochs: %d, epochs/sec: %f\n", epochs, epochs / total_elapsed);
 
 	net_free(ann);
 }
 #endif
 
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
 {
 	/* parameters */
 	unsigned int num_neurons_hidden1;
@@ -409,8 +444,11 @@ int main(int argc, char* argv[])
 	struct fann_train_data *train_data, *test_data;
 	FILE *train_out, *test_out;
 
-	if(argc != 10){
-		printf("usage %s net train_file test_file train_file_out test_file_out num_hidden1 num_hidden2 seconds_of_training seconds_between_reports\n", argv[0]);
+	if(argc != 10)
+	{
+		printf
+			("usage %s net train_file test_file train_file_out test_file_out num_hidden1 num_hidden2 seconds_of_training seconds_between_reports\n",
+			 argv[0]);
 		return -1;
 	}
 
@@ -422,91 +460,120 @@ int main(int argc, char* argv[])
 	train_data = fann_read_train_from_file(argv[2]);
 	test_data = fann_read_train_from_file(argv[3]);
 
-	if(strlen(argv[4]) == 1 && argv[4][0] == '-'){
+	if(strlen(argv[4]) == 1 && argv[4][0] == '-')
+	{
 		train_out = stdout;
-	}else{
+	}
+	else
+	{
 		train_out = fopen(argv[4], "w");
 	}
-	
-	if(strlen(argv[5]) == 1 && argv[5][0] == '-'){
+
+	if(strlen(argv[5]) == 1 && argv[5][0] == '-')
+	{
 		test_out = stdout;
-	}else{
+	}
+	else
+	{
 		test_out = fopen(argv[5], "w");
 	}
 
 	fprintf(stdout, "Quality test of %s %s\n", argv[1], argv[2]);
 
-	if(strcmp(argv[1], "fann_incremental") == 0){
+	if(strcmp(argv[1], "fann_incremental") == 0)
+	{
 		quality_benchmark_fann(false, FANN_TRAIN_INCREMENTAL, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_incremental_stepwise") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_incremental_stepwise") == 0)
+	{
 		quality_benchmark_fann(true, FANN_TRAIN_INCREMENTAL, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_quickprop") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_quickprop") == 0)
+	{
 		quality_benchmark_fann(false, FANN_TRAIN_QUICKPROP, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_quickprop_stepwise") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_quickprop_stepwise") == 0)
+	{
 		quality_benchmark_fann(true, FANN_TRAIN_QUICKPROP, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_batch") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_batch") == 0)
+	{
 		quality_benchmark_fann(false, FANN_TRAIN_BATCH, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_batch_stepwise") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_batch_stepwise") == 0)
+	{
 		quality_benchmark_fann(true, FANN_TRAIN_BATCH, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_rprop") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_rprop") == 0)
+	{
 		quality_benchmark_fann(false, FANN_TRAIN_RPROP, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_rprop_stepwise") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_rprop_stepwise") == 0)
+	{
 		quality_benchmark_fann(true, FANN_TRAIN_RPROP, NULL, train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
-	}else if(strcmp(argv[1], "fann_cascade") == 0){
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
+	}
+	else if(strcmp(argv[1], "fann_cascade") == 0)
+	{
 		quality_benchmark_cascade(train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
+								  train_out, test_out,
+								  train_data->num_input, train_data->num_output,
+								  seconds_of_training, seconds_between_reports);
 #ifdef LWNN
-	}else if(strcmp(argv[1], "lwnn") == 0){
+	}
+	else if(strcmp(argv[1], "lwnn") == 0)
+	{
 		quality_benchmark_lwnn(train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
+							   train_out, test_out,
+							   train_data->num_input, num_neurons_hidden1,
+							   num_neurons_hidden2, train_data->num_output,
+							   seconds_of_training, seconds_between_reports);
 #endif
-		
+
 #ifdef JNEURAL
-	}else if(strcmp(argv[1], "jneural") == 0){
+	}
+	else if(strcmp(argv[1], "jneural") == 0)
+	{
 		quality_benchmark_jneural(train_data, test_data,
-			train_out, test_out,
-			train_data->num_input, num_neurons_hidden1,
-			num_neurons_hidden2, train_data->num_output,
-			seconds_of_training, seconds_between_reports);
+								  train_out, test_out,
+								  train_data->num_input, num_neurons_hidden1,
+								  num_neurons_hidden2, train_data->num_output,
+								  seconds_of_training, seconds_between_reports);
 #endif
-	}else{
+	}
+	else
+	{
 		printf("unrecognized option %s\n", argv[1]);
 	}
 
diff --git a/benchmarks/quality_fixed.c b/benchmarks/quality_fixed.c
index 58d7c76..6bf1dd4 100644
--- a/benchmarks/quality_fixed.c
+++ b/benchmarks/quality_fixed.c
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #include <stdio.h>
 #include "fixedfann.h"
 
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
 {
 	struct fann_train_data *train_data, *test_data;
 	FILE *train_out, *test_out;
@@ -30,27 +30,36 @@ int main(int argc, char* argv[])
 	unsigned int epochs = 0;
 	double total_elapsed = 0;
 	char file[256];
-	
-	if(argc < 6){
-		printf("usage %s train_file test_file train_file_out test_file_out fixed_conf_files\n", argv[0]);
+
+	if(argc < 6)
+	{
+		printf("usage %s train_file test_file train_file_out test_file_out fixed_conf_files\n",
+			   argv[0]);
 		return -1;
 	}
 
-	if(strlen(argv[3]) == 1 && argv[3][0] == '-'){
+	if(strlen(argv[3]) == 1 && argv[3][0] == '-')
+	{
 		train_out = stdout;
-	}else{
+	}
+	else
+	{
 		train_out = fopen(argv[3], "w");
 	}
-	
-	if(strlen(argv[4]) == 1 && argv[4][0] == '-'){
+
+	if(strlen(argv[4]) == 1 && argv[4][0] == '-')
+	{
 		test_out = stdout;
-	}else{
+	}
+	else
+	{
 		test_out = fopen(argv[4], "w");
 	}
 
 	fprintf(stderr, "Quality test of fixed point ");
-	
-	for(j = 5; j < argc; j++){
+
+	for(j = 5; j < argc; j++)
+	{
 		ann = fann_create_from_file(argv[j]);
 
 		sprintf(file, "%s_%d", argv[1], fann_get_decimal_point(ann));
@@ -60,13 +69,15 @@ int main(int argc, char* argv[])
 		test_data = fann_read_train_from_file(file);
 
 		fann_reset_MSE(ann);
-		for(i = 0; i != train_data->num_data; i++){
+		for(i = 0; i != train_data->num_data; i++)
+		{
 			fann_test(ann, train_data->input[i], train_data->output[i]);
 		}
 		train_error = fann_get_MSE(ann);
 
 		fann_reset_MSE(ann);
-		for(i = 0; i != test_data->num_data; i++){
+		for(i = 0; i != test_data->num_data; i++)
+		{
 			fann_test(ann, test_data->input[i], test_data->output[i]);
 		}
 		test_error = fann_get_MSE(ann);
@@ -80,6 +91,6 @@ int main(int argc, char* argv[])
 	}
 
 	fprintf(stderr, "\n");
-	
+
 	return 0;
 }
diff --git a/benchmarks/shuffle.c b/benchmarks/shuffle.c
index 3e5dac6..c953ce5 100644
--- a/benchmarks/shuffle.c
+++ b/benchmarks/shuffle.c
@@ -1,18 +1,20 @@
 #include "fann.h"
 
-int main(int argc, char* argv[])
+int main(int argc, char *argv[])
 {
 	struct fann_train_data *train, *test, *all;
 	unsigned int i, j;
 
-	if(argc == 2){
+	if(argc == 2)
+	{
 		train = fann_read_train_from_file(argv[1]);
 		fann_shuffle_train_data(train);
 		fann_save_train(train, argv[1]);
 		return;
 	}
-	
-	if(argc != 3){
+
+	if(argc != 3)
+	{
 		printf("usage: %s train_file test_file\n", argv[0]);
 		printf("will shuffle the data in the two files and save the new data back to them.\n\n");
 		printf("usage: %s train_file\n", argv[0]);
@@ -26,28 +28,34 @@ int main(int argc, char* argv[])
 
 	fann_shuffle_train_data(all);
 
-	for(i = 0; i < train->num_data; i++){
-		for(j = 0; j < train->num_input; j++){
+	for(i = 0; i < train->num_data; i++)
+	{
+		for(j = 0; j < train->num_input; j++)
+		{
 			train->input[i][j] = all->input[i][j];
 		}
-		
-		for(j = 0; j < train->num_output; j++){
+
+		for(j = 0; j < train->num_output; j++)
+		{
 			train->output[i][j] = all->output[i][j];
 		}
 	}
 
-	for(i = 0; i < test->num_data; i++){
-		for(j = 0; j < test->num_input; j++){
+	for(i = 0; i < test->num_data; i++)
+	{
+		for(j = 0; j < test->num_input; j++)
+		{
 			test->input[i][j] = all->input[i + train->num_data][j];
 		}
-		
-		for(j = 0; j < test->num_output; j++){
+
+		for(j = 0; j < test->num_output; j++)
+		{
 			test->output[i][j] = all->output[i + train->num_data][j];
 		}
 	}
 
 	fann_save_train(train, argv[1]);
 	fann_save_train(test, argv[2]);
-	
+
 	return 0;
 }
diff --git a/benchmarks/two-spirals.c b/benchmarks/two-spirals.c
index 6c37060..e6452fa 100755
--- a/benchmarks/two-spirals.c
+++ b/benchmarks/two-spirals.c
@@ -19,35 +19,35 @@
 	 plus one end point).  The output of this program is in the standard
 	 CMU Neural Network Benchmark format.  For more information, see the 
 	 accompanying database file, 'two-spirals'.
-*/ 
+*/
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
 #include <math.h>
 
-#ifndef PI           /* PI is defined on some systems, if it is not, define */
-#define PI 3.1416    /*  it to four decimal places.  Good enough for our    */
-#endif               /*  purposes.                                          */
+#ifndef PI						/* PI is defined on some systems, if it is not, define */
+#define PI 3.1416				/*  it to four decimal places.  Good enough for our    */
+#endif /*  purposes.                                          */
 
 
 /*      Function Prototypes      */
 
-void getCommandLine ( int *, double *, int, char ** );
-void printHeader    ( int, double );
-void printSet       ( int, double );
+void getCommandLine(int *, double *, int, char **);
+void printHeader(int, double);
+void printSet(int, double);
 
 
-int main  ( int argc, char **argv )
+int main(int argc, char **argv)
 {
-  int density;        /* Density of the data set to generate */
-  double maxRadius;   /* Maximum radius of the data set to generate */
+	int density;				/* Density of the data set to generate */
+	double maxRadius;			/* Maximum radius of the data set to generate */
 
-  getCommandLine ( &density, &maxRadius, argc, argv );
-  printHeader    ( density, maxRadius );
-  printSet       ( density, maxRadius );
+	getCommandLine(&density, &maxRadius, argc, argv);
+	printHeader(density, maxRadius);
+	printSet(density, maxRadius);
 
-  return 0;
+	return 0;
 }
 
 
@@ -57,16 +57,16 @@ int main  ( int argc, char **argv )
 	6.5 while density defaults to 1.  Extra arguments are ignored.
 */
 
-void getCommandLine  ( int *density, double *maxRadius, int argc, char **argv )
+void getCommandLine(int *density, double *maxRadius, int argc, char **argv)
 {
-  if  ( argc < 2 )
-    *density = 1;
-  else  
-    *density = atoi( *(argv+1) );
-  if  ( argc < 3 )
-    *maxRadius = 6.5;
-  else
-    *maxRadius = atof( *(argv+2) );
+	if(argc < 2)
+		*density = 1;
+	else
+		*density = atoi(*(argv + 1));
+	if(argc < 3)
+		*maxRadius = 6.5;
+	else
+		*maxRadius = atof(*(argv + 2));
 }
 
 
@@ -75,35 +75,35 @@ void getCommandLine  ( int *density, double *maxRadius, int argc, char **argv )
 	It also prints the $SETUP segment for the data set.
 */
 
-void printHeader ( int density, double maxRadius )
+void printHeader(int density, double maxRadius)
 {
-  time_t genTime;
-
-  time( &genTime );
-
-  /*
-  printf  (";Two-Spirals Benchmark\n");
-  printf  (";Generated: %s", asctime( localtime( &genTime ) ));
-  printf  (";Density:   %d\n", density );
-  printf  (";Radius:    %.2f\n\n", maxRadius );
-  printf  (";Program by: Matt White  (mwhite+ at cmu.edu)\n");
-  printf  (";Benchmark by: Alexis Wieland of MITRE Corporation\n");
-  printf  (";  Any questions should be directed to neural-bench at cs.cmu.edu.");
-  printf  ("\n\n");
-
-  printf  ("$SETUP\n\n");
-  printf  ("PROTOCOL: IO;\n");
-  printf  ("OFFSET: 0;\n");
-  printf  ("INPUTS: 2;\n");
-  printf  ("OUTPUTS: 1;\n\n");
-  printf  ("IN [1]: CONT {%.2f,-%.2f};\n", maxRadius, maxRadius );
-  printf  ("IN [2]: CONT {%.2f,-%.2f};\n\n", maxRadius, maxRadius );
-  printf  ("OUT [1]: BINARY;\n\n\n");
-
-  printf  ("$TRAIN\n\n");
-  */
-
-  printf("%d 2 1\n", (density * 96 + 1) * 2);
+	time_t genTime;
+
+	time(&genTime);
+
+	/*
+	 * printf  (";Two-Spirals Benchmark\n");
+	 * printf  (";Generated: %s", asctime( localtime( &genTime ) ));
+	 * printf  (";Density:   %d\n", density );
+	 * printf  (";Radius:    %.2f\n\n", maxRadius );
+	 * printf  (";Program by: Matt White  (mwhite+ at cmu.edu)\n");
+	 * printf  (";Benchmark by: Alexis Wieland of MITRE Corporation\n");
+	 * printf  (";  Any questions should be directed to neural-bench at cs.cmu.edu.");
+	 * printf  ("\n\n");
+	 * 
+	 * printf  ("$SETUP\n\n");
+	 * printf  ("PROTOCOL: IO;\n");
+	 * printf  ("OFFSET: 0;\n");
+	 * printf  ("INPUTS: 2;\n");
+	 * printf  ("OUTPUTS: 1;\n\n");
+	 * printf  ("IN [1]: CONT {%.2f,-%.2f};\n", maxRadius, maxRadius );
+	 * printf  ("IN [2]: CONT {%.2f,-%.2f};\n\n", maxRadius, maxRadius );
+	 * printf  ("OUT [1]: BINARY;\n\n\n");
+	 * 
+	 * printf  ("$TRAIN\n\n");
+	 */
+
+	printf("%d 2 1\n", (density * 96 + 1) * 2);
 }
 
 
@@ -111,31 +111,32 @@ void printHeader ( int density, double maxRadius )
 	density and radius.
 */
 
-void printSet  ( int density, double maxRadius )  
+void printSet(int density, double maxRadius)
 {
-  int points,      /* Number of interior data points to generate */
-      i;           /* Indexing variable */
-  double x,        /* x coordinate */
-         y,        /* y coordinate */
-         angle,    /* Angle to calculate */
-         radius;   /* Radius at current iteration */
-
-  points = ( 96 * density ); 
-  for  ( i = 0 ; i <= points ; i++ )  {
-
-    /* Angle is based on the iteration * PI/16, divided by point density */
-    angle = ( i * PI ) / ( 16.0 * density );
-
-    /* Radius is the maximum radius * the fraction of iterations left */
-    radius = maxRadius * ( ( 104 * density ) - i ) / ( 104 * density );
-
-    /* x and y are based upon cos and sin of the current radius */
-    x = radius * cos( angle );
-    y = radius * sin( angle );
-
-    /* printf ("%8.5f, %8.5f  =>  +;\n", x, y ); */
-    /* printf ("%8.5f, %8.5f  =>  -;\n", -x, -y ); */
-    printf ("%8.5f %8.5f 1\n", x, y );
-    printf ("%8.5f %8.5f 0\n", -x, -y );
-  }
+	int points,					/* Number of interior data points to generate */
+	  i;						/* Indexing variable */
+	double x,					/* x coordinate */
+	  y,						/* y coordinate */
+	  angle,					/* Angle to calculate */
+	  radius;					/* Radius at current iteration */
+
+	points = (96 * density);
+	for(i = 0; i <= points; i++)
+	{
+
+		/* Angle is based on the iteration * PI/16, divided by point density */
+		angle = (i * PI) / (16.0 * density);
+
+		/* Radius is the maximum radius * the fraction of iterations left */
+		radius = maxRadius * ((104 * density) - i) / (104 * density);
+
+		/* x and y are based upon cos and sin of the current radius */
+		x = radius * cos(angle);
+		y = radius * sin(angle);
+
+		/* printf ("%8.5f, %8.5f  =>  +;\n", x, y ); */
+		/* printf ("%8.5f, %8.5f  =>  -;\n", -x, -y ); */
+		printf("%8.5f %8.5f 1\n", x, y);
+		printf("%8.5f %8.5f 0\n", -x, -y);
+	}
 }
diff --git a/examples/cascade_train.c b/examples/cascade_train.c
index ce5bcf2..d0f46be 100644
--- a/examples/cascade_train.c
+++ b/examples/cascade_train.c
@@ -27,30 +27,32 @@ struct fann_train_data *train_data, *test_data;
 int print_callback(unsigned int epochs, float error)
 {
 	printf("Epochs     %8d. Current MSE-Error: %.10f ", epochs, error);
-	printf("Train error: %f, Test error: %f\n\n", fann_test_data(ann, train_data), fann_test_data(ann, test_data));
+	printf("Train error: %f, Test error: %f\n\n", fann_test_data(ann, train_data),
+		   fann_test_data(ann, test_data));
 	return 0;
 }
 
 int main()
 {
-	const float learning_rate = (const float)1.7;
-	const float desired_error = (const float)0.00001;
+	const float learning_rate = (const float) 1.7;
+	const float desired_error = (const float) 0.00001;
 	unsigned int max_out_epochs = 1500;
 	unsigned int max_cand_epochs = 1500;
 	unsigned int max_neurons = 40;
 	unsigned int neurons_between_reports = 1;
+
 	/*int i;
-	fann_type number, steepness, v1, v2;*/
-	
+	 * fann_type number, steepness, v1, v2; */
+
 	printf("Reading data.\n");
 
 	/*
-	*/
+	 */
 
 	/* this is in range -1 to 1 */
 	/*
-	*/
-		
+	 */
+
 	train_data = fann_read_train_from_file("../benchmarks/datasets/parity8.train");
 	test_data = fann_read_train_from_file("../benchmarks/datasets/parity8.test");
 
@@ -65,7 +67,7 @@ int main()
 
 	train_data = fann_read_train_from_file("../benchmarks/datasets/gene.train");
 	test_data = fann_read_train_from_file("../benchmarks/datasets/gene.test");
-	
+
 	train_data = fann_read_train_from_file("../benchmarks/datasets/two-spiral.train");
 	test_data = fann_read_train_from_file("../benchmarks/datasets/two-spiral.test");
 
@@ -89,15 +91,15 @@ int main()
 
 	fann_scale_train_data(train_data, -1, 1);
 	fann_scale_train_data(test_data, -1, 1);
-	
+
 	printf("Creating network.\n");
 
 	ann = fann_create_shortcut(learning_rate, 2, train_data->num_input, train_data->num_output);
-	
+
 	fann_set_training_algorithm(ann, FANN_TRAIN_BATCH);
 	fann_set_training_algorithm(ann, FANN_TRAIN_QUICKPROP);
 	fann_set_training_algorithm(ann, FANN_TRAIN_RPROP);
-	
+
 	fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
 	fann_set_activation_function_output(ann, FANN_LINEAR);
 	fann_set_activation_steepness_hidden(ann, 1);
@@ -115,21 +117,24 @@ int main()
 	ann->cascade_stagnation_epochs = 120;
 	ann->cascade_num_candidates = 16;
 	ann->cascade_weight_multiplier = 0.7;
-	
+
 	fann_print_parameters(ann);
-	/*fann_print_connections(ann);*/
+	/*fann_print_connections(ann); */
 
 	printf("Training network.\n");
 
-	fann_cascadetrain_on_data_callback(ann, train_data, desired_error, print_callback, max_out_epochs, max_cand_epochs, max_neurons, neurons_between_reports);
+	fann_cascadetrain_on_data_callback(ann, train_data, desired_error, print_callback,
+									   max_out_epochs, max_cand_epochs, max_neurons,
+									   neurons_between_reports);
 
-	/*fann_train_on_data(ann, train_data, 300, 1, desired_error);*/
-	/*printf("\nTrain error: %f, Test error: %f\n\n", fann_test_data(ann, train_data), fann_test_data(ann, test_data));*/
+	/*fann_train_on_data(ann, train_data, 300, 1, desired_error); */
+	/*printf("\nTrain error: %f, Test error: %f\n\n", fann_test_data(ann, train_data), fann_test_data(ann, test_data)); */
 
 	fann_print_connections(ann);
-	/*fann_print_parameters(ann);*/
+	/*fann_print_parameters(ann); */
 
-	printf("\nTrain error: %f, Test error: %f\n\n", fann_test_data(ann, train_data), fann_test_data(ann, test_data));
+	printf("\nTrain error: %f, Test error: %f\n\n", fann_test_data(ann, train_data),
+		   fann_test_data(ann, test_data));
 
 	printf("Saving network.\n");
 
@@ -139,51 +144,51 @@ int main()
 	fann_destroy_train(train_data);
 	fann_destroy_train(test_data);
 	fann_destroy(ann);
-	
+
 	return 0;
 }
 
 
 	/*
-	for(i = 0; i < 6; i++){
-		printf("%.20e, ", ann->activation_values_hidden[i]);
-	}
-	for(i = 0; i < 6; i++){
-		printf("%.20e, ", ann->activation_results_hidden[i]);
-	}
-	printf("\n");
-
-	for(i = 0; i < 100000; i++)
-	{
-		number = fann_rand(-10.0,10.0);
-		steepness = fann_rand(0.0,2.0);
-		fann_set_activation_steepness_hidden(ann, steepness);
-		fann_set_activation_steepness_output(ann, steepness);
-		v1 = fann_stepwise(
-			   ann->activation_values_hidden[0],
-			   ann->activation_values_hidden[1],
-			   ann->activation_values_hidden[2],
-			   ann->activation_values_hidden[3],
-			   ann->activation_values_hidden[4],
-			   ann->activation_values_hidden[5],
-			   ann->activation_results_hidden[0],
-			   ann->activation_results_hidden[1],
-			   ann->activation_results_hidden[2],
-			   ann->activation_results_hidden[3],
-			   ann->activation_results_hidden[4],
-			   ann->activation_results_hidden[5],
-			   -1, 1, number);
-		v1 = fann_activation_new(ann, ann->activation_function_hidden, ann->activation_steepness_hidden, number);
-		number = number*steepness;
-		v2 = fann_stepwise(-2.64665246009826660156e+00, -1.47221946716308593750e+00, -5.49306154251098632812e-01, 5.49306154251098632812e-01, 1.47221934795379638672e+00, 2.64665293693542480469e+00, 4.99999988824129104614e-03, 5.00000007450580596924e-02, 2.50000000000000000000e-01, 7.50000000000000000000e-01, 9.49999988079071044922e-01, 9.95000004768371582031e-01, 0, 1, number);
-		v2 = fann_stepwise(-2.64665293693542480469e+00, -1.47221934795379638672e+00, -5.49306154251098632812e-01, 5.49306154251098632812e-01, 1.47221934795379638672e+00, 2.64665293693542480469e+00, -9.90000009536743164062e-01, -8.99999976158142089844e-01, -5.00000000000000000000e-01, 5.00000000000000000000e-01, 8.99999976158142089844e-01, 9.90000009536743164062e-01, -1, 1, number);
-		if((int)floor(v1*10000.0+0.5) != (int)floor(v2*10000.0+0.5))
-		{
-			printf("steepness = %f, number = %f, v1 = %f, v2 = %f", steepness, number, v1, v2);
-			printf(" **********************");
-			printf("\n");
-		}
-	}
-	
-	exit(0);
-	*/
+	 * for(i = 0; i < 6; i++){
+	 * printf("%.20e, ", ann->activation_values_hidden[i]);
+	 * }
+	 * for(i = 0; i < 6; i++){
+	 * printf("%.20e, ", ann->activation_results_hidden[i]);
+	 * }
+	 * printf("\n");
+	 * 
+	 * for(i = 0; i < 100000; i++)
+	 * {
+	 * number = fann_rand(-10.0,10.0);
+	 * steepness = fann_rand(0.0,2.0);
+	 * fann_set_activation_steepness_hidden(ann, steepness);
+	 * fann_set_activation_steepness_output(ann, steepness);
+	 * v1 = fann_stepwise(
+	 * ann->activation_values_hidden[0],
+	 * ann->activation_values_hidden[1],
+	 * ann->activation_values_hidden[2],
+	 * ann->activation_values_hidden[3],
+	 * ann->activation_values_hidden[4],
+	 * ann->activation_values_hidden[5],
+	 * ann->activation_results_hidden[0],
+	 * ann->activation_results_hidden[1],
+	 * ann->activation_results_hidden[2],
+	 * ann->activation_results_hidden[3],
+	 * ann->activation_results_hidden[4],
+	 * ann->activation_results_hidden[5],
+	 * -1, 1, number);
+	 * v1 = fann_activation_new(ann, ann->activation_function_hidden, ann->activation_steepness_hidden, number);
+	 * number = number*steepness;
+	 * v2 = fann_stepwise(-2.64665246009826660156e+00, -1.47221946716308593750e+00, -5.49306154251098632812e-01, 5.49306154251098632812e-01, 1.47221934795379638672e+00, 2.64665293693542480469e+00, 4.99999988824129104614e-03, 5.00000007450580596924e-02, 2.50000000000000000000e-01, 7.50000000000000000000e-01, 9.49999988079071044922e-01, 9.95000004768371582031e-01, 0, 1, number);
+	 * v2 = fann_stepwise(-2.64665293693542480469e+00, -1.47221934795379638672e+00, -5.49306154251098632812e-01, 5.49306154251098632812e-01, 1.47221934795379638672e+00, 2.64665293693542480469e+00, -9.90000009536743164062e-01, -8.99999976158142089844e-01, -5.00000000000000000000e-01, 5.00000000000000000000e-01, 8.99999976158142089844e-01, 9.90000009536743164062e-01, -1, 1, number);
+	 * if((int)floor(v1*10000.0+0.5) != (int)floor(v2*10000.0+0.5))
+	 * {
+	 * printf("steepness = %f, number = %f, v1 = %f, v2 = %f", steepness, number, v1, v2);
+	 * printf(" **********************");
+	 * printf("\n");
+	 * }
+	 * }
+	 * 
+	 * exit(0);
+	 */
diff --git a/examples/mushroom.c b/examples/mushroom.c
index f02b528..4962f7c 100644
--- a/examples/mushroom.c
+++ b/examples/mushroom.c
@@ -30,15 +30,15 @@ int print_callback(unsigned int epochs, float error)
 int main()
 {
 	const float connection_rate = 1;
-	const float learning_rate = (const float)0.7;
+	const float learning_rate = (const float) 0.7;
 	const unsigned int num_layers = 3;
 	const unsigned int num_neurons_hidden = 32;
-	const float desired_error = (const float)0.0001;
+	const float desired_error = (const float) 0.0001;
 	const unsigned int max_iterations = 300;
 	const unsigned int iterations_between_reports = 10;
 	struct fann *ann;
 	struct fann_train_data *train_data, *test_data;
-	
+
 	unsigned int i = 0;
 
 	printf("Creating network.\n");
@@ -46,25 +46,24 @@ int main()
 	train_data = fann_read_train_from_file("../benchmarks/datasets/mushroom.train");
 
 	ann = fann_create(connection_rate, learning_rate, num_layers,
-		train_data->num_input,
-		num_neurons_hidden,
-		train_data->num_output);
+					  train_data->num_input, num_neurons_hidden, train_data->num_output);
 
 	printf("Training network.\n");
 
 	fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC_STEPWISE);
 	fann_set_activation_function_output(ann, FANN_SIGMOID_STEPWISE);
 
-	/*fann_set_training_algorithm(ann, FANN_TRAIN_INCREMENTAL);*/
-	
+	/*fann_set_training_algorithm(ann, FANN_TRAIN_INCREMENTAL); */
+
 	fann_train_on_data(ann, train_data, max_iterations, iterations_between_reports, desired_error);
-	
+
 	printf("Testing network.\n");
 
 	test_data = fann_read_train_from_file("../benchmarks/datasets/mushroom.test");
 
 	fann_reset_MSE(ann);
-	for(i = 0; i < test_data->num_data; i++){
+	for(i = 0; i < test_data->num_data; i++)
+	{
 		fann_test(ann, test_data->input[i], test_data->output[i]);
 	}
 	printf("MSE error on test data: %f\n", fann_get_MSE(ann));
@@ -77,6 +76,6 @@ int main()
 	fann_destroy_train(train_data);
 	fann_destroy_train(test_data);
 	fann_destroy(ann);
-	
+
 	return 0;
 }
diff --git a/examples/robot.c b/examples/robot.c
index 9c33cf3..76db8a8 100644
--- a/examples/robot.c
+++ b/examples/robot.c
@@ -30,13 +30,13 @@ int print_callback(unsigned int epochs, float error)
 int main()
 {
 	const float connection_rate = 1;
-	const float learning_rate = (const float)0.7;
+	const float learning_rate = (const float) 0.7;
 	const unsigned int num_layers = 3;
 	const unsigned int num_neurons_hidden = 96;
-	const float desired_error = (const float)0.001;
+	const float desired_error = (const float) 0.001;
 	struct fann *ann;
 	struct fann_train_data *train_data, *test_data;
-	
+
 	unsigned int i = 0;
 
 	printf("Creating network.\n");
@@ -44,23 +44,22 @@ int main()
 	train_data = fann_read_train_from_file("../benchmarks/datasets/robot.train");
 
 	ann = fann_create(connection_rate, learning_rate, num_layers,
-		train_data->num_input,
-		num_neurons_hidden,
-		train_data->num_output);
+					  train_data->num_input, num_neurons_hidden, train_data->num_output);
 
 	printf("Training network.\n");
 
 	fann_set_training_algorithm(ann, FANN_TRAIN_INCREMENTAL);
-	
+
 	fann_train_on_data(ann, train_data, 1000, 10, desired_error);
-	
-	/*fann_train_on_data_callback(ann, data, max_iterations, iterations_between_reports, desired_error, print_callback);*/
+
+	/*fann_train_on_data_callback(ann, data, max_iterations, iterations_between_reports, desired_error, print_callback); */
 	printf("Testing network.\n");
 
 	test_data = fann_read_train_from_file("../benchmarks/datasets/robot.test");
 
 	fann_reset_MSE(ann);
-	for(i = 0; i < test_data->num_data; i++){
+	for(i = 0; i < test_data->num_data; i++)
+	{
 		fann_test(ann, test_data->input[i], test_data->output[i]);
 	}
 	printf("MSE error on test data: %f\n", fann_get_MSE(ann));
@@ -73,6 +72,6 @@ int main()
 	fann_destroy_train(train_data);
 	fann_destroy_train(test_data);
 	fann_destroy(ann);
-	
+
 	return 0;
 }
diff --git a/examples/simple_test.c b/examples/simple_test.c
index 0e4b3ca..26ad225 100644
--- a/examples/simple_test.c
+++ b/examples/simple_test.c
@@ -26,14 +26,13 @@ int main()
 	fann_type input[2];
 
 	struct fann *ann = fann_create_from_file("xor_float.net");
-	
+
 	input[0] = -1;
 	input[1] = 1;
 	calc_out = fann_run(ann, input);
 
-	printf("xor test (%f,%f) -> %f\n",
-		input[0], input[1], *calc_out);
-	
+	printf("xor test (%f,%f) -> %f\n", input[0], input[1], *calc_out);
+
 	fann_destroy(ann);
 	return 0;
 }
diff --git a/examples/simple_train.c b/examples/simple_train.c
index f89a09a..bdd8321 100644
--- a/examples/simple_train.c
+++ b/examples/simple_train.c
@@ -22,26 +22,25 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 int main()
 {
 	const float connection_rate = 1;
-	const float learning_rate = (const float)0.7;
+	const float learning_rate = (const float) 0.7;
 	const unsigned int num_input = 2;
 	const unsigned int num_output = 1;
 	const unsigned int num_layers = 3;
 	const unsigned int num_neurons_hidden = 3;
-	const float desired_error = (const float)0.001;
+	const float desired_error = (const float) 0.001;
 	const unsigned int max_iterations = 500000;
 	const unsigned int iterations_between_reports = 1000;
 
 	struct fann *ann = fann_create(connection_rate, learning_rate, num_layers,
-		num_input, num_neurons_hidden, num_output);
+								   num_input, num_neurons_hidden, num_output);
 
 	fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
 	fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
-	
-	fann_train_on_file(ann, "xor.data", max_iterations,
-		iterations_between_reports, desired_error);
-	
+
+	fann_train_on_file(ann, "xor.data", max_iterations, iterations_between_reports, desired_error);
+
 	fann_save(ann, "xor_float.net");
-	
+
 	fann_destroy(ann);
 
 	return 0;
diff --git a/examples/steepness_train.c b/examples/steepness_train.c
index 64873a7..2ebc04b 100644
--- a/examples/steepness_train.c
+++ b/examples/steepness_train.c
@@ -21,41 +21,45 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #include <stdio.h>
 
 void train_on_steepness_file(struct fann *ann, char *filename,
-	unsigned int max_epochs, unsigned int epochs_between_reports,
-	float desired_error, float steepness_start,
-	float steepness_step, float steepness_end)
+							 unsigned int max_epochs, unsigned int epochs_between_reports,
+							 float desired_error, float steepness_start,
+							 float steepness_step, float steepness_end)
 {
 	float error;
 	unsigned int i;
 
 	struct fann_train_data *data = fann_read_train_from_file(filename);
-	if(epochs_between_reports){
-		printf("Max epochs %8d. Desired error: %.10f\n",
-			max_epochs, desired_error);
+
+	if(epochs_between_reports)
+	{
+		printf("Max epochs %8d. Desired error: %.10f\n", max_epochs, desired_error);
 	}
 
 	fann_set_activation_steepness_hidden(ann, steepness_start);
 	fann_set_activation_steepness_output(ann, steepness_start);
-	for(i = 1; i <= max_epochs; i++){
+	for(i = 1; i <= max_epochs; i++)
+	{
 		/* train */
 		error = fann_train_epoch(ann, data);
 
 		/* print current output */
 		if(epochs_between_reports &&
-			(i % epochs_between_reports == 0
-				|| i == max_epochs
-				|| i == 1
-				|| error < desired_error)){
+		   (i % epochs_between_reports == 0 || i == max_epochs || i == 1 || error < desired_error))
+		{
 			printf("Epochs     %8d. Current error: %.10f\n", i, error);
 		}
 
-		if(error < desired_error){
+		if(error < desired_error)
+		{
 			steepness_start += steepness_step;
-			if(steepness_start <= steepness_end){
+			if(steepness_start <= steepness_end)
+			{
 				printf("Steepness: %f\n", steepness_start);
 				fann_set_activation_steepness_hidden(ann, steepness_start);
 				fann_set_activation_steepness_output(ann, steepness_start);
-			}else{
+			}
+			else
+			{
 				break;
 			}
 		}
@@ -66,46 +70,48 @@ void train_on_steepness_file(struct fann *ann, char *filename,
 int main()
 {
 	const float connection_rate = 1;
-	const float learning_rate = (const float)0.7;
+	const float learning_rate = (const float) 0.7;
 	const unsigned int num_input = 2;
 	const unsigned int num_output = 1;
 	const unsigned int num_layers = 3;
 	const unsigned int num_neurons_hidden = 3;
-	const float desired_error = (const float)0.001;
+	const float desired_error = (const float) 0.001;
 	const unsigned int max_iterations = 500000;
 	const unsigned int iterations_between_reports = 1000;
 	unsigned int i;
 	fann_type *calc_out;
 
 	struct fann_train_data *data;
-	
+
 	struct fann *ann = fann_create(connection_rate,
-		learning_rate, num_layers,
-		num_input, num_neurons_hidden, num_output);
-	
+								   learning_rate, num_layers,
+								   num_input, num_neurons_hidden, num_output);
+
 	data = fann_read_train_from_file("xor.data");
-	
+
 	fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
 	fann_set_activation_function_output(ann, FANN_SIGMOID_SYMMETRIC);
 
 	fann_set_training_algorithm(ann, FANN_TRAIN_QUICKPROP);
-	
+
 	train_on_steepness_file(ann, "xor.data", max_iterations,
-		iterations_between_reports, desired_error, (float)1.0, (float)0.1, (float)20.0);
+							iterations_between_reports, desired_error, (float) 1.0, (float) 0.1,
+							(float) 20.0);
 
 	fann_set_activation_function_hidden(ann, FANN_THRESHOLD_SYMMETRIC);
 	fann_set_activation_function_output(ann, FANN_THRESHOLD_SYMMETRIC);
 
-	for(i = 0; i != data->num_data; i++){
+	for(i = 0; i != data->num_data; i++)
+	{
 		calc_out = fann_run(ann, data->input[i]);
 		printf("XOR test (%f, %f) -> %f, should be %f, difference=%f\n",
-		data->input[i][0], data->input[i][1], *calc_out, data->output[i][0],
-			(float)fann_abs(*calc_out - data->output[i][0]));
+			   data->input[i][0], data->input[i][1], *calc_out, data->output[i][0],
+			   (float) fann_abs(*calc_out - data->output[i][0]));
 	}
-	
-	
+
+
 	fann_save(ann, "xor_float.net");
-	
+
 	fann_destroy(ann);
 	fann_destroy_train(data);
 
diff --git a/examples/xor_test.c b/examples/xor_test.c
index 7cece1e..e4e3753 100644
--- a/examples/xor_test.c
+++ b/examples/xor_test.c
@@ -37,14 +37,15 @@ int main()
 #else
 	ann = fann_create_from_file("xor_float.net");
 #endif
-	
-	if(!ann){
+
+	if(!ann)
+	{
 		printf("Error creating ann --- ABORTING.\n");
 		return 0;
 	}
 
 	fann_print_connections(ann);
-	fann_print_parameters(ann);	
+	fann_print_parameters(ann);
 
 	printf("Testing network.\n");
 
@@ -54,20 +55,24 @@ int main()
 	data = fann_read_train_from_file("xor.data");
 #endif
 
-	for(i = 0; i < data->num_data; i++){
+	for(i = 0; i < data->num_data; i++)
+	{
 		fann_reset_MSE(ann);
 		calc_out = fann_test(ann, data->input[i], data->output[i]);
 #ifdef FIXEDFANN
 		printf("XOR test (%d, %d) -> %d, should be %d, difference=%f\n",
-		data->input[i][0], data->input[i][1], *calc_out, data->output[i][0], (float)fann_abs(*calc_out - data->output[i][0])/fann_get_multiplier(ann));
+			   data->input[i][0], data->input[i][1], *calc_out, data->output[i][0],
+			   (float) fann_abs(*calc_out - data->output[i][0]) / fann_get_multiplier(ann));
 
-		if((float)fann_abs(*calc_out - data->output[i][0])/fann_get_multiplier(ann) > 0.2){
+		if((float) fann_abs(*calc_out - data->output[i][0]) / fann_get_multiplier(ann) > 0.2)
+		{
 			printf("Test failed\n");
 			ret = -1;
 		}
 #else
 		printf("XOR test (%f, %f) -> %f, should be %f, difference=%f\n",
-		data->input[i][0], data->input[i][1], *calc_out, data->output[i][0], (float)fann_abs(*calc_out - data->output[i][0]));
+			   data->input[i][0], data->input[i][1], *calc_out, data->output[i][0],
+			   (float) fann_abs(*calc_out - data->output[i][0]));
 #endif
 	}
 
diff --git a/examples/xor_train.c b/examples/xor_train.c
index d98db4f..bd204d7 100644
--- a/examples/xor_train.c
+++ b/examples/xor_train.c
@@ -31,26 +31,24 @@ int main()
 {
 	fann_type *calc_out;
 	const float connection_rate = 1;
-	const float learning_rate = (const float)0.7;
+	const float learning_rate = (const float) 0.7;
 	const unsigned int num_input = 2;
 	const unsigned int num_output = 1;
 	const unsigned int num_layers = 3;
 	const unsigned int num_neurons_hidden = 3;
-	const float desired_error = (const float)0.00001;
+	const float desired_error = (const float) 0.00001;
 	const unsigned int max_iterations = 100000;
 	const unsigned int iterations_between_reports = 1000;
 	struct fann *ann;
 	struct fann_train_data *data;
-	
+
 	unsigned int i = 0;
 	unsigned int decimal_point;
 
 	printf("Creating network.\n");
 
 	ann = fann_create(connection_rate, learning_rate, num_layers,
-		num_input,
-		num_neurons_hidden,
-		num_output);
+					  num_input, num_neurons_hidden, num_output);
 
 	printf("Training network.\n");
 
@@ -59,37 +57,39 @@ int main()
 	fann_set_activation_steepness_hidden(ann, 1);
 	fann_set_activation_steepness_output(ann, 1);
 	fann_set_rprop_delta_max(ann, 50);
-	
+
 	fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC);
 	fann_set_activation_function_output(ann, FANN_GAUSSIAN_SYMMETRIC);
-	
+
 	fann_init_weights(ann, data);
 
-	/*fann_set_training_algorithm(ann, FANN_TRAIN_QUICKPROP);*/
+	/*fann_set_training_algorithm(ann, FANN_TRAIN_QUICKPROP); */
 	fann_train_on_data(ann, data, max_iterations, iterations_between_reports, desired_error);
-	
-	/*fann_train_on_data_callback(ann, data, max_iterations, iterations_between_reports, desired_error, print_callback);*/
 
-	
+	/*fann_train_on_data_callback(ann, data, max_iterations, iterations_between_reports, desired_error, print_callback); */
+
+
 
 	printf("Testing network. %f\n", fann_test_data(ann, data));
 
-	for(i = 0; i < data->num_data; i++){
+	for(i = 0; i < data->num_data; i++)
+	{
 		calc_out = fann_run(ann, data->input[i]);
 		printf("XOR test (%f,%f) -> %f, should be %f, difference=%f\n",
-		data->input[i][0], data->input[i][1], *calc_out, data->output[i][0], fann_abs(*calc_out - data->output[i][0]));
+			   data->input[i][0], data->input[i][1], *calc_out, data->output[i][0],
+			   fann_abs(*calc_out - data->output[i][0]));
 	}
-	
+
 	printf("Saving network.\n");
 
 	fann_save(ann, "xor_float.net");
 
 	decimal_point = fann_save_to_fixed(ann, "xor_fixed.net");
 	fann_save_train_to_fixed(data, "xor_fixed.data", decimal_point);
-	
+
 	printf("Cleaning up.\n");
 	fann_destroy_train(data);
 	fann_destroy(ann);
-	
+
 	return 0;
 }
diff --git a/src/fann_cascade.c b/src/fann_cascade.c
index fb76f13..5766ad1 100644
--- a/src/fann_cascade.c
+++ b/src/fann_cascade.c
@@ -25,9 +25,15 @@
 #define CASCADE_DEBUG
 /* #define CASCADE_DEBUG_FULL */
 
-void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data *data, float desired_error, int (*callback)(unsigned int epochs, float error), unsigned int max_out_epochs, unsigned int max_cand_epochs, unsigned int max_neurons, unsigned int neurons_between_reports);
+void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data *data,
+										float desired_error, int (*callback) (unsigned int epochs,
+																			  float error),
+										unsigned int max_out_epochs, unsigned int max_cand_epochs,
+										unsigned int max_neurons,
+										unsigned int neurons_between_reports);
 
-int fann_train_outputs(struct fann *ann, struct fann_train_data *data, float desired_error, unsigned int max_epochs);
+int fann_train_outputs(struct fann *ann, struct fann_train_data *data, float desired_error,
+					   unsigned int max_epochs);
 
 float fann_train_outputs_epoch(struct fann *ann, struct fann_train_data *data);
 
@@ -41,7 +47,8 @@ int fann_initialize_candidates(struct fann *ann);
 
 void fann_set_shortcut_connections(struct fann *ann);
 
-void fann_update_weights_special_quickprop(struct fann *ann, unsigned int num_data, unsigned int first_weight, unsigned int past_end)
+void fann_update_weights_special_quickprop(struct fann *ann, unsigned int num_data,
+										   unsigned int first_weight, unsigned int past_end)
 {
 	fann_type *train_slopes = ann->train_slopes;
 	fann_type *weights = ann->weights;
@@ -49,55 +56,71 @@ void fann_update_weights_special_quickprop(struct fann *ann, unsigned int num_da
 	fann_type *prev_train_slopes = ann->prev_train_slopes;
 
 	fann_type w, prev_step, slope, prev_slope, next_step;
-	
-	float epsilon = ann->learning_rate/num_data;
-	float decay = ann->quickprop_decay; /*-0.0001;*/
-	float mu = ann->quickprop_mu; /*1.75;*/
-	float shrink_factor = (float)(mu / (1.0 + mu));
+
+	float epsilon = ann->learning_rate / num_data;
+	float decay = ann->quickprop_decay;	/*-0.0001;*/
+	float mu = ann->quickprop_mu;	/*1.75; */
+	float shrink_factor = (float) (mu / (1.0 + mu));
 
 	unsigned int i = first_weight;
 
-	for(;i != past_end; i++){
+	for(; i != past_end; i++)
+	{
 		w = weights[i];
 		prev_step = prev_steps[i];
-		slope = train_slopes[i] +  decay * w;
+		slope = train_slopes[i] + decay * w;
 		prev_slope = prev_train_slopes[i];
 		next_step = 0.0;
-	
+
 		/* The step must always be in direction opposite to the slope. */
-		if(prev_step > 0.001) {
+		if(prev_step > 0.001)
+		{
 			/* If last step was positive...  */
-			if(slope < 0.0) {
-				/*  Add in linear term if current slope is still positive.*/
+			if(slope < 0.0)
+			{
+				/*  Add in linear term if current slope is still positive. */
 				next_step -= epsilon * slope;
 			}
-		
+
 			/*If current slope is close to or larger than prev slope...  */
-			if(slope <= (shrink_factor * prev_slope)) {
-				next_step += mu * prev_step;      /* Take maximum size negative step. */
-			} else {
-				next_step += prev_step * slope / (prev_slope - slope); /* Else, use quadratic estimate. */
+			if(slope <= (shrink_factor * prev_slope))
+			{
+				next_step += mu * prev_step;	/* Take maximum size negative step. */
+			}
+			else
+			{
+				next_step += prev_step * slope / (prev_slope - slope);	/* Else, use quadratic estimate. */
 			}
-		} else if(prev_step < -0.001){
-			/* If last step was negative...  */  
-			if(slope > 0.0){
-				/*  Add in linear term if current slope is still negative.*/
+		}
+		else if(prev_step < -0.001)
+		{
+			/* If last step was negative...  */
+			if(slope > 0.0)
+			{
+				/*  Add in linear term if current slope is still negative. */
 				next_step -= epsilon * slope;
 			}
-		
+
 			/* If current slope is close to or more neg than prev slope... */
-			if(slope >= (shrink_factor * prev_slope)){
-				next_step += mu * prev_step;      /* Take maximum size negative step. */
-			} else {
-				next_step += prev_step * slope / (prev_slope - slope); /* Else, use quadratic estimate. */
+			if(slope >= (shrink_factor * prev_slope))
+			{
+				next_step += mu * prev_step;	/* Take maximum size negative step. */
+			}
+			else
+			{
+				next_step += prev_step * slope / (prev_slope - slope);	/* Else, use quadratic estimate. */
 			}
-		} else {
+		}
+		else
+		{
 			/* Last step was zero, so use only linear term. */
 			next_step -= epsilon * slope;
 		}
 
-		if(next_step > 100 || next_step < -100){
-			printf("special[%d] weight=%f, slope=%f, next_step=%f, prev_step=%f\n", i, weights[i], slope, next_step, prev_step);
+		if(next_step > 100 || next_step < -100)
+		{
+			printf("special[%d] weight=%f, slope=%f, next_step=%f, prev_step=%f\n", i, weights[i],
+				   slope, next_step, prev_step);
 		}
 
 		/* update global data arrays */
@@ -111,8 +134,11 @@ void fann_update_weights_special_quickprop(struct fann *ann, unsigned int num_da
 void fann_print_connections_raw(struct fann *ann)
 {
 	unsigned int i;
-	for(i = 0; i < ann->total_connections_allocated; i++){
-		if(i == ann->total_connections){
+
+	for(i = 0; i < ann->total_connections_allocated; i++)
+	{
+		if(i == ann->total_connections)
+		{
 			printf("* ");
 		}
 		printf("%f ", ann->weights[i]);
@@ -124,19 +150,26 @@ void fann_print_connections_raw(struct fann *ann)
    The connected_neurons pointers are not valid during training,
    but they will be again after training.
  */
-void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data *data, float desired_error, int (*callback)(unsigned int epochs, float error), unsigned int max_out_epochs, unsigned int max_cand_epochs, unsigned int max_neurons, unsigned int neurons_between_reports)
+void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data *data,
+										float desired_error, int (*callback) (unsigned int epochs,
+																			  float error),
+										unsigned int max_out_epochs, unsigned int max_cand_epochs,
+										unsigned int max_neurons,
+										unsigned int neurons_between_reports)
 {
 	float error;
 	unsigned int i;
 	unsigned int total_epochs = 0;
 
-	if(neurons_between_reports && callback == NULL){
+	if(neurons_between_reports && callback == NULL)
+	{
 		printf("Max neurons %6d. Desired error: %.6f\n", max_neurons, desired_error);
 	}
-	
-	for(i = 1; i <= max_neurons; i++){
+
+	for(i = 1; i <= max_neurons; i++)
+	{
 		/* DEBUG TODO to print out connections */
-		fann_set_shortcut_connections(ann); /* update connections before printout */
+		fann_set_shortcut_connections(ann);	/* update connections before printout */
 #ifdef CASCADE_DEBUG_FULL
 		fann_print_connections(ann);
 		fann_print_connections_raw(ann);
@@ -155,34 +188,40 @@ void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data
 
 		/* print current error */
 		if(neurons_between_reports &&
-			(i % neurons_between_reports == 0
-				|| i == max_neurons
-				|| i == 1
-				|| error < desired_error)){
-			if (callback == NULL) {
-				printf("Neurons     %6d. Current error: %.6f. Total error: %.6f. Epochs %6d. Bit fail %d.\n", i, error, ann->MSE_value, total_epochs, ann->num_bit_fail);
-			} else if((*callback)(i, error) == -1){
+		   (i % neurons_between_reports == 0
+			|| i == max_neurons || i == 1 || error < desired_error))
+		{
+			if(callback == NULL)
+			{
+				printf
+					("Neurons     %6d. Current error: %.6f. Total error: %.6f. Epochs %6d. Bit fail %d.\n",
+					 i, error, ann->MSE_value, total_epochs, ann->num_bit_fail);
+			}
+			else if((*callback) (i, error) == -1)
+			{
 				/* you can break the training by returning -1 */
 				break;
 			}
 		}
-		
+
 		/* DEBUG TODO to print out connections */
-		fann_set_shortcut_connections(ann); /* update connections before printout */
+		fann_set_shortcut_connections(ann);	/* update connections before printout */
 #ifdef CASCADE_DEBUG_FULL
 		fann_print_connections(ann);
 		fann_print_connections_raw(ann);
 #endif
 
-		if(error < desired_error){
+		if(error < desired_error)
+		{
 			break;
 		}
-		
-		if(fann_initialize_candidates(ann) == -1){
+
+		if(fann_initialize_candidates(ann) == -1)
+		{
 			/* Unable to initialize room for candidates */
 			break;
 		}
-		
+
 		/* train new candidates */
 #ifdef CASCADE_DEBUG_FULL
 		printf("training candidates\n");
@@ -190,7 +229,7 @@ void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data
 		total_epochs += fann_train_candidates(ann, data, max_cand_epochs);
 
 		/* DEBUG TODO to print out connections */
-		fann_set_shortcut_connections(ann); /* update connections before printout */
+		fann_set_shortcut_connections(ann);	/* update connections before printout */
 #ifdef CASCADE_DEBUG_FULL
 		fann_print_connections(ann);
 		fann_print_connections_raw(ann);
@@ -207,18 +246,21 @@ void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data
 	/* Train outputs one last time but without any desired error */
 	total_epochs += fann_train_outputs(ann, data, 0.0, max_out_epochs);
 
-	if(neurons_between_reports && callback == NULL){
-		printf("Train outputs       Current error: %.6f. Epochs %6d\n", fann_get_MSE(ann), total_epochs);
+	if(neurons_between_reports && callback == NULL)
+	{
+		printf("Train outputs       Current error: %.6f. Epochs %6d\n", fann_get_MSE(ann),
+			   total_epochs);
 	}
 
 	/* Set pointers in connected_neurons
-	   This is ONLY done in the end of cascade training,
-	   since there is no need for them during training.
-	*/
+	 * This is ONLY done in the end of cascade training,
+	 * since there is no need for them during training.
+	 */
 	fann_set_shortcut_connections(ann);
 }
 
-int fann_train_outputs(struct fann *ann, struct fann_train_data *data, float desired_error, unsigned int max_epochs)
+int fann_train_outputs(struct fann *ann, struct fann_train_data *data, float desired_error,
+					   unsigned int max_epochs)
 {
 	float error, initial_error, error_improvement;
 	float target_improvement = 0.0;
@@ -228,45 +270,47 @@ int fann_train_outputs(struct fann *ann, struct fann_train_data *data, float des
 
 	/* TODO should perhaps not clear all arrays */
 	fann_clear_train_arrays(ann);
-	
+
 	/* run an initial epoch to set the initital error */
 	initial_error = fann_train_outputs_epoch(ann, data);
 
-	if(initial_error < desired_error){
+	if(initial_error < desired_error)
+	{
 		return 1;
 	}
-	
-	for(i = 1; i < max_epochs; i++){
+
+	for(i = 1; i < max_epochs; i++)
+	{
 		error = fann_train_outputs_epoch(ann, data);
 
-		/*printf("Epoch %6d. Current error: %.6f. Bit fail %d.\n", i, error, ann->num_bit_fail);*/
+		/*printf("Epoch %6d. Current error: %.6f. Bit fail %d.\n", i, error, ann->num_bit_fail); */
 
-		if(error < desired_error){
-#ifdef CASCADE_DEBUG	
+		if(error < desired_error)
+		{
+#ifdef CASCADE_DEBUG
 			printf("Error %f < %f\n", error, desired_error);
 #endif
-			return i+1;
+			return i + 1;
 		}
-		
+
 		/* Improvement since start of train */
 		error_improvement = initial_error - error;
-		
+
 		/* After any significant change, set a new goal and
-		   allow a new quota of epochs to reach it */  
-		if ((error_improvement > target_improvement) ||
-			(error_improvement < backslide_improvement))
+		 * allow a new quota of epochs to reach it */
+		if((error_improvement > target_improvement) || (error_improvement < backslide_improvement))
 		{
-			/*printf("error_improvement=%f, target_improvement=%f, backslide_improvement=%f, stagnation=%d\n", error_improvement, target_improvement, backslide_improvement, stagnation);*/
+			/*printf("error_improvement=%f, target_improvement=%f, backslide_improvement=%f, stagnation=%d\n", error_improvement, target_improvement, backslide_improvement, stagnation); */
 
 			target_improvement = error_improvement * (1.0 + ann->cascade_change_fraction);
 			backslide_improvement = error_improvement * (1.0 - ann->cascade_change_fraction);
 			stagnation = i + ann->cascade_stagnation_epochs;
 		}
-		
+
 		/* No improvement in allotted period, so quit */
-		if (i >= stagnation)
+		if(i >= stagnation)
 		{
-			return i+1;
+			return i + 1;
 		}
 	}
 
@@ -274,26 +318,31 @@ int fann_train_outputs(struct fann *ann, struct fann_train_data *data, float des
 }
 
 float fann_train_outputs_epoch(struct fann *ann, struct fann_train_data *data)
-{	
+{
 	unsigned int i;
+
 	fann_reset_MSE(ann);
-	
-	for(i = 0; i < data->num_data; i++){
+
+	for(i = 0; i < data->num_data; i++)
+	{
 		fann_run(ann, data->input[i]);
 		fann_compute_MSE(ann, data->output[i]);
- 		fann_update_slopes_batch(ann, ann->last_layer-1, ann->last_layer-1);
+		fann_update_slopes_batch(ann, ann->last_layer - 1, ann->last_layer - 1);
 	}
 
-	switch(ann->training_algorithm)
+	switch (ann->training_algorithm)
 	{
-		case FANN_TRAIN_RPROP:
-			fann_update_weights_irpropm(ann, (ann->last_layer-1)->first_neuron->first_con, ann->total_connections);
-			break;
-		case FANN_TRAIN_QUICKPROP:
-			fann_update_weights_quickprop(ann, data->num_data, (ann->last_layer-1)->first_neuron->first_con, ann->total_connections);
-			break;
-		default:
-			fann_error((struct fann_error *)ann, FANN_E_CANT_USE_ACTIVATION);
+	case FANN_TRAIN_RPROP:
+		fann_update_weights_irpropm(ann, (ann->last_layer - 1)->first_neuron->first_con,
+									ann->total_connections);
+		break;
+	case FANN_TRAIN_QUICKPROP:
+		fann_update_weights_quickprop(ann, data->num_data,
+									  (ann->last_layer - 1)->first_neuron->first_con,
+									  ann->total_connections);
+		break;
+	default:
+		fann_error((struct fann_error *) ann, FANN_E_CANT_USE_ACTIVATION);
 	}
 
 	return fann_get_MSE(ann);
@@ -302,39 +351,48 @@ float fann_train_outputs_epoch(struct fann *ann, struct fann_train_data *data)
 int fann_reallocate_connections(struct fann *ann, unsigned int total_connections)
 {
 	/* The connections are allocated, but the pointers inside are
-	   first moved in the end of the cascade training session.
-	*/
+	 * first moved in the end of the cascade training session.
+	 */
 
 #ifdef CASCADE_DEBUG
 	printf("realloc from %d to %d\n", ann->total_connections_allocated, total_connections);
 #endif
-	ann->connections = (struct fann_neuron **)realloc(ann->connections, total_connections * sizeof(struct fann_neuron *));
-	if(ann->connections == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	ann->connections =
+		(struct fann_neuron **) realloc(ann->connections,
+										total_connections * sizeof(struct fann_neuron *));
+	if(ann->connections == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return -1;
 	}
 
-	ann->weights = (fann_type *)realloc(ann->weights, total_connections * sizeof(fann_type));
-	if(ann->weights == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	ann->weights = (fann_type *) realloc(ann->weights, total_connections * sizeof(fann_type));
+	if(ann->weights == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return -1;
 	}
 
-	ann->train_slopes = (fann_type *)realloc(ann->train_slopes, total_connections * sizeof(fann_type));
-	if(ann->train_slopes == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	ann->train_slopes =
+		(fann_type *) realloc(ann->train_slopes, total_connections * sizeof(fann_type));
+	if(ann->train_slopes == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return -1;
 	}
 
-	ann->prev_steps = (fann_type *)realloc(ann->prev_steps, total_connections * sizeof(fann_type));
-	if(ann->prev_steps == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	ann->prev_steps = (fann_type *) realloc(ann->prev_steps, total_connections * sizeof(fann_type));
+	if(ann->prev_steps == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return -1;
 	}
 
-	ann->prev_train_slopes = (fann_type *)realloc(ann->prev_train_slopes, total_connections * sizeof(fann_type));
-	if(ann->prev_train_slopes == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	ann->prev_train_slopes =
+		(fann_type *) realloc(ann->prev_train_slopes, total_connections * sizeof(fann_type));
+	if(ann->prev_train_slopes == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return -1;
 	}
 
@@ -350,22 +408,27 @@ int fann_reallocate_neurons(struct fann *ann, unsigned int total_neurons)
 	unsigned int num_neurons = 0;
 	unsigned int num_neurons_so_far = 0;
 
-	neurons = (struct fann_neuron *)realloc(ann->first_layer->first_neuron, total_neurons * sizeof(struct fann_neuron));
+	neurons =
+		(struct fann_neuron *) realloc(ann->first_layer->first_neuron,
+									   total_neurons * sizeof(struct fann_neuron));
 	ann->total_neurons_allocated = total_neurons;
-	
-	if(neurons == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+
+	if(neurons == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return -1;
 	}
 
 	/* Also allocate room for more train_errors */
-	ann->train_errors = (fann_type *)realloc(ann->train_errors, total_neurons * sizeof(fann_type));
-	if(ann->train_errors == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	ann->train_errors = (fann_type *) realloc(ann->train_errors, total_neurons * sizeof(fann_type));
+	if(ann->train_errors == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return -1;
 	}
 
-	if(neurons != ann->first_layer->first_neuron){
+	if(neurons != ann->first_layer->first_neuron)
+	{
 		/* Then the memory has moved, also move the pointers */
 
 #ifdef CASCADE_DEBUG_FULL
@@ -373,10 +436,11 @@ int fann_reallocate_neurons(struct fann *ann, unsigned int total_neurons)
 #endif
 
 		/* Move pointers from layers to neurons */
-		for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++){
+		for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++)
+		{
 			num_neurons = layer_it->last_neuron - layer_it->first_neuron;
-			layer_it->first_neuron = neurons+num_neurons_so_far;
-			layer_it->last_neuron = layer_it->first_neuron+num_neurons;
+			layer_it->first_neuron = neurons + num_neurons_so_far;
+			layer_it->last_neuron = layer_it->first_neuron + num_neurons;
 			num_neurons_so_far += num_neurons;
 		}
 	}
@@ -387,17 +451,19 @@ int fann_reallocate_neurons(struct fann *ann, unsigned int total_neurons)
 int fann_initialize_candidates(struct fann *ann)
 {
 	/* The candidates are allocated after the normal neurons and connections,
-	   but there is an empty place between the real neurons and the candidate neurons,
-	   so that it will be possible to make room when the chosen candidate are copied in
-	   on the desired place.
-	*/
+	 * but there is an empty place between the real neurons and the candidate neurons,
+	 * so that it will be possible to make room when the chosen candidate are copied in
+	 * on the desired place.
+	 */
 	unsigned int neurons_to_allocate, connections_to_allocate;
 	unsigned int num_neurons = ann->total_neurons + ann->cascade_num_candidates + 1;
 	unsigned int candidate_connections_in = ann->total_neurons - ann->num_output;
 	unsigned int candidate_connections_out = ann->num_output;
+
 	/* the number of connections going into a and out of a candidate is
-	   ann->total_neurons */
-	unsigned int num_connections = ann->total_connections + (ann->total_neurons * (ann->cascade_num_candidates + 1));
+	 * ann->total_neurons */
+	unsigned int num_connections =
+		ann->total_connections + (ann->total_neurons * (ann->cascade_num_candidates + 1));
 	unsigned int first_candidate_connection = ann->total_connections + ann->total_neurons;
 	unsigned int first_candidate_neuron = ann->total_neurons + 1;
 	unsigned int connection_it, i;
@@ -405,33 +471,39 @@ int fann_initialize_candidates(struct fann *ann)
 	fann_type initial_slope;
 
 	/* First make sure that there is enough room, and if not then allocate a
-	   bit more so that we do not need to allocate more room each time.
-	*/
-	if(num_neurons > ann->total_neurons_allocated){
+	 * bit more so that we do not need to allocate more room each time.
+	 */
+	if(num_neurons > ann->total_neurons_allocated)
+	{
 		/* Then we need to allocate more neurons
-		   Allocate half as many neurons as already exist (at least ten)
-		*/
-		neurons_to_allocate = num_neurons + num_neurons/2;
-		if(neurons_to_allocate < num_neurons + 10){
+		 * Allocate half as many neurons as already exist (at least ten)
+		 */
+		neurons_to_allocate = num_neurons + num_neurons / 2;
+		if(neurons_to_allocate < num_neurons + 10)
+		{
 			neurons_to_allocate = num_neurons + 10;
 		}
 
-		if(fann_reallocate_neurons(ann, neurons_to_allocate) == -1){
+		if(fann_reallocate_neurons(ann, neurons_to_allocate) == -1)
+		{
 			return -1;
 		}
 	}
 
-	if(num_connections > ann->total_connections_allocated){
+	if(num_connections > ann->total_connections_allocated)
+	{
 		/* Then we need to allocate more connections
-		   Allocate half as many connections as already exist
-		   (at least enough for ten neurons)
-		*/
-		connections_to_allocate = num_connections + num_connections/2;
-		if(connections_to_allocate < num_connections + ann->total_neurons * 10){
+		 * Allocate half as many connections as already exist
+		 * (at least enough for ten neurons)
+		 */
+		connections_to_allocate = num_connections + num_connections / 2;
+		if(connections_to_allocate < num_connections + ann->total_neurons * 10)
+		{
 			connections_to_allocate = num_connections + ann->total_neurons * 10;
 		}
 
-		if(fann_reallocate_connections(ann, connections_to_allocate) == -1){
+		if(fann_reallocate_connections(ann, connections_to_allocate) == -1)
+		{
 			return -1;
 		}
 	}
@@ -440,27 +512,28 @@ int fann_initialize_candidates(struct fann *ann)
 	 */
 	connection_it = first_candidate_connection;
 	neurons = ann->first_layer->first_neuron;
-	
-	unsigned int cascade_activation_functions[] = 
-		{FANN_SIGMOID, FANN_SIGMOID_SYMMETRIC, 
+
+	unsigned int cascade_activation_functions[] = { FANN_SIGMOID, FANN_SIGMOID_SYMMETRIC,
 /*		 	FANN_GAUSSIAN, FANN_GAUSSIAN_SYMMETRIC, */
-			FANN_ELLIOT, FANN_ELLIOT_SYMMETRIC};
-			
+		FANN_ELLIOT, FANN_ELLIOT_SYMMETRIC
+	};
+
 	for(i = first_candidate_neuron; i < num_neurons; i++)
 	{
 		/* TODO candidates should actually be created both in
-		   the last layer before the output layer, and in a new layer.
-		*/
+		 * the last layer before the output layer, and in a new layer.
+		 */
 		neurons[i].value = 0;
 		neurons[i].sum = 0;
 		/* TODO should be some kind of parameter (random?) */
-		neurons[i].activation_function = cascade_activation_functions[((i-first_candidate_neuron)/4)%4];
-		neurons[i].activation_steepness = 0.25 * (1 + (i-first_candidate_neuron)%4);
+		neurons[i].activation_function =
+			cascade_activation_functions[((i - first_candidate_neuron) / 4) % 4];
+		neurons[i].activation_steepness = 0.25 * (1 + (i - first_candidate_neuron) % 4);
 		neurons[i].first_con = connection_it;
 		connection_it += candidate_connections_in;
 		neurons[i].last_con = connection_it;
 		/* We have no specific pointers to the output weights, but they are
-		   available after last_con */
+		 * available after last_con */
 		connection_it += candidate_connections_out;
 		ann->train_errors[i] = 0;
 	}
@@ -468,16 +541,20 @@ int fann_initialize_candidates(struct fann *ann)
 	/* Now randomize the weights and zero out the arrays that needs zeroing out.
 	 */
 #ifdef CASCADE_DEBUG_FULL
-	printf("random cand weight [%d ... %d]\n", first_candidate_connection, num_connections-1);
+	printf("random cand weight [%d ... %d]\n", first_candidate_connection, num_connections - 1);
 #endif
-	if(ann->training_algorithm == FANN_TRAIN_RPROP){
+	if(ann->training_algorithm == FANN_TRAIN_RPROP)
+	{
 		initial_slope = ann->rprop_delta_zero;
-	}else{
+	}
+	else
+	{
 		initial_slope = 0.0;
 	}
-	for(i = first_candidate_connection; i < num_connections; i++){
+	for(i = first_candidate_connection; i < num_connections; i++)
+	{
 		ann->weights[i] = fann_random_weight();
-		/*ann->weights[i] = fann_rand(-0.25,0.25);*/
+		/*ann->weights[i] = fann_rand(-0.25,0.25); */
 		ann->train_slopes[i] = 0;
 		ann->prev_steps[i] = 0;
 		ann->prev_train_slopes[i] = initial_slope;
@@ -494,47 +571,55 @@ int fann_train_candidates(struct fann *ann, struct fann_train_data *data, unsign
 	unsigned int i;
 	unsigned int stagnation = max_epochs;
 
-	if(ann->cascade_candidate_scores == NULL){
-		ann->cascade_candidate_scores = (fann_type *)malloc(ann->cascade_num_candidates * sizeof(fann_type));
-		if(ann->cascade_candidate_scores == NULL){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	if(ann->cascade_candidate_scores == NULL)
+	{
+		ann->cascade_candidate_scores =
+			(fann_type *) malloc(ann->cascade_num_candidates * sizeof(fann_type));
+		if(ann->cascade_candidate_scores == NULL)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 			return 0;
 		}
 	}
 
-	for(i = 0; i < max_epochs; i++){
+	for(i = 0; i < max_epochs; i++)
+	{
 		best_cand_score = fann_train_candidates_epoch(ann, data);
 
-		if(best_cand_score/ann->MSE_value > ann->cascade_candidate_limit){
-			printf("above candidate limit %f/%f > %f", best_cand_score, ann->MSE_value, ann->cascade_candidate_limit);
-			return i+1;
+		if(best_cand_score / ann->MSE_value > ann->cascade_candidate_limit)
+		{
+			printf("above candidate limit %f/%f > %f", best_cand_score, ann->MSE_value,
+				   ann->cascade_candidate_limit);
+			return i + 1;
 		}
-		
-		if ((best_cand_score > target_cand_score) ||
-			(best_cand_score < backslide_cand_score))
+
+		if((best_cand_score > target_cand_score) || (best_cand_score < backslide_cand_score))
 		{
 #ifdef CASCADE_DEBUG_FULL
-			printf("Best candidate score %f, real score: %f\n", ann->MSE_value-best_cand_score, best_cand_score);
-			/* printf("best_cand_score=%f, target_cand_score=%f, backslide_cand_score=%f, stagnation=%d\n", best_cand_score, target_cand_score, backslide_cand_score, stagnation);*/
+			printf("Best candidate score %f, real score: %f\n", ann->MSE_value - best_cand_score,
+				   best_cand_score);
+			/* printf("best_cand_score=%f, target_cand_score=%f, backslide_cand_score=%f, stagnation=%d\n", best_cand_score, target_cand_score, backslide_cand_score, stagnation); */
 #endif
 
 			target_cand_score = best_cand_score * (1.0 + ann->cascade_change_fraction);
 			backslide_cand_score = best_cand_score * (1.0 - ann->cascade_change_fraction);
 			stagnation = i + ann->cascade_stagnation_epochs;
 		}
-		
+
 		/* No improvement in allotted period, so quit */
-		if (i >= stagnation)
+		if(i >= stagnation)
 		{
 #ifdef CASCADE_DEBUG
-			printf("Stagnation with %d epochs, best candidate score %f, real score: %f\n", i+1, ann->MSE_value-best_cand_score, best_cand_score);
+			printf("Stagnation with %d epochs, best candidate score %f, real score: %f\n", i + 1,
+				   ann->MSE_value - best_cand_score, best_cand_score);
 #endif
-			return i+1;
+			return i + 1;
 		}
 	}
 
 #ifdef CASCADE_DEBUG
-	printf("Max epochs %d reached, best candidate score %f, real score: %f\n", max_epochs, ann->MSE_value-best_cand_score, best_cand_score);
+	printf("Max epochs %d reached, best candidate score %f, real score: %f\n", max_epochs,
+		   ann->MSE_value - best_cand_score, best_cand_score);
 #endif
 	return max_epochs;
 }
@@ -544,14 +629,15 @@ void fann_update_candidate_slopes(struct fann *ann)
 	struct fann_neuron *neurons = ann->first_layer->first_neuron;
 	struct fann_neuron *first_cand = neurons + ann->total_neurons + 1;
 	struct fann_neuron *last_cand = first_cand + ann->cascade_num_candidates;
-	struct fann_neuron *cand_it;	
+	struct fann_neuron *cand_it;
 	unsigned int i, j, num_connections;
 	unsigned int num_output = ann->num_output;
 	fann_type cand_sum, activation, derived, error_value, diff, cand_score;
 	fann_type *weights, *cand_out_weights, *cand_slopes, *cand_out_slopes;
 	fann_type *output_train_errors = ann->train_errors + (ann->total_neurons - ann->num_output);
 
-	for(cand_it = first_cand; cand_it < last_cand; cand_it++){
+	for(cand_it = first_cand; cand_it < last_cand; cand_it++)
+	{
 		cand_score = ann->cascade_candidate_scores[cand_it - first_cand];
 		error_value = 0.0;
 
@@ -562,48 +648,52 @@ void fann_update_candidate_slopes(struct fann *ann)
 		weights = ann->weights + cand_it->first_con;
 
 		/* unrolled loop start */
-		i = num_connections & 3; /* same as modulo 4 */
-		switch(i) {
-			case 3:
-				cand_sum += weights[2] * neurons[2].value;
-			case 2:
-				cand_sum += weights[1] * neurons[1].value;
-			case 1:
-				cand_sum += weights[0] * neurons[0].value;
-			case 0:
-				break;
+		i = num_connections & 3;	/* same as modulo 4 */
+		switch (i)
+		{
+		case 3:
+			cand_sum += weights[2] * neurons[2].value;
+		case 2:
+			cand_sum += weights[1] * neurons[1].value;
+		case 1:
+			cand_sum += weights[0] * neurons[0].value;
+		case 0:
+			break;
 		}
-				
-		for(;i != num_connections; i += 4){
+
+		for(; i != num_connections; i += 4)
+		{
 			cand_sum +=
 				weights[i] * neurons[i].value +
-				weights[i+1] * neurons[i+1].value +
-				weights[i+2] * neurons[i+2].value +
-				weights[i+3] * neurons[i+3].value;
+				weights[i + 1] * neurons[i + 1].value +
+				weights[i + 2] * neurons[i + 2].value + weights[i + 3] * neurons[i + 3].value;
 		}
 		/*
-		for(i = 0; i < num_connections; i++){
-			cand_sum += weights[i] * neurons[i].value;
-		}
-		*/
+		 * for(i = 0; i < num_connections; i++){
+		 * cand_sum += weights[i] * neurons[i].value;
+		 * }
+		 */
 		/* unrolled loop end */
 
-		activation = fann_activation(ann, cand_it->activation_function, cand_it->activation_steepness, cand_sum);
-		/* printf("%f = sigmoid(%f);\n", activation, cand_sum);*/
+		activation =
+			fann_activation(ann, cand_it->activation_function, cand_it->activation_steepness,
+							cand_sum);
+		/* printf("%f = sigmoid(%f);\n", activation, cand_sum); */
 
 		cand_it->sum = cand_sum;
 		cand_it->value = activation;
-		
+
 		derived = fann_activation_derived(cand_it->activation_function,
-			cand_it->activation_steepness, activation, cand_sum);
+										  cand_it->activation_steepness, activation, cand_sum);
 
 		/* The output weights is located right after the input weights in
-		   the weight array.
-		*/
+		 * the weight array.
+		 */
 		cand_out_weights = weights + num_connections;
-		
+
 		cand_out_slopes = ann->train_slopes + cand_it->first_con + num_connections;
-		for(j = 0; j < num_output; j++){
+		for(j = 0; j < num_output; j++)
+		{
 			diff = (activation * cand_out_weights[j]) - output_train_errors[j];
 #ifdef CASCADE_DEBUG_FULL
 			/* printf("diff = %f = (%f * %f) - %f;\n", diff, activation, cand_out_weights[j], output_train_errors[j]); */
@@ -617,15 +707,18 @@ void fann_update_candidate_slopes(struct fann *ann)
 #ifdef CASCADE_DEBUG_FULL
 			/* printf("cand_score[%d][%d] = %f -= (%f * %f)\n", cand_it - first_cand, j, cand_score, diff, diff); */
 
-			printf("cand[%d]: error=%f, activation=%f, diff=%f, slope=%f\n", cand_it - first_cand, output_train_errors[j], (activation * cand_out_weights[j]), diff, -2.0 * diff * activation);
+			printf("cand[%d]: error=%f, activation=%f, diff=%f, slope=%f\n", cand_it - first_cand,
+				   output_train_errors[j], (activation * cand_out_weights[j]), diff,
+				   -2.0 * diff * activation);
 #endif
 		}
 
 		ann->cascade_candidate_scores[cand_it - first_cand] = cand_score;
 		error_value *= derived;
-		
+
 		cand_slopes = ann->train_slopes + cand_it->first_con;
-		for(i = 0; i < num_connections; i++){
+		for(i = 0; i < num_connections; i++)
+		{
 			cand_slopes[i] -= error_value * neurons[i].value;
 		}
 	}
@@ -633,19 +726,21 @@ void fann_update_candidate_slopes(struct fann *ann)
 
 void fann_update_candidate_weights(struct fann *ann, unsigned int num_data)
 {
-	struct fann_neuron *first_cand = (ann->last_layer-1)->last_neuron + 1; /* there is an empty neuron between the actual neurons and the candidate neuron */
-	struct fann_neuron *last_cand = first_cand + ann->cascade_num_candidates-1;
+	struct fann_neuron *first_cand = (ann->last_layer - 1)->last_neuron + 1;	/* there is an empty neuron between the actual neurons and the candidate neuron */
+	struct fann_neuron *last_cand = first_cand + ann->cascade_num_candidates - 1;
 
-	switch(ann->training_algorithm)
+	switch (ann->training_algorithm)
 	{
-		case FANN_TRAIN_RPROP:
-			fann_update_weights_irpropm(ann, first_cand->first_con, last_cand->last_con+ann->num_output);
-			break;
-		case FANN_TRAIN_QUICKPROP:
-			fann_update_weights_quickprop(ann, num_data, first_cand->first_con, last_cand->last_con+ann->num_output);
-			break;
-		default:
-			fann_error((struct fann_error *)ann, FANN_E_CANT_USE_ACTIVATION);				
+	case FANN_TRAIN_RPROP:
+		fann_update_weights_irpropm(ann, first_cand->first_con,
+									last_cand->last_con + ann->num_output);
+		break;
+	case FANN_TRAIN_QUICKPROP:
+		fann_update_weights_quickprop(ann, num_data, first_cand->first_con,
+									  last_cand->last_con + ann->num_output);
+		break;
+	default:
+		fann_error((struct fann_error *) ann, FANN_E_CANT_USE_ACTIVATION);
 	}
 }
 
@@ -656,38 +751,41 @@ float fann_train_candidates_epoch(struct fann *ann, struct fann_train_data *data
 	fann_type best_score;
 	unsigned int num_cand = ann->cascade_num_candidates;
 	fann_type *output_train_errors = ann->train_errors + (ann->total_neurons - ann->num_output);
-	struct fann_neuron *output_neurons = (ann->last_layer-1)->first_neuron;
+	struct fann_neuron *output_neurons = (ann->last_layer - 1)->first_neuron;
 
-	for(i = 0; i < num_cand; i++){
+	for(i = 0; i < num_cand; i++)
+	{
 		/* The ann->MSE_value is actually the sum squared error */
 		ann->cascade_candidate_scores[i] = ann->MSE_value;
 	}
-	/*printf("start score: %f\n", ann->MSE_value);*/
-	
-	for(i = 0; i < data->num_data; i++){
+	/*printf("start score: %f\n", ann->MSE_value); */
+
+	for(i = 0; i < data->num_data; i++)
+	{
 		fann_run(ann, data->input[i]);
 
-		for(j = 0; j < ann->num_output; j++){
+		for(j = 0; j < ann->num_output; j++)
+		{
 			/* TODO only debug, but the error is in opposite direction, this might be usefull info */
-			/*			if(output_train_errors[j] != (ann->output[j] - data->output[i][j])){
-				printf("difference in calculated error at %f != %f; %f = %f - %f;\n", output_train_errors[j], (ann->output[j] - data->output[i][j]), output_train_errors[j], ann->output[j], data->output[i][j]);
-				}*/
+			/*          if(output_train_errors[j] != (ann->output[j] - data->output[i][j])){
+			 * printf("difference in calculated error at %f != %f; %f = %f - %f;\n", output_train_errors[j], (ann->output[j] - data->output[i][j]), output_train_errors[j], ann->output[j], data->output[i][j]);
+			 * } */
 
 			/*
-			output_train_errors[j] = (data->output[i][j] - ann->output[j])/2;
-			output_train_errors[j] = ann->output[j] - data->output[i][j];
-			*/
+			 * output_train_errors[j] = (data->output[i][j] - ann->output[j])/2;
+			 * output_train_errors[j] = ann->output[j] - data->output[i][j];
+			 */
 
 			output_train_errors[j] = (data->output[i][j] - ann->output[j]);
 
-			switch(output_neurons[j].activation_function)
+			switch (output_neurons[j].activation_function)
 			{
-				case FANN_SIGMOID_SYMMETRIC:
-				case FANN_SIGMOID_SYMMETRIC_STEPWISE:
-				case FANN_ELLIOT_SYMMETRIC:
-				case FANN_GAUSSIAN_SYMMETRIC:
-					output_train_errors[j] /= 2.0;
-				break;				
+			case FANN_SIGMOID_SYMMETRIC:
+			case FANN_SIGMOID_SYMMETRIC_STEPWISE:
+			case FANN_ELLIOT_SYMMETRIC:
+			case FANN_GAUSSIAN_SYMMETRIC:
+				output_train_errors[j] /= 2.0;
+				break;
 			}
 		}
 
@@ -702,11 +800,12 @@ float fann_train_candidates_epoch(struct fann *ann, struct fann_train_data *data
 	for(i = 1; i < num_cand; i++)
 	{
 		/*struct fann_neuron *cand = ann->first_layer->first_neuron + ann->total_neurons + 1 + i;
-		printf("candidate[%d] = activation: %s, steepness: %f, score: %f\n", 
-		i, FANN_ACTIVATION_NAMES[cand->activation_function], 
-		cand->activation_steepness, ann->cascade_candidate_scores[i]);*/
-		
-		if(ann->cascade_candidate_scores[i] > best_score){
+		 * printf("candidate[%d] = activation: %s, steepness: %f, score: %f\n", 
+		 * i, FANN_ACTIVATION_NAMES[cand->activation_function], 
+		 * cand->activation_steepness, ann->cascade_candidate_scores[i]); */
+
+		if(ann->cascade_candidate_scores[i] > best_score)
+		{
 			best_candidate = i;
 			best_score = ann->cascade_candidate_scores[best_candidate];
 		}
@@ -714,9 +813,10 @@ float fann_train_candidates_epoch(struct fann *ann, struct fann_train_data *data
 
 	ann->cascade_best_candidate = ann->total_neurons + best_candidate + 1;
 #ifdef CASCADE_DEBUG_FULL
-	printf("Best candidate[%d]: with score %f, real score: %f\n", best_candidate, ann->MSE_value-best_score, best_score);
+	printf("Best candidate[%d]: with score %f, real score: %f\n", best_candidate,
+		   ann->MSE_value - best_score, best_score);
 #endif
-	
+
 	return best_score;
 }
 
@@ -728,29 +828,32 @@ struct fann_layer *fann_add_layer(struct fann *ann, struct fann_layer *layer)
 	int i;
 
 	/* allocate the layer */
-	struct fann_layer *layers = (struct fann_layer *)realloc(ann->first_layer, num_layers * sizeof(struct fann_layer));
-	if(layers == NULL){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	struct fann_layer *layers =
+		(struct fann_layer *) realloc(ann->first_layer, num_layers * sizeof(struct fann_layer));
+	if(layers == NULL)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 		return NULL;
 	}
 
 	/* copy layers so that the free space is at the right location */
-	for(i = num_layers-1; i >= layer_pos; i--){
-		layers[i] = layers[i-1];
+	for(i = num_layers - 1; i >= layer_pos; i--)
+	{
+		layers[i] = layers[i - 1];
 	}
 
 	/* the newly allocated layer is empty */
-	layers[layer_pos].first_neuron = layers[layer_pos+1].first_neuron;
-	layers[layer_pos].last_neuron = layers[layer_pos+1].first_neuron;
+	layers[layer_pos].first_neuron = layers[layer_pos + 1].first_neuron;
+	layers[layer_pos].last_neuron = layers[layer_pos + 1].first_neuron;
 
 	/* Set the ann pointers correctly */
 	ann->first_layer = layers;
 	ann->last_layer = layers + num_layers;
 
-#ifdef CASCADE_DEBUG_FULL	
+#ifdef CASCADE_DEBUG_FULL
 	printf("add layer at pos %d\n", layer_pos);
 #endif
-	
+
 	return layers + layer_pos;
 }
 
@@ -759,17 +862,20 @@ void fann_set_shortcut_connections(struct fann *ann)
 	struct fann_layer *layer_it;
 	struct fann_neuron *neuron_it, **neuron_pointers, *neurons;
 	unsigned int num_connections = 0, i;
+
 	neuron_pointers = ann->connections;
 	neurons = ann->first_layer->first_neuron;
-	
-	for(layer_it = ann->first_layer+1; layer_it != ann->last_layer; layer_it++){
-		for(neuron_it = layer_it->first_neuron;
-			neuron_it != layer_it->last_neuron; neuron_it++){
+
+	for(layer_it = ann->first_layer + 1; layer_it != ann->last_layer; layer_it++)
+	{
+		for(neuron_it = layer_it->first_neuron; neuron_it != layer_it->last_neuron; neuron_it++)
+		{
 
 			neuron_pointers += num_connections;
 			num_connections = neuron_it->last_con - neuron_it->first_con;
 
-			for(i = 0; i != num_connections; i++){
+			for(i = 0; i != num_connections; i++)
+			{
 				neuron_pointers[i] = neurons + i;
 			}
 		}
@@ -779,7 +885,8 @@ void fann_set_shortcut_connections(struct fann *ann)
 void fann_add_candidate_neuron(struct fann *ann, struct fann_layer *layer)
 {
 	unsigned int num_connections_in = layer->first_neuron - ann->first_layer->first_neuron;
-	unsigned int num_connections_out = (ann->last_layer-1)->last_neuron - (layer+1)->first_neuron;
+	unsigned int num_connections_out =
+		(ann->last_layer - 1)->last_neuron - (layer + 1)->first_neuron;
 	unsigned int num_connections_move = num_connections_out + num_connections_in;
 
 	unsigned int candidate_con, candidate_output_weight;
@@ -789,19 +896,20 @@ void fann_add_candidate_neuron(struct fann *ann, struct fann_layer *layer)
 	struct fann_neuron *neuron_it, *neuron_place, *candidate;
 
 	/* We know that there is enough room for the new neuron
-	   (the candidates are in the same arrays), so move
-	   the last neurons to make room for this neuron.
-	*/
+	 * (the candidates are in the same arrays), so move
+	 * the last neurons to make room for this neuron.
+	 */
 
 	/* first move the pointers to neurons in the layer structs */
-	for(layer_it = ann->last_layer-1; layer_it != layer; layer_it--){
-#ifdef CASCADE_DEBUG_FULL	
+	for(layer_it = ann->last_layer - 1; layer_it != layer; layer_it--)
+	{
+#ifdef CASCADE_DEBUG_FULL
 		printf("move neuron pointers in layer %d, first(%d -> %d), last(%d -> %d)\n",
-			layer_it - ann->first_layer,
-			layer_it->first_neuron - ann->first_layer->first_neuron,
-			layer_it->first_neuron - ann->first_layer->first_neuron + 1,
-			layer_it->last_neuron - ann->first_layer->first_neuron,
-			layer_it->last_neuron - ann->first_layer->first_neuron + 1);
+			   layer_it - ann->first_layer,
+			   layer_it->first_neuron - ann->first_layer->first_neuron,
+			   layer_it->first_neuron - ann->first_layer->first_neuron + 1,
+			   layer_it->last_neuron - ann->first_layer->first_neuron,
+			   layer_it->last_neuron - ann->first_layer->first_neuron + 1);
 #endif
 		layer_it->first_neuron++;
 		layer_it->last_neuron++;
@@ -811,32 +919,36 @@ void fann_add_candidate_neuron(struct fann *ann, struct fann_layer *layer)
 	layer->last_neuron++;
 
 	/* this is the place that should hold the new neuron */
-	neuron_place = layer->last_neuron-1;
+	neuron_place = layer->last_neuron - 1;
 
-#ifdef CASCADE_DEBUG_FULL	
-	printf("num_connections_in=%d, num_connections_out=%d\n", num_connections_in, num_connections_out);
+#ifdef CASCADE_DEBUG_FULL
+	printf("num_connections_in=%d, num_connections_out=%d\n", num_connections_in,
+		   num_connections_out);
 #endif
 
 	candidate = ann->first_layer->first_neuron + ann->cascade_best_candidate;
-	
+
 	/* the output weights for the candidates are located after the input weights */
 	candidate_output_weight = candidate->last_con;
-	
+
 	/* move the actual output neurons and the indexes to the connection arrays */
-	for(neuron_it = (ann->last_layer-1)->last_neuron-1;
-		neuron_it != neuron_place; neuron_it--){
-#ifdef CASCADE_DEBUG_FULL	
-		printf("move neuron %d -> %d\n", neuron_it - ann->first_layer->first_neuron -1,
-			neuron_it - ann->first_layer->first_neuron);
+	for(neuron_it = (ann->last_layer - 1)->last_neuron - 1; neuron_it != neuron_place; neuron_it--)
+	{
+#ifdef CASCADE_DEBUG_FULL
+		printf("move neuron %d -> %d\n", neuron_it - ann->first_layer->first_neuron - 1,
+			   neuron_it - ann->first_layer->first_neuron);
 #endif
-		*neuron_it = *(neuron_it-1);
+		*neuron_it = *(neuron_it - 1);
 
 		/* move the weights */
-#ifdef CASCADE_DEBUG_FULL	
-		printf("move weight[%d ... %d] -> weight[%d ... %d]\n", neuron_it->first_con, neuron_it->last_con-1, neuron_it->first_con + num_connections_move - 1, neuron_it->last_con + num_connections_move - 2);
+#ifdef CASCADE_DEBUG_FULL
+		printf("move weight[%d ... %d] -> weight[%d ... %d]\n", neuron_it->first_con,
+			   neuron_it->last_con - 1, neuron_it->first_con + num_connections_move - 1,
+			   neuron_it->last_con + num_connections_move - 2);
 #endif
-		for(i = neuron_it->last_con - 1; i >= (int)neuron_it->first_con; i--){
-#ifdef CASCADE_DEBUG_FULL	
+		for(i = neuron_it->last_con - 1; i >= (int) neuron_it->first_con; i--)
+		{
+#ifdef CASCADE_DEBUG_FULL
 			printf("move weight[%d] = weight[%d]\n", i + num_connections_move - 1, i);
 #endif
 			ann->weights[i + num_connections_move - 1] = ann->weights[i];
@@ -848,7 +960,8 @@ void fann_add_candidate_neuron(struct fann *ann, struct fann_layer *layer)
 		neuron_it->first_con += num_connections_move;
 
 		/* set the new weight to the newly allocated neuron */
-		ann->weights[neuron_it->last_con-1] = (ann->weights[candidate_output_weight]) * ann->cascade_weight_multiplier;
+		ann->weights[neuron_it->last_con - 1] =
+			(ann->weights[candidate_output_weight]) * ann->cascade_weight_multiplier;
 		candidate_output_weight++;
 	}
 
@@ -857,26 +970,31 @@ void fann_add_candidate_neuron(struct fann *ann, struct fann_layer *layer)
 	neuron_place->sum = 0;
 	neuron_place->activation_function = candidate->activation_function;
 	neuron_place->activation_steepness = candidate->activation_steepness;
-	neuron_place->last_con = (neuron_place+1)->first_con;
+	neuron_place->last_con = (neuron_place + 1)->first_con;
 	neuron_place->first_con = neuron_place->last_con - num_connections_in;
-	printf("neuron[%d] = weights[%d ... %d] activation: %s, steepness: %f\n", 
-		neuron_place - ann->first_layer->first_neuron, neuron_place->first_con, 
-		neuron_place->last_con-1, FANN_ACTIVATION_NAMES[neuron_place->activation_function],
-		neuron_place->activation_steepness);
-#ifdef CASCADE_DEBUG_FULL	
-	printf("neuron[%d] = weights[%d ... %d]\n", neuron_place - ann->first_layer->first_neuron, neuron_place->first_con, neuron_place->last_con-1);
+	printf("neuron[%d] = weights[%d ... %d] activation: %s, steepness: %f\n",
+		   neuron_place - ann->first_layer->first_neuron, neuron_place->first_con,
+		   neuron_place->last_con - 1, FANN_ACTIVATION_NAMES[neuron_place->activation_function],
+		   neuron_place->activation_steepness);
+#ifdef CASCADE_DEBUG_FULL
+	printf("neuron[%d] = weights[%d ... %d]\n", neuron_place - ann->first_layer->first_neuron,
+		   neuron_place->first_con, neuron_place->last_con - 1);
 #endif
 
 	candidate_con = candidate->first_con;
 	/* initialize the input weights at random */
-#ifdef CASCADE_DEBUG_FULL	
-	printf("move cand weights[%d ... %d] -> [%d ... %d]\n", candidate_con, candidate_con + num_connections_in-1, neuron_place->first_con, neuron_place->last_con-1);
+#ifdef CASCADE_DEBUG_FULL
+	printf("move cand weights[%d ... %d] -> [%d ... %d]\n", candidate_con,
+		   candidate_con + num_connections_in - 1, neuron_place->first_con,
+		   neuron_place->last_con - 1);
 #endif
-	
-	for(i = 0; i < num_connections_in; i++){
+
+	for(i = 0; i < num_connections_in; i++)
+	{
 		ann->weights[i + neuron_place->first_con] = ann->weights[i + candidate_con];
 #ifdef CASCADE_DEBUG_FULL
-		printf("move weights[%d] -> weights[%d] (%f)\n", i + candidate_con, i + neuron_place->first_con, ann->weights[i + neuron_place->first_con]);
+		printf("move weights[%d] -> weights[%d] (%f)\n", i + candidate_con,
+			   i + neuron_place->first_con, ann->weights[i + neuron_place->first_con]);
 #endif
 	}
 
@@ -890,7 +1008,8 @@ void fann_add_candidate_neuron(struct fann *ann, struct fann_layer *layer)
 void fann_install_candidate(struct fann *ann)
 {
 	struct fann_layer *layer;
-	layer = fann_add_layer(ann, ann->last_layer-1);
+
+	layer = fann_add_layer(ann, ann->last_layer - 1);
 	fann_add_candidate_neuron(ann, layer);
 	return;
 }
diff --git a/src/fann_error.c b/src/fann_error.c
index 7dd7704..5f693dc 100644
--- a/src/fann_error.c
+++ b/src/fann_error.c
@@ -43,7 +43,7 @@ FANN_EXTERNAL void FANN_API fann_reset_errno(struct fann_error *errdat)
  */
 FANN_EXTERNAL void FANN_API fann_reset_errstr(struct fann_error *errdat)
 {
-	if ( errdat->errstr != NULL )
+	if(errdat->errstr != NULL)
 		free(errdat->errstr);
 	errdat->errstr = NULL;
 }
@@ -57,7 +57,7 @@ FANN_EXTERNAL unsigned int FANN_API fann_get_errno(struct fann_error *errdat)
 
 /* returns the last errstr
  */
-FANN_EXTERNAL char * FANN_API fann_get_errstr(struct fann_error *errdat)
+FANN_EXTERNAL char *FANN_API fann_get_errstr(struct fann_error *errdat)
 {
 	char *errstr = errdat->errstr;
 
@@ -69,15 +69,17 @@ FANN_EXTERNAL char * FANN_API fann_get_errstr(struct fann_error *errdat)
 
 /* change where errors are logged to
  */
-FANN_EXTERNAL void FANN_API fann_set_error_log(struct fann_error *errdat, FILE *log_file)
+FANN_EXTERNAL void FANN_API fann_set_error_log(struct fann_error *errdat, FILE * log_file)
 {
 	errdat->error_log = log_file;
 }
 
 /* prints the last error to the error log (default stderr)
  */
-FANN_EXTERNAL void FANN_API fann_print_error(struct fann_error *errdat) {
-	if ( (errdat->errno_f != FANN_E_NO_ERROR) && (errdat->error_log != NULL) ){
+FANN_EXTERNAL void FANN_API fann_print_error(struct fann_error *errdat)
+{
+	if((errdat->errno_f != FANN_E_NO_ERROR) && (errdat->error_log != NULL))
+	{
 		fputs(errdat->errstr, errdat->error_log);
 	}
 }
@@ -88,22 +90,28 @@ FANN_EXTERNAL void FANN_API fann_print_error(struct fann_error *errdat) {
 void fann_error(struct fann_error *errdat, const unsigned int errno_f, ...)
 {
 	va_list ap;
-	char * errstr;
+	char *errstr;
+
+	if(errdat != NULL)
+		errdat->errno_f = errno_f;
 
-	if (errdat != NULL) errdat->errno_f = errno_f;
-	
-	if(errdat != NULL && errdat->errstr != NULL){
+	if(errdat != NULL && errdat->errstr != NULL)
+	{
 		errstr = errdat->errstr;
-	}else{
-		errstr = (char *)malloc(FANN_ERRSTR_MAX);
-		if(errstr == NULL){
+	}
+	else
+	{
+		errstr = (char *) malloc(FANN_ERRSTR_MAX);
+		if(errstr == NULL)
+		{
 			fprintf(stderr, "Unable to allocate memory.\n");
 			return;
 		}
 	}
 
 	va_start(ap, errno_f);
-	switch ( errno_f ) {
+	switch (errno_f)
+	{
 	case FANN_E_NO_ERROR:
 		break;
 	case FANN_E_CANT_OPEN_CONFIG_R:
@@ -113,7 +121,9 @@ void fann_error(struct fann_error *errdat, const unsigned int errno_f, ...)
 		vsprintf(errstr, "Unable to open configuration file \"%s\" for writing.\n", ap);
 		break;
 	case FANN_E_WRONG_CONFIG_VERSION:
-		vsprintf(errstr, "Wrong version of configuration file, aborting read of configuration file \"%s\".\n", ap);
+		vsprintf(errstr,
+				 "Wrong version of configuration file, aborting read of configuration file \"%s\".\n",
+				 ap);
 		break;
 	case FANN_E_CANT_READ_CONFIG:
 		vsprintf(errstr, "Error reading info from configuration file \"%s\".\n", ap);
@@ -154,11 +164,15 @@ void fann_error(struct fann_error *errdat, const unsigned int errno_f, ...)
 	}
 	va_end(ap);
 
-	if ( errdat == NULL ) {
+	if(errdat == NULL)
+	{
 		fprintf(stderr, "FANN Error %d: %s", errno_f, errstr);
-	} else {
+	}
+	else
+	{
 		errdat->errstr = errstr;
-		if ( errdat->error_log != NULL ) {
+		if(errdat->error_log != NULL)
+		{
 			fprintf(errdat->error_log, "FANN Error %d: %s", errno_f, errstr);
 		}
 	}
diff --git a/src/fann_io.c b/src/fann_io.c
index d4c265a..b7ac439 100644
--- a/src/fann_io.c
+++ b/src/fann_io.c
@@ -28,11 +28,13 @@
 
 /* Create a network from a configuration file.
  */
-FANN_EXTERNAL struct fann * FANN_API fann_create_from_file(const char *configuration_file)
+FANN_EXTERNAL struct fann *FANN_API fann_create_from_file(const char *configuration_file)
 {
 	struct fann *ann;
 	FILE *conf = fopen(configuration_file, "r");
-	if(!conf){
+
+	if(!conf)
+	{
 		fann_error(NULL, FANN_E_CANT_OPEN_CONFIG_R, configuration_file);
 		return NULL;
 	}
@@ -62,8 +64,10 @@ int fann_save_internal(struct fann *ann, const char *configuration_file, unsigne
 {
 	int retval;
 	FILE *conf = fopen(configuration_file, "w+");
-	if(!conf){
-		fann_error((struct fann_error *)ann, FANN_E_CANT_OPEN_CONFIG_W, configuration_file);
+
+	if(!conf)
+	{
+		fann_error((struct fann_error *) ann, FANN_E_CANT_OPEN_CONFIG_W, configuration_file);
 		return -1;
 	}
 	retval = fann_save_internal_fd(ann, conf, configuration_file, save_as_fixed);
@@ -74,7 +78,8 @@ int fann_save_internal(struct fann *ann, const char *configuration_file, unsigne
 /* INTERNAL FUNCTION
    Used to save the network to a file descriptor.
  */
-int fann_save_internal_fd(struct fann *ann, FILE *conf, const char *configuration_file, unsigned int save_as_fixed)
+int fann_save_internal_fd(struct fann *ann, FILE * conf, const char *configuration_file,
+						  unsigned int save_as_fixed)
 {
 	struct fann_layer *layer_it;
 	int calculated_decimal_point = 0;
@@ -82,6 +87,7 @@ int fann_save_internal_fd(struct fann *ann, FILE *conf, const char *configuratio
 	fann_type *weights;
 	struct fann_neuron **connected_neurons;
 	unsigned int i = 0;
+
 #ifndef FIXEDFANN
 	/* variabels for use when saving floats as fixed point variabels */
 	unsigned int decimal_point = 0;
@@ -92,108 +98,133 @@ int fann_save_internal_fd(struct fann *ann, FILE *conf, const char *configuratio
 #endif
 
 #ifndef FIXEDFANN
-	if(save_as_fixed){
+	if(save_as_fixed)
+	{
 		/* save the version information */
-		fprintf(conf, FANN_FIX_VERSION"\n");
-	}else{
+		fprintf(conf, FANN_FIX_VERSION "\n");
+	}
+	else
+	{
 		/* save the version information */
-		fprintf(conf, FANN_FLO_VERSION"\n");
+		fprintf(conf, FANN_FLO_VERSION "\n");
 	}
 #else
 	/* save the version information */
-	fprintf(conf, FANN_FIX_VERSION"\n");
+	fprintf(conf, FANN_FIX_VERSION "\n");
 #endif
-	
+
 #ifndef FIXEDFANN
-	if(save_as_fixed){
+	if(save_as_fixed)
+	{
 		/* calculate the maximal possible shift value */
 
-		for(layer_it = ann->first_layer+1; layer_it != ann->last_layer; layer_it++){
-			for(neuron_it = layer_it->first_neuron; neuron_it != layer_it->last_neuron; neuron_it++){
+		for(layer_it = ann->first_layer + 1; layer_it != ann->last_layer; layer_it++)
+		{
+			for(neuron_it = layer_it->first_neuron; neuron_it != layer_it->last_neuron; neuron_it++)
+			{
 				/* look at all connections to each neurons, and see how high a value we can get */
 				current_max_value = 0;
-				for(i = neuron_it->first_con; i != neuron_it->last_con; i++){
+				for(i = neuron_it->first_con; i != neuron_it->last_con; i++)
+				{
 					current_max_value += fann_abs(ann->weights[i]);
 				}
 
-				if(current_max_value > max_possible_value){
+				if(current_max_value > max_possible_value)
+				{
 					max_possible_value = current_max_value;
 				}
 			}
 		}
 
-		for(bits_used_for_max = 0; max_possible_value >= 1; bits_used_for_max++){
+		for(bits_used_for_max = 0; max_possible_value >= 1; bits_used_for_max++)
+		{
 			max_possible_value /= 2.0;
 		}
 
 		/* The maximum number of bits we shift the fix point, is the number
-		   of bits in a integer, minus one for the sign, one for the minus
-		   in stepwise, and minus the bits used for the maximum.
-		   This is devided by two, to allow multiplication of two fixed
-		   point numbers.
-		*/
-		calculated_decimal_point = (sizeof(int)*8-2-bits_used_for_max)/2;
-
-		if(calculated_decimal_point < 0){
+		 * of bits in a integer, minus one for the sign, one for the minus
+		 * in stepwise, and minus the bits used for the maximum.
+		 * This is devided by two, to allow multiplication of two fixed
+		 * point numbers.
+		 */
+		calculated_decimal_point = (sizeof(int) * 8 - 2 - bits_used_for_max) / 2;
+
+		if(calculated_decimal_point < 0)
+		{
 			decimal_point = 0;
-		}else{
+		}
+		else
+		{
 			decimal_point = calculated_decimal_point;
 		}
-		
+
 		fixed_multiplier = 1 << decimal_point;
 
 #ifdef DEBUG
-		printf("calculated_decimal_point=%d, decimal_point=%u, bits_used_for_max=%u\n", calculated_decimal_point, decimal_point, bits_used_for_max);
+		printf("calculated_decimal_point=%d, decimal_point=%u, bits_used_for_max=%u\n",
+			   calculated_decimal_point, decimal_point, bits_used_for_max);
 #endif
-		
+
 		/* save the decimal_point on a seperate line */
 		fprintf(conf, "%u\n", decimal_point);
-		
-		/* save the number layers "num_layers learning_rate connection_rate shortcut_connections activation_function_hidden activation_function_output activation_steepness_hidden activation_steepness_output" 	
-		fprintf(conf, "%u %f %f %u %u %u %d %d\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections, ann->activation_function_hidden, ann->activation_function_output, (int)(ann->activation_steepness_hidden * fixed_multiplier), (int)(ann->activation_steepness_output * fixed_multiplier));
-		*/
+
+		/* save the number layers "num_layers learning_rate connection_rate shortcut_connections activation_function_hidden activation_function_output activation_steepness_hidden activation_steepness_output"     
+		 * fprintf(conf, "%u %f %f %u %u %u %d %d\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections, ann->activation_function_hidden, ann->activation_function_output, (int)(ann->activation_steepness_hidden * fixed_multiplier), (int)(ann->activation_steepness_output * fixed_multiplier));
+		 */
 		/* save the number layers "num_layers learning_rate connection_rate shortcut_connections" */
-		fprintf(conf, "%u %f %f %u\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections);
-	}else{
+		fprintf(conf, "%u %f %f %u\n", ann->last_layer - ann->first_layer, ann->learning_rate,
+				ann->connection_rate, ann->shortcut_connections);
+	}
+	else
+	{
 		/* save the number layers "num_layers learning_rate connection_rate shortcut_connections activation_function_hidden activation_function_output activation_steepness_hidden activation_steepness_output" 
-		fprintf(conf, "%u %f %f %u %u %u "FANNPRINTF" "FANNPRINTF"\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections, ann->activation_function_hidden, ann->activation_function_output, ann->activation_steepness_hidden, ann->activation_steepness_output);
-		*/
-		/* save the number layers "num_layers learning_rate connection_rate shortcut_connections" */	
-		fprintf(conf, "%u %f %f %u\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections);
+		 * fprintf(conf, "%u %f %f %u %u %u "FANNPRINTF" "FANNPRINTF"\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections, ann->activation_function_hidden, ann->activation_function_output, ann->activation_steepness_hidden, ann->activation_steepness_output);
+		 */
+		/* save the number layers "num_layers learning_rate connection_rate shortcut_connections" */
+		fprintf(conf, "%u %f %f %u\n", ann->last_layer - ann->first_layer, ann->learning_rate,
+				ann->connection_rate, ann->shortcut_connections);
 	}
 #else
 	/* save the decimal_point on a seperate line */
 	fprintf(conf, "%u\n", ann->decimal_point);
-	
+
 	/* save the number layers "num_layers learning_rate connection_rate shortcut_connections activation_function_hidden activation_function_output activation_steepness_hidden activation_steepness_output"
-	fprintf(conf, "%u %f %f %u %u %u "FANNPRINTF" "FANNPRINTF"\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections, ann->activation_function_hidden, ann->activation_function_output, ann->activation_steepness_hidden, ann->activation_steepness_output);	
-	*/	
+	 * fprintf(conf, "%u %f %f %u %u %u "FANNPRINTF" "FANNPRINTF"\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections, ann->activation_function_hidden, ann->activation_function_output, ann->activation_steepness_hidden, ann->activation_steepness_output);   
+	 */
 
-	/* save the number layers "num_layers learning_rate connection_rate shortcut_connections activation_function_hidden activation_function_output activation_steepness_hidden activation_steepness_output" */	
-	fprintf(conf, "%u %f %f %u\n", ann->last_layer - ann->first_layer, ann->learning_rate, ann->connection_rate, ann->shortcut_connections);	
+	/* save the number layers "num_layers learning_rate connection_rate shortcut_connections activation_function_hidden activation_function_output activation_steepness_hidden activation_steepness_output" */
+	fprintf(conf, "%u %f %f %u\n", ann->last_layer - ann->first_layer, ann->learning_rate,
+			ann->connection_rate, ann->shortcut_connections);
 #endif
 
-	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++){
+	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++)
+	{
 		/* the number of neurons in the layers (in the last layer, there is always one too many neurons, because of an unused bias) */
 		fprintf(conf, "%u ", layer_it->last_neuron - layer_it->first_neuron);
 	}
 	fprintf(conf, "\n");
 
-	
-	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++){
+
+	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++)
+	{
 		/* the number of connections to each neuron */
-		for(neuron_it = layer_it->first_neuron; neuron_it != layer_it->last_neuron; neuron_it++){
+		for(neuron_it = layer_it->first_neuron; neuron_it != layer_it->last_neuron; neuron_it++)
+		{
 #ifndef FIXEDFANN
-			if(save_as_fixed){
-				fprintf(conf, "%u %u %u ", neuron_it->last_con - neuron_it->first_con, 
-					neuron_it->activation_function, (int)floor((neuron_it->activation_steepness*fixed_multiplier) + 0.5));
-			} else {
-				fprintf(conf, "%u %u "FANNPRINTF" ", neuron_it->last_con - neuron_it->first_con, 
-					neuron_it->activation_function, neuron_it->activation_steepness);
+			if(save_as_fixed)
+			{
+				fprintf(conf, "%u %u %u ", neuron_it->last_con - neuron_it->first_con,
+						neuron_it->activation_function,
+						(int) floor((neuron_it->activation_steepness * fixed_multiplier) + 0.5));
+			}
+			else
+			{
+				fprintf(conf, "%u %u " FANNPRINTF " ", neuron_it->last_con - neuron_it->first_con,
+						neuron_it->activation_function, neuron_it->activation_steepness);
 			}
 #else
-			fprintf(conf, "%u %u "FANNPRINTF" ", neuron_it->last_con - neuron_it->first_con, 
-				neuron_it->activation_function, neuron_it->activation_steepness);			
+			fprintf(conf, "%u %u " FANNPRINTF " ", neuron_it->last_con - neuron_it->first_con,
+					neuron_it->activation_function, neuron_it->activation_steepness);
 #endif
 		}
 		fprintf(conf, "\n");
@@ -202,34 +233,36 @@ int fann_save_internal_fd(struct fann *ann, FILE *conf, const char *configuratio
 	connected_neurons = ann->connections;
 	weights = ann->weights;
 	first_neuron = ann->first_layer->first_neuron;
-	
-	/* Now save all the connections.
-	   We only need to save the source and the weight,
-	   since the destination is given by the order.
 
-	   The weight is not saved binary due to differences
-	   in binary definition of floating point numbers.
-	   Especially an iPAQ does not use the same binary
-	   representation as an i386 machine.
+	/* Now save all the connections.
+	 * We only need to save the source and the weight,
+	 * since the destination is given by the order.
+	 * 
+	 * The weight is not saved binary due to differences
+	 * in binary definition of floating point numbers.
+	 * Especially an iPAQ does not use the same binary
+	 * representation as an i386 machine.
 	 */
-	for(i = 0; i < ann->total_connections; i++){
+	for(i = 0; i < ann->total_connections; i++)
+	{
 #ifndef FIXEDFANN
-		if(save_as_fixed){
-			/* save the connection "(source weight) "*/
+		if(save_as_fixed)
+		{
+			/* save the connection "(source weight) " */
 			fprintf(conf, "(%u %d) ",
-				connected_neurons[i] - first_neuron,
-				(int)floor((weights[i]*fixed_multiplier) + 0.5));
-		}else{
-			/* save the connection "(source weight) "*/
-			fprintf(conf, "(%u "FANNPRINTF") ",
-				connected_neurons[i] - first_neuron, weights[i]);
+					connected_neurons[i] - first_neuron,
+					(int) floor((weights[i] * fixed_multiplier) + 0.5));
+		}
+		else
+		{
+			/* save the connection "(source weight) " */
+			fprintf(conf, "(%u " FANNPRINTF ") ", connected_neurons[i] - first_neuron, weights[i]);
 		}
 #else
-		/* save the connection "(source weight) "*/
-		fprintf(conf, "(%u "FANNPRINTF") ",
-			connected_neurons[i] - first_neuron, weights[i]);
+		/* save the connection "(source weight) " */
+		fprintf(conf, "(%u " FANNPRINTF ") ", connected_neurons[i] - first_neuron, weights[i]);
 #endif
-		
+
 	}
 	fprintf(conf, "\n");
 
@@ -239,11 +272,14 @@ int fann_save_internal_fd(struct fann *ann, FILE *conf, const char *configuratio
 /* INTERNAL FUNCTION
    Save the train data structure.
  */
-void fann_save_train_internal(struct fann_train_data* data, char *filename, unsigned int save_as_fixed, unsigned int decimal_point)
-{	
+void fann_save_train_internal(struct fann_train_data *data, char *filename,
+							  unsigned int save_as_fixed, unsigned int decimal_point)
+{
 	FILE *file = fopen(filename, "w");
-	if(!file){
-		fann_error((struct fann_error*)data, FANN_E_CANT_OPEN_TD_W, filename);
+
+	if(!file)
+	{
+		fann_error((struct fann_error *) data, FANN_E_CANT_OPEN_TD_W, filename);
 		return;
 	}
 	fann_save_train_internal_fd(data, file, filename, save_as_fixed, decimal_point);
@@ -253,51 +289,68 @@ void fann_save_train_internal(struct fann_train_data* data, char *filename, unsi
 /* INTERNAL FUNCTION
    Save the train data structure.
  */
-void fann_save_train_internal_fd(struct fann_train_data* data, FILE *file, char *filename, unsigned int save_as_fixed, unsigned int decimal_point)
+void fann_save_train_internal_fd(struct fann_train_data *data, FILE * file, char *filename,
+								 unsigned int save_as_fixed, unsigned int decimal_point)
 {
 	unsigned int num_data = data->num_data;
 	unsigned int num_input = data->num_input;
 	unsigned int num_output = data->num_output;
 	unsigned int i, j;
+
 #ifndef FIXEDFANN
 	unsigned int multiplier = 1 << decimal_point;
 #endif
-	
+
 	fprintf(file, "%u %u %u\n", data->num_data, data->num_input, data->num_output);
 
-	for(i = 0; i < num_data; i++){
-		for(j = 0; j < num_input; j++){
+	for(i = 0; i < num_data; i++)
+	{
+		for(j = 0; j < num_input; j++)
+		{
 #ifndef FIXEDFANN
-			if(save_as_fixed){
-				fprintf(file, "%d ", (int)(data->input[i][j]*multiplier));
-			}else{
-				if(((int)floor(data->input[i][j]+0.5)*1000000) ==
-					((int)floor(data->input[i][j]*1000000.0+0.5))){
-					fprintf(file, "%d ", (int)data->input[i][j]);
-				}else{
+			if(save_as_fixed)
+			{
+				fprintf(file, "%d ", (int) (data->input[i][j] * multiplier));
+			}
+			else
+			{
+				if(((int) floor(data->input[i][j] + 0.5) * 1000000) ==
+				   ((int) floor(data->input[i][j] * 1000000.0 + 0.5)))
+				{
+					fprintf(file, "%d ", (int) data->input[i][j]);
+				}
+				else
+				{
 					fprintf(file, "%f ", data->input[i][j]);
 				}
 			}
 #else
-			fprintf(file, FANNPRINTF" ", data->input[i][j]);
+			fprintf(file, FANNPRINTF " ", data->input[i][j]);
 #endif
 		}
 		fprintf(file, "\n");
 
-		for(j = 0; j < num_output; j++){
+		for(j = 0; j < num_output; j++)
+		{
 #ifndef FIXEDFANN
-			if(save_as_fixed){
-				fprintf(file, "%d ", (int)(data->output[i][j]*multiplier));
-			}else{
-				if(((int)floor(data->output[i][j]+0.5)*1000000) ==
-					((int)floor(data->output[i][j]*1000000.0+0.5))){
-					fprintf(file, "%d ", (int)data->output[i][j]);
-				}else{
+			if(save_as_fixed)
+			{
+				fprintf(file, "%d ", (int) (data->output[i][j] * multiplier));
+			}
+			else
+			{
+				if(((int) floor(data->output[i][j] + 0.5) * 1000000) ==
+				   ((int) floor(data->output[i][j] * 1000000.0 + 0.5)))
+				{
+					fprintf(file, "%d ", (int) data->output[i][j]);
+				}
+				else
+				{
 					fprintf(file, "%f ", data->output[i][j]);
 				}
 			}
 #else
-			fprintf(file, FANNPRINTF" ", data->output[i][j]);
+			fprintf(file, FANNPRINTF " ", data->output[i][j]);
 #endif
 		}
 		fprintf(file, "\n");
@@ -306,10 +359,11 @@ void fann_save_train_internal_fd(struct fann_train_data* data, FILE *file, char
 
 /* INTERNAL FUNCTION
    Create a network from a configuration file descriptor. (backward compatible read of version 1.1 files)
- */ 
-struct fann * fann_create_from_fd_1_1(FILE *conf, const char *configuration_file)
+ */
+struct fann *fann_create_from_fd_1_1(FILE * conf, const char *configuration_file)
 {
-	unsigned int num_layers, layer_size, activation_function_hidden, activation_function_output, input_neuron, i, shortcut_connections, num_connections;
+	unsigned int num_layers, layer_size, activation_function_hidden, activation_function_output,
+		input_neuron, i, shortcut_connections, num_connections;
 #ifdef FIXEDFANN
 	unsigned int decimal_point, multiplier;
 #endif
@@ -319,22 +373,29 @@ struct fann * fann_create_from_fd_1_1(FILE *conf, const char *configuration_file
 	fann_type *weights;
 	struct fann_layer *layer_it;
 	struct fann *ann;
-		
+
 #ifdef FIXEDFANN
-	if(fscanf(conf, "%u\n", &decimal_point) != 1){
+	if(fscanf(conf, "%u\n", &decimal_point) != 1)
+	{
 		fann_error(NULL, FANN_E_CANT_READ_CONFIG, configuration_file);
 		return NULL;
 	}
 	multiplier = 1 << decimal_point;
 #endif
-	
-	if(fscanf(conf, "%u %f %f %u %u %u "FANNSCANF" "FANNSCANF"\n", &num_layers, &learning_rate, &connection_rate, &shortcut_connections, &activation_function_hidden, &activation_function_output, &activation_steepness_hidden, &activation_steepness_output) != 8){
+
+	if(fscanf
+	   (conf, "%u %f %f %u %u %u " FANNSCANF " " FANNSCANF "\n", &num_layers, &learning_rate,
+		&connection_rate, &shortcut_connections, &activation_function_hidden,
+		&activation_function_output, &activation_steepness_hidden,
+		&activation_steepness_output) != 8)
+	{
 		fann_error(NULL, FANN_E_CANT_READ_CONFIG, configuration_file);
 		return NULL;
 	}
-	
+
 	ann = fann_allocate_structure(learning_rate, num_layers);
-	if(ann == NULL){
+	if(ann == NULL)
+	{
 		return NULL;
 	}
 	ann->connection_rate = connection_rate;
@@ -348,79 +409,90 @@ struct fann * fann_create_from_fd_1_1(FILE *conf, const char *configuration_file
 #ifdef FIXEDFANN
 	fann_update_stepwise(ann);
 #endif
-	
+
 #ifdef DEBUG
 	printf("creating network with learning rate %f\n", learning_rate);
 	printf("input\n");
 #endif
-	
+
 	/* determine how many neurons there should be in each layer */
-	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++){
-		if(fscanf(conf, "%u ", &layer_size) != 1){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_READ_NEURON, configuration_file);
+	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++)
+	{
+		if(fscanf(conf, "%u ", &layer_size) != 1)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_READ_NEURON, configuration_file);
 			fann_destroy(ann);
 			return NULL;
 		}
 		/* we do not allocate room here, but we make sure that
-		   last_neuron - first_neuron is the number of neurons */
+		 * last_neuron - first_neuron is the number of neurons */
 		layer_it->first_neuron = NULL;
 		layer_it->last_neuron = layer_it->first_neuron + layer_size;
 		ann->total_neurons += layer_size;
 #ifdef DEBUG
-		if(ann->shortcut_connections && layer_it != ann->first_layer){
+		if(ann->shortcut_connections && layer_it != ann->first_layer)
+		{
 			printf("  layer       : %d neurons, 0 bias\n", layer_size);
-		} else {
-			printf("  layer       : %d neurons, 1 bias\n", layer_size-1);
+		}
+		else
+		{
+			printf("  layer       : %d neurons, 1 bias\n", layer_size - 1);
 		}
 #endif
 	}
-	
+
 	ann->num_input = ann->first_layer->last_neuron - ann->first_layer->first_neuron - 1;
-	ann->num_output = ((ann->last_layer-1)->last_neuron - (ann->last_layer-1)->first_neuron);
-	if(!ann->shortcut_connections){
+	ann->num_output = ((ann->last_layer - 1)->last_neuron - (ann->last_layer - 1)->first_neuron);
+	if(!ann->shortcut_connections)
+	{
 		/* one too many (bias) in the output layer */
 		ann->num_output--;
 	}
-	
+
 	/* allocate room for the actual neurons */
 	fann_allocate_neurons(ann);
-	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM){
+	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM)
+	{
 		fann_destroy(ann);
 		return NULL;
 	}
-	
-	last_neuron = (ann->last_layer-1)->last_neuron;
-	for(neuron_it = ann->first_layer->first_neuron;
-		neuron_it != last_neuron; neuron_it++){
-		if(fscanf(conf, "%u ", &num_connections) != 1){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_READ_NEURON, configuration_file);
+
+	last_neuron = (ann->last_layer - 1)->last_neuron;
+	for(neuron_it = ann->first_layer->first_neuron; neuron_it != last_neuron; neuron_it++)
+	{
+		if(fscanf(conf, "%u ", &num_connections) != 1)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_READ_NEURON, configuration_file);
 			fann_destroy(ann);
 			return NULL;
 		}
 		neuron_it->first_con = ann->total_connections;
 		ann->total_connections += num_connections;
-		neuron_it->last_con = ann->total_connections;		
+		neuron_it->last_con = ann->total_connections;
 	}
-	
+
 	fann_allocate_connections(ann);
-	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM){
+	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM)
+	{
 		fann_destroy(ann);
 		return NULL;
 	}
-	
+
 	connected_neurons = ann->connections;
 	weights = ann->weights;
 	first_neuron = ann->first_layer->first_neuron;
-	
-	for(i = 0; i < ann->total_connections; i++){
-		if(fscanf(conf, "(%u "FANNSCANF") ", &input_neuron, &weights[i]) != 2){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_READ_CONNECTIONS, configuration_file);
+
+	for(i = 0; i < ann->total_connections; i++)
+	{
+		if(fscanf(conf, "(%u " FANNSCANF ") ", &input_neuron, &weights[i]) != 2)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_READ_CONNECTIONS, configuration_file);
 			fann_destroy(ann);
 			return NULL;
 		}
-		connected_neurons[i] = first_neuron+input_neuron;
-	}	
-	
+		connected_neurons[i] = first_neuron + input_neuron;
+	}
+
 	fann_set_activation_steepness_hidden(ann, activation_steepness_hidden);
 	fann_set_activation_steepness_output(ann, activation_steepness_output);
 	fann_set_activation_function_hidden(ann, activation_function_hidden);
@@ -435,9 +507,10 @@ struct fann * fann_create_from_fd_1_1(FILE *conf, const char *configuration_file
 /* INTERNAL FUNCTION
    Create a network from a configuration file descriptor.
  */
-struct fann * fann_create_from_fd(FILE *conf, const char *configuration_file)
+struct fann *fann_create_from_fd(FILE * conf, const char *configuration_file)
 {
 	unsigned int num_layers, layer_size, input_neuron, i, shortcut_connections, num_connections;
+
 #ifdef FIXEDFANN
 	unsigned int decimal_point, multiplier;
 #endif
@@ -446,23 +519,27 @@ struct fann * fann_create_from_fd(FILE *conf, const char *configuration_file)
 	fann_type *weights;
 	struct fann_layer *layer_it;
 	struct fann *ann;
-	
+
 	char *read_version;
-	
-	read_version = (char *)calloc(strlen(FANN_CONF_VERSION"\n"), 1);
-	if(read_version == NULL){
+
+	read_version = (char *) calloc(strlen(FANN_CONF_VERSION "\n"), 1);
+	if(read_version == NULL)
+	{
 		fann_error(NULL, FANN_E_CANT_ALLOCATE_MEM);
 		return NULL;
 	}
-	
-	fread(read_version, 1, strlen(FANN_CONF_VERSION"\n"), conf); /* reads version */
-	
+
+	fread(read_version, 1, strlen(FANN_CONF_VERSION "\n"), conf);	/* reads version */
+
 	/* compares the version information */
-	if(strncmp(read_version, FANN_CONF_VERSION"\n", strlen(FANN_CONF_VERSION"\n")) != 0){
+	if(strncmp(read_version, FANN_CONF_VERSION "\n", strlen(FANN_CONF_VERSION "\n")) != 0)
+	{
 #ifdef FIXEDFANN
-		if(strncmp(read_version, "FANN_FIX_1.1\n", strlen("FANN_FIX_1.1\n")) == 0){
+		if(strncmp(read_version, "FANN_FIX_1.1\n", strlen("FANN_FIX_1.1\n")) == 0)
+		{
 #else
-		if(strncmp(read_version, "FANN_FLO_1.1\n", strlen("FANN_FLO_1.1\n")) == 0){			
+		if(strncmp(read_version, "FANN_FLO_1.1\n", strlen("FANN_FLO_1.1\n")) == 0)
+		{
 #endif
 			free(read_version);
 			return fann_create_from_fd_1_1(conf, configuration_file);
@@ -470,27 +547,32 @@ struct fann * fann_create_from_fd(FILE *conf, const char *configuration_file)
 
 		free(read_version);
 		fann_error(NULL, FANN_E_WRONG_CONFIG_VERSION, configuration_file);
-		
+
 		return NULL;
 	}
 
 	free(read_version);
-	
+
 #ifdef FIXEDFANN
-	if(fscanf(conf, "%u\n", &decimal_point) != 1){
+	if(fscanf(conf, "%u\n", &decimal_point) != 1)
+	{
 		fann_error(NULL, FANN_E_CANT_READ_CONFIG, configuration_file);
 		return NULL;
 	}
 	multiplier = 1 << decimal_point;
 #endif
-	
-	if(fscanf(conf, "%u %f %f %u\n", &num_layers, &learning_rate, &connection_rate, &shortcut_connections) != 4){
+
+	if(fscanf
+	   (conf, "%u %f %f %u\n", &num_layers, &learning_rate, &connection_rate,
+		&shortcut_connections) != 4)
+	{
 		fann_error(NULL, FANN_E_CANT_READ_CONFIG, configuration_file);
 		return NULL;
 	}
-	
+
 	ann = fann_allocate_structure(learning_rate, num_layers);
-	if(ann == NULL){
+	if(ann == NULL)
+	{
 		return NULL;
 	}
 	ann->connection_rate = connection_rate;
@@ -504,85 +586,98 @@ struct fann * fann_create_from_fd(FILE *conf, const char *configuration_file)
 #ifdef FIXEDFANN
 	fann_update_stepwise(ann);
 #endif
-	
+
 #ifdef DEBUG
 	printf("creating network with learning rate %f\n", learning_rate);
 	printf("input\n");
 #endif
-	
+
 	/* determine how many neurons there should be in each layer */
-	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++){
-		if(fscanf(conf, "%u ", &layer_size) != 1){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_READ_NEURON, configuration_file);
+	for(layer_it = ann->first_layer; layer_it != ann->last_layer; layer_it++)
+	{
+		if(fscanf(conf, "%u ", &layer_size) != 1)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_READ_NEURON, configuration_file);
 			fann_destroy(ann);
 			return NULL;
 		}
 		/* we do not allocate room here, but we make sure that
-		   last_neuron - first_neuron is the number of neurons */
+		 * last_neuron - first_neuron is the number of neurons */
 		layer_it->first_neuron = NULL;
 		layer_it->last_neuron = layer_it->first_neuron + layer_size;
 		ann->total_neurons += layer_size;
 #ifdef DEBUG
-		if(ann->shortcut_connections && layer_it != ann->first_layer){
+		if(ann->shortcut_connections && layer_it != ann->first_layer)
+		{
 			printf("  layer       : %d neurons, 0 bias\n", layer_size);
-		} else {
-			printf("  layer       : %d neurons, 1 bias\n", layer_size-1);
+		}
+		else
+		{
+			printf("  layer       : %d neurons, 1 bias\n", layer_size - 1);
 		}
 #endif
 	}
-	
+
 	ann->num_input = ann->first_layer->last_neuron - ann->first_layer->first_neuron - 1;
-	ann->num_output = ((ann->last_layer-1)->last_neuron - (ann->last_layer-1)->first_neuron);
-	if(!ann->shortcut_connections){
+	ann->num_output = ((ann->last_layer - 1)->last_neuron - (ann->last_layer - 1)->first_neuron);
+	if(!ann->shortcut_connections)
+	{
 		/* one too many (bias) in the output layer */
 		ann->num_output--;
 	}
-	
+
 	/* allocate room for the actual neurons */
 	fann_allocate_neurons(ann);
-	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM){
+	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM)
+	{
 		fann_destroy(ann);
 		return NULL;
 	}
-	
-	last_neuron = (ann->last_layer-1)->last_neuron;
-	for(neuron_it = ann->first_layer->first_neuron;
-		neuron_it != last_neuron; neuron_it++){
-		if(fscanf(conf, "%u %u "FANNSCANF" ", &num_connections, &neuron_it->activation_function, &neuron_it->activation_steepness) != 3){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_READ_NEURON, configuration_file);
+
+	last_neuron = (ann->last_layer - 1)->last_neuron;
+	for(neuron_it = ann->first_layer->first_neuron; neuron_it != last_neuron; neuron_it++)
+	{
+		if(fscanf
+		   (conf, "%u %u " FANNSCANF " ", &num_connections, &neuron_it->activation_function,
+			&neuron_it->activation_steepness) != 3)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_READ_NEURON, configuration_file);
 			fann_destroy(ann);
 			return NULL;
 		}
 		neuron_it->first_con = ann->total_connections;
 		ann->total_connections += num_connections;
-		neuron_it->last_con = ann->total_connections;		
+		neuron_it->last_con = ann->total_connections;
 	}
-	
+
 	fann_allocate_connections(ann);
-	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM){
+	if(ann->errno_f == FANN_E_CANT_ALLOCATE_MEM)
+	{
 		fann_destroy(ann);
 		return NULL;
 	}
-	
+
 	connected_neurons = ann->connections;
 	weights = ann->weights;
 	first_neuron = ann->first_layer->first_neuron;
-	
-	for(i = 0; i < ann->total_connections; i++){
-		if(fscanf(conf, "(%u "FANNSCANF") ", &input_neuron, &weights[i]) != 2){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_READ_CONNECTIONS, configuration_file);
+
+	for(i = 0; i < ann->total_connections; i++)
+	{
+		if(fscanf(conf, "(%u " FANNSCANF ") ", &input_neuron, &weights[i]) != 2)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_READ_CONNECTIONS, configuration_file);
 			fann_destroy(ann);
 			return NULL;
 		}
-		connected_neurons[i] = first_neuron+input_neuron;
-	}	
-	
+		connected_neurons[i] = first_neuron + input_neuron;
+	}
+
 	/*
-	fann_set_activation_steepness_hidden(ann, activation_steepness_hidden);
-	fann_set_activation_steepness_output(ann, activation_steepness_output);
-	fann_set_activation_function_hidden(ann, activation_function_hidden);
-	fann_set_activation_function_output(ann, activation_function_output);
-	*/
+	 * fann_set_activation_steepness_hidden(ann, activation_steepness_hidden);
+	 * fann_set_activation_steepness_output(ann, activation_steepness_output);
+	 * fann_set_activation_function_hidden(ann, activation_function_hidden);
+	 * fann_set_activation_function_output(ann, activation_function_output);
+	 */
 
 #ifdef DEBUG
 	printf("output\n");
diff --git a/src/fann_options.c b/src/fann_options.c
index 5fe46d5..54747a1 100644
--- a/src/fann_options.c
+++ b/src/fann_options.c
@@ -30,15 +30,19 @@
 FANN_EXTERNAL void FANN_API fann_print_parameters(struct fann *ann)
 {
 	struct fann_layer *layer_it;
-	
+
 	printf("Input layer                :%4d neurons, 1 bias\n", ann->num_input);
-	for(layer_it = ann->first_layer+1; layer_it != ann->last_layer-1; layer_it++){
-		if(ann->shortcut_connections){
+	for(layer_it = ann->first_layer + 1; layer_it != ann->last_layer - 1; layer_it++)
+	{
+		if(ann->shortcut_connections)
+		{
 			printf("  Hidden layer             :%4d neurons, 0 bias\n",
-				layer_it->last_neuron - layer_it->first_neuron);
-		} else {
+				   layer_it->last_neuron - layer_it->first_neuron);
+		}
+		else
+		{
 			printf("  Hidden layer             :%4d neurons, 1 bias\n",
-				layer_it->last_neuron - layer_it->first_neuron - 1);
+				   layer_it->last_neuron - layer_it->first_neuron - 1);
 		}
 	}
 	printf("Output layer               :%4d neurons\n", ann->num_output);
@@ -46,7 +50,7 @@ FANN_EXTERNAL void FANN_API fann_print_parameters(struct fann *ann)
 	printf("Total connections          :%4d\n", ann->total_connections);
 	printf("Connection rate            :  %5.2f\n", ann->connection_rate);
 	printf("Shortcut connections       :%4d\n", ann->shortcut_connections);
-	printf("Training algorithm         :   %s\n", FANN_TRAIN_NAMES[ann->training_algorithm]);	
+	printf("Training algorithm         :   %s\n", FANN_TRAIN_NAMES[ann->training_algorithm]);
 	printf("Learning rate              :  %5.2f\n", ann->learning_rate);
 /*	printf("Activation function hidden :   %s\n", FANN_ACTIVATION_NAMES[ann->activation_function_hidden]);
 	printf("Activation function output :   %s\n", FANN_ACTIVATION_NAMES[ann->activation_function_output]);
@@ -81,7 +85,8 @@ FANN_EXTERNAL unsigned int FANN_API fann_get_training_algorithm(struct fann *ann
 	return ann->training_algorithm;
 }
 
-FANN_EXTERNAL void FANN_API fann_set_training_algorithm(struct fann *ann, unsigned int training_algorithm)
+FANN_EXTERNAL void FANN_API fann_set_training_algorithm(struct fann *ann,
+														unsigned int training_algorithm)
 {
 	ann->training_algorithm = training_algorithm;
 }
@@ -91,12 +96,14 @@ FANN_EXTERNAL void FANN_API fann_set_learning_rate(struct fann *ann, float learn
 	ann->learning_rate = learning_rate;
 }
 
-FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann, unsigned int activation_function)
+FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann,
+																unsigned int activation_function)
 {
 	struct fann_neuron *last_neuron, *neuron_it;
 	struct fann_layer *layer_it;
-	struct fann_layer *last_layer = ann->last_layer-1; /* -1 to not update the output layer */
-	for(layer_it = ann->first_layer+1; layer_it != last_layer; layer_it++)
+	struct fann_layer *last_layer = ann->last_layer - 1;	/* -1 to not update the output layer */
+
+	for(layer_it = ann->first_layer + 1; layer_it != last_layer; layer_it++)
 	{
 		last_neuron = layer_it->last_neuron;
 		for(neuron_it = layer_it->first_neuron; neuron_it != last_neuron; neuron_it++)
@@ -106,10 +113,11 @@ FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann
 	}
 }
 
-FANN_EXTERNAL void FANN_API fann_set_activation_function_output(struct fann *ann, unsigned int activation_function)
+FANN_EXTERNAL void FANN_API fann_set_activation_function_output(struct fann *ann,
+																unsigned int activation_function)
 {
 	struct fann_neuron *last_neuron, *neuron_it;
-	struct fann_layer *last_layer = ann->last_layer-1;
+	struct fann_layer *last_layer = ann->last_layer - 1;
 
 	last_neuron = last_layer->last_neuron;
 	for(neuron_it = last_layer->first_neuron; neuron_it != last_neuron; neuron_it++)
@@ -118,12 +126,14 @@ FANN_EXTERNAL void FANN_API fann_set_activation_function_output(struct fann *ann
 	}
 }
 
-FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *ann, fann_type steepness)
+FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *ann,
+																 fann_type steepness)
 {
 	struct fann_neuron *last_neuron, *neuron_it;
 	struct fann_layer *layer_it;
-	struct fann_layer *last_layer = ann->last_layer-1; /* -1 to not update the output layer */
-	for(layer_it = ann->first_layer+1; layer_it != last_layer; layer_it++)
+	struct fann_layer *last_layer = ann->last_layer - 1;	/* -1 to not update the output layer */
+
+	for(layer_it = ann->first_layer + 1; layer_it != last_layer; layer_it++)
 	{
 		last_neuron = layer_it->last_neuron;
 		for(neuron_it = layer_it->first_neuron; neuron_it != last_neuron; neuron_it++)
@@ -133,10 +143,11 @@ FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *an
 	}
 }
 
-FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *ann, fann_type steepness)
+FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *ann,
+																 fann_type steepness)
 {
 	struct fann_neuron *last_neuron, *neuron_it;
-	struct fann_layer *last_layer = ann->last_layer-1;
+	struct fann_layer *last_layer = ann->last_layer - 1;
 
 	last_neuron = last_layer->last_neuron;
 	for(neuron_it = last_layer->first_neuron; neuron_it != last_neuron; neuron_it++)
@@ -145,12 +156,14 @@ FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *an
 	}
 }
 
-FANN_EXTERNAL void FANN_API fann_set_activation_hidden_steepness(struct fann *ann, fann_type steepness)
+FANN_EXTERNAL void FANN_API fann_set_activation_hidden_steepness(struct fann *ann,
+																 fann_type steepness)
 {
 	fann_set_activation_steepness_hidden(ann, steepness);
 }
 
-FANN_EXTERNAL void FANN_API fann_set_activation_output_steepness(struct fann *ann, fann_type steepness)
+FANN_EXTERNAL void FANN_API fann_set_activation_output_steepness(struct fann *ann,
+																 fann_type steepness)
 {
 	fann_set_activation_steepness_output(ann, steepness);
 }
@@ -204,9 +217,12 @@ FANN_EXTERNAL fann_type FANN_API fann_get_activation_steepness_output(struct fan
 
 FANN_EXTERNAL unsigned int FANN_API fann_get_total_neurons(struct fann *ann)
 {
-	if(ann->shortcut_connections){
+	if(ann->shortcut_connections)
+	{
 		return ann->total_neurons;
-	} else {
+	}
+	else
+	{
 		/* -1, because there is always an unused bias neuron in the last layer */
 		return ann->total_neurons - 1;
 	}
@@ -221,7 +237,8 @@ FANN_EXTERNAL unsigned int FANN_API fann_get_total_connections(struct fann *ann)
    Makes the error used for calculating the slopes
    higher when the difference is higher.
  */
-FANN_EXTERNAL void FANN_API fann_set_train_error_function(struct fann *ann, unsigned int train_error_function)
+FANN_EXTERNAL void FANN_API fann_set_train_error_function(struct fann *ann,
+														  unsigned int train_error_function)
 {
 	ann->train_error_function = train_error_function;
 }
@@ -231,7 +248,7 @@ FANN_EXTERNAL void FANN_API fann_set_quickprop_decay(struct fann *ann, float qui
 {
 	ann->quickprop_decay = quickprop_decay;
 }
-	
+
 /* Mu is a factor used to increase and decrease the stepsize (default 1.75). */
 FANN_EXTERNAL void FANN_API fann_set_quickprop_mu(struct fann *ann, float quickprop_mu)
 {
@@ -239,13 +256,15 @@ FANN_EXTERNAL void FANN_API fann_set_quickprop_mu(struct fann *ann, float quickp
 }
 
 /* Tells how much the stepsize should increase during learning (default 1.2). */
-FANN_EXTERNAL void FANN_API fann_set_rprop_increase_factor(struct fann *ann, float rprop_increase_factor)
+FANN_EXTERNAL void FANN_API fann_set_rprop_increase_factor(struct fann *ann,
+														   float rprop_increase_factor)
 {
 	ann->rprop_increase_factor = rprop_increase_factor;
 }
 
 /* Tells how much the stepsize should decrease during learning (default 0.5). */
-FANN_EXTERNAL void FANN_API fann_set_rprop_decrease_factor(struct fann *ann, float rprop_decrease_factor)
+FANN_EXTERNAL void FANN_API fann_set_rprop_decrease_factor(struct fann *ann,
+														   float rprop_decrease_factor)
 {
 	ann->rprop_decrease_factor = rprop_decrease_factor;
 }
@@ -276,7 +295,7 @@ FANN_EXTERNAL float FANN_API fann_get_quickprop_decay(struct fann *ann)
 {
 	return ann->quickprop_decay;
 }
-	
+
 /* Mu is a factor used to increase and decrease the stepsize (default 1.75). */
 FANN_EXTERNAL float FANN_API fann_get_quickprop_mu(struct fann *ann)
 {
@@ -328,44 +347,63 @@ FANN_EXTERNAL unsigned int FANN_API fann_get_multiplier(struct fann *ann)
 void fann_update_stepwise(struct fann *ann)
 {
 	unsigned int i = 0;
+
 	/* Calculate the parameters for the stepwise linear
-	   sigmoid function fixed point.
-	   Using a rewritten sigmoid function.
-	   results 0.005, 0.05, 0.25, 0.75, 0.95, 0.995
-	*/
-	ann->sigmoid_results[0] = fann_max((fann_type)(ann->multiplier/200.0+0.5), 1);
-	ann->sigmoid_results[1] = (fann_type)(ann->multiplier/20.0+0.5);
-	ann->sigmoid_results[2] = (fann_type)(ann->multiplier/4.0+0.5);
-	ann->sigmoid_results[3] = ann->multiplier - (fann_type)(ann->multiplier/4.0+0.5);
-	ann->sigmoid_results[4] = ann->multiplier - (fann_type)(ann->multiplier/20.0+0.5);
-	ann->sigmoid_results[5] = fann_min(ann->multiplier - (fann_type)(ann->multiplier/200.0+0.5), ann->multiplier-1);
-
-	ann->sigmoid_symmetric_results[0] = fann_max((fann_type)((ann->multiplier/100.0) - ann->multiplier-0.5), (fann_type)(1-(fann_type)ann->multiplier));
-	ann->sigmoid_symmetric_results[1] = (fann_type)((ann->multiplier/10.0) - ann->multiplier-0.5);
-	ann->sigmoid_symmetric_results[2] = (fann_type)((ann->multiplier/2.0) - ann->multiplier-0.5);
-	ann->sigmoid_symmetric_results[3] = ann->multiplier - (fann_type)(ann->multiplier/2.0+0.5);
-	ann->sigmoid_symmetric_results[4] = ann->multiplier - (fann_type)(ann->multiplier/10.0+0.5);
-	ann->sigmoid_symmetric_results[5] = fann_min(ann->multiplier - (fann_type)(ann->multiplier/100.0+1.0), ann->multiplier-1);
+	 * sigmoid function fixed point.
+	 * Using a rewritten sigmoid function.
+	 * results 0.005, 0.05, 0.25, 0.75, 0.95, 0.995
+	 */
+	ann->sigmoid_results[0] = fann_max((fann_type) (ann->multiplier / 200.0 + 0.5), 1);
+	ann->sigmoid_results[1] = (fann_type) (ann->multiplier / 20.0 + 0.5);
+	ann->sigmoid_results[2] = (fann_type) (ann->multiplier / 4.0 + 0.5);
+	ann->sigmoid_results[3] = ann->multiplier - (fann_type) (ann->multiplier / 4.0 + 0.5);
+	ann->sigmoid_results[4] = ann->multiplier - (fann_type) (ann->multiplier / 20.0 + 0.5);
+	ann->sigmoid_results[5] =
+		fann_min(ann->multiplier - (fann_type) (ann->multiplier / 200.0 + 0.5),
+				 ann->multiplier - 1);
+
+	ann->sigmoid_symmetric_results[0] =
+		fann_max((fann_type) ((ann->multiplier / 100.0) - ann->multiplier - 0.5),
+				 (fann_type) (1 - (fann_type) ann->multiplier));
+	ann->sigmoid_symmetric_results[1] =
+		(fann_type) ((ann->multiplier / 10.0) - ann->multiplier - 0.5);
+	ann->sigmoid_symmetric_results[2] =
+		(fann_type) ((ann->multiplier / 2.0) - ann->multiplier - 0.5);
+	ann->sigmoid_symmetric_results[3] = ann->multiplier - (fann_type) (ann->multiplier / 2.0 + 0.5);
+	ann->sigmoid_symmetric_results[4] =
+		ann->multiplier - (fann_type) (ann->multiplier / 10.0 + 0.5);
+	ann->sigmoid_symmetric_results[5] =
+		fann_min(ann->multiplier - (fann_type) (ann->multiplier / 100.0 + 1.0),
+				 ann->multiplier - 1);
 
 	/*DEBUG
-	ann->sigmoid_results[0] = (fann_type)(ann->multiplier/200.0+0.5);
-	ann->sigmoid_results[1] = (fann_type)(ann->multiplier/20.0+0.5);
-	ann->sigmoid_results[2] = (fann_type)(ann->multiplier/4.0+0.5);
-	ann->sigmoid_results[3] = ann->multiplier - (fann_type)(ann->multiplier/4.0+0.5);
-	ann->sigmoid_results[4] = ann->multiplier - (fann_type)(ann->multiplier/20.0+0.5);
-	ann->sigmoid_results[5] = ann->multiplier - (fann_type)(ann->multiplier/200.0+0.5);
-
-	ann->sigmoid_symmetric_results[0] = (fann_type)((ann->multiplier/100.0) - ann->multiplier + 0.5);
-	ann->sigmoid_symmetric_results[1] = (fann_type)((ann->multiplier/10.0) - ann->multiplier + 0.5);
-	ann->sigmoid_symmetric_results[2] = (fann_type)((ann->multiplier/2.0) - ann->multiplier + 0.5);
-	ann->sigmoid_symmetric_results[3] = ann->multiplier - (fann_type)(ann->multiplier/2.0+0.5);
-	ann->sigmoid_symmetric_results[4] = ann->multiplier - (fann_type)(ann->multiplier/10.0+0.5);
-	ann->sigmoid_symmetric_results[5] = ann->multiplier - (fann_type)(ann->multiplier/100.0+0.5);
-	*/
-	
-	for(i = 0; i < 6; i++){
-		ann->sigmoid_values[i] = (fann_type)(((log(ann->multiplier/(float)ann->sigmoid_results[i] -1)*(float)ann->multiplier) / -2.0)*(float)ann->multiplier);
-		ann->sigmoid_symmetric_values[i] = (fann_type)(((log((ann->multiplier - (float)ann->sigmoid_symmetric_results[i])/((float)ann->sigmoid_symmetric_results[i] + ann->multiplier))*(float)ann->multiplier) / -2.0)*(float)ann->multiplier);
+	 * ann->sigmoid_results[0] = (fann_type)(ann->multiplier/200.0+0.5);
+	 * ann->sigmoid_results[1] = (fann_type)(ann->multiplier/20.0+0.5);
+	 * ann->sigmoid_results[2] = (fann_type)(ann->multiplier/4.0+0.5);
+	 * ann->sigmoid_results[3] = ann->multiplier - (fann_type)(ann->multiplier/4.0+0.5);
+	 * ann->sigmoid_results[4] = ann->multiplier - (fann_type)(ann->multiplier/20.0+0.5);
+	 * ann->sigmoid_results[5] = ann->multiplier - (fann_type)(ann->multiplier/200.0+0.5);
+	 * 
+	 * ann->sigmoid_symmetric_results[0] = (fann_type)((ann->multiplier/100.0) - ann->multiplier + 0.5);
+	 * ann->sigmoid_symmetric_results[1] = (fann_type)((ann->multiplier/10.0) - ann->multiplier + 0.5);
+	 * ann->sigmoid_symmetric_results[2] = (fann_type)((ann->multiplier/2.0) - ann->multiplier + 0.5);
+	 * ann->sigmoid_symmetric_results[3] = ann->multiplier - (fann_type)(ann->multiplier/2.0+0.5);
+	 * ann->sigmoid_symmetric_results[4] = ann->multiplier - (fann_type)(ann->multiplier/10.0+0.5);
+	 * ann->sigmoid_symmetric_results[5] = ann->multiplier - (fann_type)(ann->multiplier/100.0+0.5);
+	 */
+
+	for(i = 0; i < 6; i++)
+	{
+		ann->sigmoid_values[i] =
+			(fann_type) (((log(ann->multiplier / (float) ann->sigmoid_results[i] - 1) *
+						   (float) ann->multiplier) / -2.0) * (float) ann->multiplier);
+		ann->sigmoid_symmetric_values[i] =
+			(fann_type) (((log
+						   ((ann->multiplier -
+							 (float) ann->sigmoid_symmetric_results[i]) /
+							((float) ann->sigmoid_symmetric_results[i] +
+							 ann->multiplier)) * (float) ann->multiplier) / -2.0) *
+						 (float) ann->multiplier);
 	}
 }
 #endif
diff --git a/src/fann_train.c b/src/fann_train.c
index 86ea5d6..32b74d8 100644
--- a/src/fann_train.c
+++ b/src/fann_train.c
@@ -34,33 +34,34 @@
    and a steepness
 */
 fann_type fann_activation_derived(unsigned int activation_function,
-	fann_type steepness, fann_type value, fann_type sum)
+								  fann_type steepness, fann_type value, fann_type sum)
 {
-	switch(activation_function){
-		case FANN_LINEAR:
-			return (fann_type)fann_linear_derive(steepness, value);
-		case FANN_SIGMOID:
-		case FANN_SIGMOID_STEPWISE:
-			value = fann_clip(value, 0.01f, 0.99f);
-			return (fann_type)fann_sigmoid_derive(steepness, value);
-		case FANN_SIGMOID_SYMMETRIC:
-		case FANN_SIGMOID_SYMMETRIC_STEPWISE:
-			value = fann_clip(value, -0.98f, 0.98f);
-			return (fann_type)fann_sigmoid_symmetric_derive(steepness, value);
-		case FANN_GAUSSIAN:
-			value = fann_clip(value, 0.01f, 0.99f);
-			return (fann_type)fann_gaussian_derive(steepness, value, sum);
-		case FANN_GAUSSIAN_SYMMETRIC:
-			value = fann_clip(value, -0.98f, 0.98f);
-			return (fann_type)fann_gaussian_symmetric_derive(steepness, value, sum);
-		case FANN_ELLIOT:
-			value = fann_clip(value, 0.01f, 0.99f);
-			return (fann_type)fann_elliot_derive(steepness, value, sum);
-		case FANN_ELLIOT_SYMMETRIC:
-			value = fann_clip(value, -0.98f, 0.98f);
-			return (fann_type)fann_elliot_symmetric_derive(steepness, value, sum);
-		default:
-			return 0;
+	switch (activation_function)
+	{
+	case FANN_LINEAR:
+		return (fann_type) fann_linear_derive(steepness, value);
+	case FANN_SIGMOID:
+	case FANN_SIGMOID_STEPWISE:
+		value = fann_clip(value, 0.01f, 0.99f);
+		return (fann_type) fann_sigmoid_derive(steepness, value);
+	case FANN_SIGMOID_SYMMETRIC:
+	case FANN_SIGMOID_SYMMETRIC_STEPWISE:
+		value = fann_clip(value, -0.98f, 0.98f);
+		return (fann_type) fann_sigmoid_symmetric_derive(steepness, value);
+	case FANN_GAUSSIAN:
+		value = fann_clip(value, 0.01f, 0.99f);
+		return (fann_type) fann_gaussian_derive(steepness, value, sum);
+	case FANN_GAUSSIAN_SYMMETRIC:
+		value = fann_clip(value, -0.98f, 0.98f);
+		return (fann_type) fann_gaussian_symmetric_derive(steepness, value, sum);
+	case FANN_ELLIOT:
+		value = fann_clip(value, 0.01f, 0.99f);
+		return (fann_type) fann_elliot_derive(steepness, value, sum);
+	case FANN_ELLIOT_SYMMETRIC:
+		value = fann_clip(value, -0.98f, 0.98f);
+		return (fann_type) fann_elliot_symmetric_derive(steepness, value, sum);
+	default:
+		return 0;
 	}
 }
 
@@ -68,8 +69,8 @@ fann_type fann_activation_derived(unsigned int activation_function,
   Calculates the activation of a value, given an activation function
    and a steepness
 */
-fann_type fann_activation(struct fann *ann, unsigned int activation_function, fann_type steepness,
-	fann_type value)
+fann_type fann_activation(struct fann * ann, unsigned int activation_function, fann_type steepness,
+						  fann_type value)
 {
 	value = fann_mult(steepness, value);
 	fann_activation_switch(ann, activation_function, value, value);
@@ -78,7 +79,8 @@ fann_type fann_activation(struct fann *ann, unsigned int activation_function, fa
 
 /* Trains the network with the backpropagation algorithm.
  */
-FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type *input, fann_type *desired_output)
+FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type * input,
+									   fann_type * desired_output)
 {
 	fann_run(ann, input);
 
@@ -92,48 +94,51 @@ FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type *input, fann_
 
 /* Tests the network.
  */
-FANN_EXTERNAL fann_type * FANN_API fann_test(struct fann *ann, fann_type *input, fann_type *desired_output)
+FANN_EXTERNAL fann_type *FANN_API fann_test(struct fann *ann, fann_type * input,
+											fann_type * desired_output)
 {
 	fann_type neuron_value;
 	fann_type *output_begin = fann_run(ann, input);
 	fann_type *output_it;
 	const fann_type *output_end = output_begin + ann->num_output;
 	fann_type neuron_diff, neuron_diff2;
-	struct fann_neuron *output_neurons = (ann->last_layer-1)->first_neuron;
+	struct fann_neuron *output_neurons = (ann->last_layer - 1)->first_neuron;
 
 	/* calculate the error */
-	for(output_it = output_begin;
-		output_it != output_end; output_it++){
+	for(output_it = output_begin; output_it != output_end; output_it++)
+	{
 		neuron_value = *output_it;
 
 		neuron_diff = (*desired_output - neuron_value);
-		
-		switch(output_neurons[output_it - output_begin].activation_function)
+
+		switch (output_neurons[output_it - output_begin].activation_function)
 		{
-			case FANN_SIGMOID_SYMMETRIC:
-			case FANN_SIGMOID_SYMMETRIC_STEPWISE:
-			case FANN_ELLIOT_SYMMETRIC:
-			case FANN_GAUSSIAN_SYMMETRIC:
-				neuron_diff /= (fann_type)2;
-				break;
-			default:
-				break;
+		case FANN_SIGMOID_SYMMETRIC:
+		case FANN_SIGMOID_SYMMETRIC_STEPWISE:
+		case FANN_ELLIOT_SYMMETRIC:
+		case FANN_GAUSSIAN_SYMMETRIC:
+			neuron_diff /= (fann_type) 2;
+			break;
+		default:
+			break;
 		}
-		
+
 #ifdef FIXEDFANN
-		neuron_diff2 = (neuron_diff/(float)ann->multiplier) * (neuron_diff/(float)ann->multiplier);
+		neuron_diff2 =
+			(neuron_diff / (float) ann->multiplier) * (neuron_diff / (float) ann->multiplier);
 #else
-		neuron_diff2 = (float)(neuron_diff * neuron_diff);
+		neuron_diff2 = (float) (neuron_diff * neuron_diff);
 #endif
 		ann->MSE_value += neuron_diff2;
-		if(neuron_diff2 >= 0.25){
+		if(neuron_diff2 >= 0.25)
+		{
 			ann->num_bit_fail++;
 		}
-		
+
 		desired_output++;
 	}
 	ann->num_MSE++;
-	
+
 	return output_begin;
 }
 
@@ -149,9 +154,12 @@ FANN_EXTERNAL float FANN_API fann_get_error(struct fann *ann)
  */
 FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann)
 {
-	if(ann->num_MSE){
-		return ann->MSE_value/(float)ann->num_MSE;
-	}else{
+	if(ann->num_MSE)
+	{
+		return ann->MSE_value / (float) ann->num_MSE;
+	}
+	else
+	{
 		return 0;
 	}
 }
@@ -183,66 +191,74 @@ FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann)
 	After this train_errors in the output layer will be set to:
 	neuron_value_derived * (desired_output - neuron_value)
  */
-void fann_compute_MSE(struct fann *ann, fann_type *desired_output)
+void fann_compute_MSE(struct fann *ann, fann_type * desired_output)
 {
 	fann_type neuron_value, neuron_diff, neuron_diff2, *error_it = 0, *error_begin = 0;
-	struct fann_neuron *last_layer_begin = (ann->last_layer-1)->first_neuron;
+	struct fann_neuron *last_layer_begin = (ann->last_layer - 1)->first_neuron;
 	const struct fann_neuron *last_layer_end = last_layer_begin + ann->num_output;
 	const struct fann_neuron *first_neuron = ann->first_layer->first_neuron;
 
 	/* if no room allocated for the error variabels, allocate it now */
-	if(ann->train_errors == NULL){
-		ann->train_errors = (fann_type *)calloc(ann->total_neurons, sizeof(fann_type));
-		if(ann->train_errors == NULL){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	if(ann->train_errors == NULL)
+	{
+		ann->train_errors = (fann_type *) calloc(ann->total_neurons, sizeof(fann_type));
+		if(ann->train_errors == NULL)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 			return;
 		}
-	} else {
+	}
+	else
+	{
 		/* clear the error variabels */
 		memset(ann->train_errors, 0, (ann->total_neurons) * sizeof(fann_type));
 	}
 	error_begin = ann->train_errors;
-	
+
 #ifdef DEBUGTRAIN
 	printf("\ncalculate errors\n");
 #endif
 	/* calculate the error and place it in the output layer */
 	error_it = error_begin + (last_layer_begin - first_neuron);
 
-	for(; last_layer_begin != last_layer_end; last_layer_begin++){
+	for(; last_layer_begin != last_layer_end; last_layer_begin++)
+	{
 		neuron_value = last_layer_begin->value;
 		neuron_diff = *desired_output - neuron_value;
 
-		switch(last_layer_begin->activation_function)
+		switch (last_layer_begin->activation_function)
 		{
-			case FANN_SIGMOID_SYMMETRIC:
-			case FANN_SIGMOID_SYMMETRIC_STEPWISE:
-			case FANN_ELLIOT_SYMMETRIC:
-			case FANN_GAUSSIAN_SYMMETRIC:
-				neuron_diff /= 2.0;
-			break;				
+		case FANN_SIGMOID_SYMMETRIC:
+		case FANN_SIGMOID_SYMMETRIC_STEPWISE:
+		case FANN_ELLIOT_SYMMETRIC:
+		case FANN_GAUSSIAN_SYMMETRIC:
+			neuron_diff /= 2.0;
+			break;
 		}
 
-		neuron_diff2 = (float)(neuron_diff * neuron_diff);
+		neuron_diff2 = (float) (neuron_diff * neuron_diff);
 		ann->MSE_value += neuron_diff2;
 
-		/*printf("neuron_diff %f = (%f - %f)[/2], neuron_diff2=%f, sum=%f, MSE_value=%f, num_MSE=%d\n", neuron_diff, *desired_output, neuron_value, neuron_diff2, last_layer_begin->sum, ann->MSE_value, ann->num_MSE);*/
-		if(neuron_diff2 >= 0.25){
+		/*printf("neuron_diff %f = (%f - %f)[/2], neuron_diff2=%f, sum=%f, MSE_value=%f, num_MSE=%d\n", neuron_diff, *desired_output, neuron_value, neuron_diff2, last_layer_begin->sum, ann->MSE_value, ann->num_MSE); */
+		if(neuron_diff2 >= 0.25)
+		{
 			ann->num_bit_fail++;
 		}
 
-		if(ann->train_error_function){ /* TODO make switch when more functions */
-			if ( neuron_diff < -.9999999 )
+		if(ann->train_error_function)
+		{						/* TODO make switch when more functions */
+			if(neuron_diff < -.9999999)
 				neuron_diff = -17.0;
-			else if ( neuron_diff > .9999999 )
+			else if(neuron_diff > .9999999)
 				neuron_diff = 17.0;
 			else
-				neuron_diff = (fann_type)log ( (1.0+neuron_diff) / (1.0-neuron_diff) );
+				neuron_diff = (fann_type) log((1.0 + neuron_diff) / (1.0 - neuron_diff));
 		}
-	
+
 		*error_it = fann_activation_derived(last_layer_begin->activation_function,
-			last_layer_begin->activation_steepness, neuron_value, last_layer_begin->sum) * neuron_diff;
-		
+											last_layer_begin->activation_steepness, neuron_value,
+											last_layer_begin->sum) * neuron_diff;
+
 		desired_output++;
 		error_it++;
 	}
@@ -262,7 +278,7 @@ void fann_backpropagate_MSE(struct fann *ann)
 	struct fann_layer *layer_it;
 	struct fann_neuron *neuron_it, *last_neuron;
 	struct fann_neuron **connections;
-	
+
 	fann_type *error_begin = ann->train_errors;
 	fann_type *error_prev_layer;
 	fann_type *weights;
@@ -271,52 +287,63 @@ void fann_backpropagate_MSE(struct fann *ann)
 	struct fann_layer *last_layer = ann->last_layer;
 
 	/* go through all the layers, from last to first.
-	   And propagate the error backwards */
-	for(layer_it = last_layer-1; layer_it > second_layer; --layer_it){
+	 * And propagate the error backwards */
+	for(layer_it = last_layer - 1; layer_it > second_layer; --layer_it)
+	{
 		last_neuron = layer_it->last_neuron;
 
-		/* for each connection in this layer, propagate the error backwards*/
-		if(ann->connection_rate >= 1){
-			if(!ann->shortcut_connections){
-				error_prev_layer = error_begin + ((layer_it-1)->first_neuron - first_neuron);
-			}else{
+		/* for each connection in this layer, propagate the error backwards */
+		if(ann->connection_rate >= 1)
+		{
+			if(!ann->shortcut_connections)
+			{
+				error_prev_layer = error_begin + ((layer_it - 1)->first_neuron - first_neuron);
+			}
+			else
+			{
 				error_prev_layer = error_begin;
 			}
-			
-			for(neuron_it = layer_it->first_neuron;
-				neuron_it != last_neuron; neuron_it++){
-				
+
+			for(neuron_it = layer_it->first_neuron; neuron_it != last_neuron; neuron_it++)
+			{
+
 				tmp_error = error_begin[neuron_it - first_neuron];
 				weights = ann->weights + neuron_it->first_con;
-				for(i = neuron_it->last_con - neuron_it->first_con; i-- ; ){
+				for(i = neuron_it->last_con - neuron_it->first_con; i--;)
+				{
 					/*printf("i = %d\n", i);
-					printf("error_prev_layer[%d] = %f\n", i, error_prev_layer[i]);
-					printf("weights[%d] = %f\n", i, weights[i]);*/
+					 * printf("error_prev_layer[%d] = %f\n", i, error_prev_layer[i]);
+					 * printf("weights[%d] = %f\n", i, weights[i]); */
 					error_prev_layer[i] += tmp_error * weights[i];
 				}
 			}
-		}else{
-			for(neuron_it = layer_it->first_neuron;
-				neuron_it != last_neuron; neuron_it++){
-				
+		}
+		else
+		{
+			for(neuron_it = layer_it->first_neuron; neuron_it != last_neuron; neuron_it++)
+			{
+
 				tmp_error = error_begin[neuron_it - first_neuron];
 				weights = ann->weights + neuron_it->first_con;
 				connections = ann->connections + neuron_it->first_con;
-				for(i = neuron_it->last_con - neuron_it->first_con; i-- ; ){
+				for(i = neuron_it->last_con - neuron_it->first_con; i--;)
+				{
 					error_begin[connections[i] - first_neuron] += tmp_error * weights[i];
 				}
 			}
 		}
 
 		/* then calculate the actual errors in the previous layer */
-		error_prev_layer = error_begin + ((layer_it-1)->first_neuron - first_neuron);
-		last_neuron = (layer_it-1)->last_neuron;
+		error_prev_layer = error_begin + ((layer_it - 1)->first_neuron - first_neuron);
+		last_neuron = (layer_it - 1)->last_neuron;
 
-		for(neuron_it = (layer_it-1)->first_neuron;
-			neuron_it != last_neuron; neuron_it++){
+		for(neuron_it = (layer_it - 1)->first_neuron; neuron_it != last_neuron; neuron_it++)
+		{
 			neuron_value = neuron_it->value;
 			/* *error_prev_layer *= fann_activation(ann, 0, neuron_value); */
-			*error_prev_layer *= fann_activation(ann, neuron_it->activation_function, neuron_it->activation_steepness, neuron_value);
+			*error_prev_layer *=
+				fann_activation(ann, neuron_it->activation_function,
+								neuron_it->activation_steepness, neuron_value);
 		}
 	}
 }
@@ -331,7 +358,7 @@ void fann_update_weights(struct fann *ann)
 	struct fann_layer *layer_it;
 	unsigned int i;
 	unsigned int num_connections;
-	
+
 	/* store some variabels local for fast access */
 	const float learning_rate = ann->learning_rate;
 	struct fann_neuron *first_neuron = ann->first_layer->first_neuron;
@@ -344,33 +371,40 @@ void fann_update_weights(struct fann *ann)
 #endif
 
 	prev_neurons = first_neuron;
-	for(layer_it = (first_layer+1); layer_it != last_layer; layer_it++){
+	for(layer_it = (first_layer + 1); layer_it != last_layer; layer_it++)
+	{
 #ifdef DEBUGTRAIN
 		printf("layer[%d]\n", layer_it - first_layer);
 #endif
 		last_neuron = layer_it->last_neuron;
-		if(ann->connection_rate >= 1){
-			if(!ann->shortcut_connections){
-				prev_neurons = (layer_it-1)->first_neuron;
+		if(ann->connection_rate >= 1)
+		{
+			if(!ann->shortcut_connections)
+			{
+				prev_neurons = (layer_it - 1)->first_neuron;
 			}
-			for(neuron_it = layer_it->first_neuron;
-				neuron_it != last_neuron; neuron_it++){
+			for(neuron_it = layer_it->first_neuron; neuron_it != last_neuron; neuron_it++)
+			{
 				tmp_error = error_begin[neuron_it - first_neuron] * learning_rate;
 				num_connections = neuron_it->last_con - neuron_it->first_con;
 				weights = ann->weights + neuron_it->first_con;
-				for(i = 0; i != num_connections; i++){
+				for(i = 0; i != num_connections; i++)
+				{
 					weights[i] += tmp_error * prev_neurons[i].value;
 				}
 			}
-		}else{
-			for(neuron_it = layer_it->first_neuron;
-				neuron_it != last_neuron; neuron_it++){
+		}
+		else
+		{
+			for(neuron_it = layer_it->first_neuron; neuron_it != last_neuron; neuron_it++)
+			{
 				tmp_error = error_begin[neuron_it - first_neuron] * learning_rate;
 				num_connections = neuron_it->last_con - neuron_it->first_con;
 				weights = ann->weights + neuron_it->first_con;
 				connections = ann->connections + neuron_it->first_con;
-				for(i = 0; i != num_connections; i++){
-					weights[i] += tmp_error * connections[i]->value;	
+				for(i = 0; i != num_connections; i++)
+				{
+					weights[i] += tmp_error * connections[i]->value;
 				}
 			}
 		}
@@ -383,70 +417,83 @@ void fann_update_weights(struct fann *ann)
    will update all slopes.
 
 */
-void fann_update_slopes_batch(struct fann *ann, struct fann_layer *layer_begin, struct fann_layer *layer_end)
+void fann_update_slopes_batch(struct fann *ann, struct fann_layer *layer_begin,
+							  struct fann_layer *layer_end)
 {
 	struct fann_neuron *neuron_it, *last_neuron, *prev_neurons, **connections;
 	fann_type tmp_error, *weights_begin;
 	unsigned int i, num_connections;
-	
+
 	/* store some variabels local for fast access */
 	struct fann_neuron *first_neuron = ann->first_layer->first_neuron;
 	fann_type *error_begin = ann->train_errors;
 	fann_type *slope_begin, *neuron_slope;
 
 	/* if no room allocated for the slope variabels, allocate it now */
-	if(ann->train_slopes == NULL){
-		ann->train_slopes = (fann_type *)calloc(ann->total_connections_allocated, sizeof(fann_type));
-		if(ann->train_slopes == NULL){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	if(ann->train_slopes == NULL)
+	{
+		ann->train_slopes =
+			(fann_type *) calloc(ann->total_connections_allocated, sizeof(fann_type));
+		if(ann->train_slopes == NULL)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 			return;
 		}
 	}
-	
-   	if(layer_begin == NULL){
-		layer_begin = ann->first_layer+1;
+
+	if(layer_begin == NULL)
+	{
+		layer_begin = ann->first_layer + 1;
 	}
 
-	if(layer_end == NULL){
-		layer_end = ann->last_layer-1;
+	if(layer_end == NULL)
+	{
+		layer_end = ann->last_layer - 1;
 	}
 
 	slope_begin = ann->train_slopes;
 	weights_begin = ann->weights;
-	
+
 #ifdef DEBUGTRAIN
 	printf("\nupdate slopes\n");
 #endif
 
 	prev_neurons = first_neuron;
-	
-	for(; layer_begin <= layer_end; layer_begin++){
+
+	for(; layer_begin <= layer_end; layer_begin++)
+	{
 #ifdef DEBUGTRAIN
 		printf("layer[%d]\n", layer_begin - ann->first_layer);
 #endif
 		last_neuron = layer_begin->last_neuron;
-		if(ann->connection_rate >= 1){
-			if(!ann->shortcut_connections){
-				prev_neurons = (layer_begin-1)->first_neuron;
+		if(ann->connection_rate >= 1)
+		{
+			if(!ann->shortcut_connections)
+			{
+				prev_neurons = (layer_begin - 1)->first_neuron;
 			}
-			
-			for(neuron_it = layer_begin->first_neuron;
-				neuron_it != last_neuron; neuron_it++){
+
+			for(neuron_it = layer_begin->first_neuron; neuron_it != last_neuron; neuron_it++)
+			{
 				tmp_error = error_begin[neuron_it - first_neuron];
 				neuron_slope = slope_begin + neuron_it->first_con;
 				num_connections = neuron_it->last_con - neuron_it->first_con;
-				for(i = 0; i != num_connections; i++){
+				for(i = 0; i != num_connections; i++)
+				{
 					neuron_slope[i] += tmp_error * prev_neurons[i].value;
 				}
 			}
-		}else{
-			for(neuron_it = layer_begin->first_neuron;
-				neuron_it != last_neuron; neuron_it++){
+		}
+		else
+		{
+			for(neuron_it = layer_begin->first_neuron; neuron_it != last_neuron; neuron_it++)
+			{
 				tmp_error = error_begin[neuron_it - first_neuron];
 				neuron_slope = slope_begin + neuron_it->first_con;
 				num_connections = neuron_it->last_con - neuron_it->first_con;
 				connections = ann->connections + neuron_it->first_con;
-				for(i = 0; i != num_connections; i++){
+				for(i = 0; i != num_connections; i++)
+				{
 					neuron_slope[i] += tmp_error * connections[i]->value;
 				}
 			}
@@ -462,45 +509,61 @@ void fann_clear_train_arrays(struct fann *ann)
 {
 	unsigned int i;
 	fann_type delta_zero;
-	
+
 	/* if no room allocated for the slope variabels, allocate it now
-	   (calloc clears mem) */
-	if(ann->train_slopes == NULL){
-		ann->train_slopes = (fann_type *)calloc(ann->total_connections_allocated, sizeof(fann_type));
-		if(ann->train_slopes == NULL){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	 * (calloc clears mem) */
+	if(ann->train_slopes == NULL)
+	{
+		ann->train_slopes =
+			(fann_type *) calloc(ann->total_connections_allocated, sizeof(fann_type));
+		if(ann->train_slopes == NULL)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 			return;
 		}
-	} else {
+	}
+	else
+	{
 		memset(ann->train_slopes, 0, (ann->total_connections) * sizeof(fann_type));
 	}
-	
+
 	/* if no room allocated for the variabels, allocate it now */
-	if(ann->prev_steps == NULL){
-		ann->prev_steps = (fann_type *)calloc(ann->total_connections_allocated, sizeof(fann_type));
-		if(ann->prev_steps == NULL){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	if(ann->prev_steps == NULL)
+	{
+		ann->prev_steps = (fann_type *) calloc(ann->total_connections_allocated, sizeof(fann_type));
+		if(ann->prev_steps == NULL)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 			return;
 		}
-	} else {
+	}
+	else
+	{
 		memset(ann->prev_steps, 0, (ann->total_connections) * sizeof(fann_type));
 	}
-	
+
 	/* if no room allocated for the variabels, allocate it now */
-	if(ann->prev_train_slopes == NULL){
-		ann->prev_train_slopes = (fann_type *)malloc(ann->total_connections_allocated * sizeof(fann_type));
-		if(ann->prev_train_slopes == NULL){
-			fann_error((struct fann_error *)ann, FANN_E_CANT_ALLOCATE_MEM);
+	if(ann->prev_train_slopes == NULL)
+	{
+		ann->prev_train_slopes =
+			(fann_type *) malloc(ann->total_connections_allocated * sizeof(fann_type));
+		if(ann->prev_train_slopes == NULL)
+		{
+			fann_error((struct fann_error *) ann, FANN_E_CANT_ALLOCATE_MEM);
 			return;
 		}
 	}
 
-	if(ann->training_algorithm == FANN_TRAIN_RPROP){
+	if(ann->training_algorithm == FANN_TRAIN_RPROP)
+	{
 		delta_zero = ann->rprop_delta_zero;
-		for(i = 0; i < ann->total_connections; i++){
+		for(i = 0; i < ann->total_connections; i++)
+		{
 			ann->prev_train_slopes[i] = delta_zero;
 		}
-	} else {
+	}
+	else
+	{
 		memset(ann->prev_train_slopes, 0, (ann->total_connections) * sizeof(fann_type));
 	}
 }
@@ -508,14 +571,16 @@ void fann_clear_train_arrays(struct fann *ann)
 /* INTERNAL FUNCTION
    Update weights for batch training
  */
-void fann_update_weights_batch(struct fann *ann, unsigned int num_data, unsigned int first_weight, unsigned int past_end)
+void fann_update_weights_batch(struct fann *ann, unsigned int num_data, unsigned int first_weight,
+							   unsigned int past_end)
 {
 	fann_type *train_slopes = ann->train_slopes;
 	fann_type *weights = ann->weights;
-	const float epsilon = ann->learning_rate/num_data;
+	const float epsilon = ann->learning_rate / num_data;
 	unsigned int i = first_weight;
 
-	for(;i != past_end; i++){
+	for(; i != past_end; i++)
+	{
 		weights[i] += train_slopes[i] * epsilon;
 		train_slopes[i] = 0.0;
 	}
@@ -524,7 +589,8 @@ void fann_update_weights_batch(struct fann *ann, unsigned int num_data, unsigned
 /* INTERNAL FUNCTION
    The quickprop training algorithm
  */
-void fann_update_weights_quickprop(struct fann *ann, unsigned int num_data, unsigned int first_weight, unsigned int past_end)
+void fann_update_weights_quickprop(struct fann *ann, unsigned int num_data,
+								   unsigned int first_weight, unsigned int past_end)
 {
 	fann_type *train_slopes = ann->train_slopes;
 	fann_type *weights = ann->weights;
@@ -532,55 +598,71 @@ void fann_update_weights_quickprop(struct fann *ann, unsigned int num_data, unsi
 	fann_type *prev_train_slopes = ann->prev_train_slopes;
 
 	fann_type w, prev_step, slope, prev_slope, next_step;
-	
-	float epsilon = ann->learning_rate/num_data;
-	float decay = ann->quickprop_decay; /*-0.0001;*/
-	float mu = ann->quickprop_mu; /*1.75;*/
-	float shrink_factor = (float)(mu / (1.0 + mu));
+
+	float epsilon = ann->learning_rate / num_data;
+	float decay = ann->quickprop_decay;	/*-0.0001;*/
+	float mu = ann->quickprop_mu;	/*1.75; */
+	float shrink_factor = (float) (mu / (1.0 + mu));
 
 	unsigned int i = first_weight;
 
-	for(;i != past_end; i++){
+	for(; i != past_end; i++)
+	{
 		w = weights[i];
 		prev_step = prev_steps[i];
-		slope = train_slopes[i] +  decay * w;
+		slope = train_slopes[i] + decay * w;
 		prev_slope = prev_train_slopes[i];
 		next_step = 0.0;
-	
+
 		/* The step must always be in direction opposite to the slope. */
-		if(prev_step > 0.001) {
+		if(prev_step > 0.001)
+		{
 			/* If last step was positive...  */
-			if(slope > 0.0) {
-				/*  Add in linear term if current slope is still positive.*/
+			if(slope > 0.0)
+			{
+				/*  Add in linear term if current slope is still positive. */
 				next_step += epsilon * slope;
 			}
-		
+
 			/*If current slope is close to or larger than prev slope...  */
-			if(slope > (shrink_factor * prev_slope)) {
-				next_step += mu * prev_step;      /* Take maximum size negative step. */
-			} else {
-				next_step += prev_step * slope / (prev_slope - slope); /* Else, use quadratic estimate. */
+			if(slope > (shrink_factor * prev_slope))
+			{
+				next_step += mu * prev_step;	/* Take maximum size negative step. */
+			}
+			else
+			{
+				next_step += prev_step * slope / (prev_slope - slope);	/* Else, use quadratic estimate. */
 			}
-		} else if(prev_step < -0.001){
-			/* If last step was negative...  */  
-			if(slope < 0.0){
-				/*  Add in linear term if current slope is still negative.*/
+		}
+		else if(prev_step < -0.001)
+		{
+			/* If last step was negative...  */
+			if(slope < 0.0)
+			{
+				/*  Add in linear term if current slope is still negative. */
 				next_step += epsilon * slope;
 			}
-		
+
 			/* If current slope is close to or more neg than prev slope... */
-			if(slope < (shrink_factor * prev_slope)){
-				next_step += mu * prev_step;      /* Take maximum size negative step. */
-			} else {
-				next_step += prev_step * slope / (prev_slope - slope); /* Else, use quadratic estimate. */
+			if(slope < (shrink_factor * prev_slope))
+			{
+				next_step += mu * prev_step;	/* Take maximum size negative step. */
 			}
-		} else {
+			else
+			{
+				next_step += prev_step * slope / (prev_slope - slope);	/* Else, use quadratic estimate. */
+			}
+		}
+		else
+		{
 			/* Last step was zero, so use only linear term. */
 			next_step += epsilon * slope;
 		}
 
-		if(next_step > 100 || next_step < -100){
-			printf("quickprop[%d] weight=%f, slope=%f, next_step=%f, prev_step=%f\n", i, weights[i], slope, next_step, prev_step);
+		if(next_step > 100 || next_step < -100)
+		{
+			printf("quickprop[%d] weight=%f, slope=%f, next_step=%f, prev_step=%f\n", i, weights[i],
+				   slope, next_step, prev_step);
 			if(next_step > 100)
 				next_step = 100;
 			else
@@ -608,39 +690,48 @@ void fann_update_weights_irpropm(struct fann *ann, unsigned int first_weight, un
 	fann_type prev_step, slope, prev_slope, next_step, same_sign;
 
 	/* These should be set from variables */
-	float increase_factor = ann->rprop_increase_factor;/*1.2;*/
-	float decrease_factor = ann->rprop_decrease_factor;/*0.5;*/
-	float delta_min = ann->rprop_delta_min;/*0.0;*/
-	float delta_max = ann->rprop_delta_max;/*50.0;*/
+	float increase_factor = ann->rprop_increase_factor;	/*1.2; */
+	float decrease_factor = ann->rprop_decrease_factor;	/*0.5; */
+	float delta_min = ann->rprop_delta_min;	/*0.0; */
+	float delta_max = ann->rprop_delta_max;	/*50.0; */
 
 	unsigned int i = first_weight;
 
-	for(;i != past_end; i++){
-		prev_step = fann_max(prev_steps[i], (fann_type)0.001); /* prev_step may not be zero because then the training will stop */
+	for(; i != past_end; i++)
+	{
+		prev_step = fann_max(prev_steps[i], (fann_type) 0.001);	/* prev_step may not be zero because then the training will stop */
 		slope = train_slopes[i];
 		prev_slope = prev_train_slopes[i];
 
 		same_sign = prev_slope * slope;
-	
-		if(same_sign > 0.0) {
+
+		if(same_sign > 0.0)
+		{
 			next_step = fann_min(prev_step * increase_factor, delta_max);
-		} else if(same_sign < 0.0) {
+		}
+		else if(same_sign < 0.0)
+		{
 			next_step = fann_max(prev_step * decrease_factor, delta_min);
 			slope = 0;
-		} else {
+		}
+		else
+		{
 			next_step = 0.0;
 		}
 
-		if(slope < 0){
+		if(slope < 0)
+		{
 			weights[i] -= next_step;
-		}else{
+		}
+		else
+		{
 			weights[i] += next_step;
 		}
 
 		/*if(i == 2){
-		printf("weight=%f, slope=%f, next_step=%f, prev_step=%f\n", weights[i], slope, next_step, prev_step);
-			}*/
-	
+		 * printf("weight=%f, slope=%f, next_step=%f, prev_step=%f\n", weights[i], slope, next_step, prev_step);
+		 * } */
+
 		/* update global data arrays */
 		prev_steps[i] = next_step;
 		prev_train_slopes[i] = slope;
diff --git a/src/include/compat_time.h b/src/include/compat_time.h
index 58b1f24..b8389ac 100644
--- a/src/include/compat_time.h
+++ b/src/include/compat_time.h
@@ -18,8 +18,8 @@ Lesser General Public License for more details.
 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
+*/  
+	
 /*
  * timeval.h    1.0 01/12/19
  *
@@ -27,113 +27,115 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
  * By Wu Yongwei
  *
- */
-
+ */ 
+	
 #ifndef _TIMEVAL_H
 #define _TIMEVAL_H
-
+	
 #ifdef _WIN32
-
+	
 /* Modified to compile as ANSI C without include of windows.h
    If this gives problems with future Windows/MSC versions, then
-   uncomment the USE_WINDOWS_H definition to switch back. */
-/* #define USE_WINDOWS_H */
+   uncomment the USE_WINDOWS_H definition to switch back. */ 
+/* #define USE_WINDOWS_H */ 
 #ifdef USE_WINDOWS_H
-    #define WIN32_LEAN_AND_MEAN
-    #include <windows.h>
-#else
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#else	/* 
 */
 #ifndef _INC_WINDOWS
-    #define VOID void
-    #define WINAPI __stdcall
-    #define OUT
-    #define WINBASEAPI
-
-    typedef long LONG;
-    typedef unsigned long DWORD;
-    typedef __int64 LONGLONG;
-
-    typedef struct _FILETIME {
-        DWORD dwLowDateTime;
-        DWORD dwHighDateTime;
-    } FILETIME, *LPFILETIME;
-
-    typedef union _LARGE_INTEGER {
-        /* Removed unnamed struct,
-           it is not ANSI C compatible*/
-        /* struct {
-            DWORD LowPart;
-            LONG HighPart;
-        }; */
-        struct {
-            DWORD LowPart;
-            LONG HighPart;
-        } u;
-        LONGLONG QuadPart;
-    } LARGE_INTEGER;
-
-    WINBASEAPI VOID WINAPI
-    GetSystemTimeAsFileTime(OUT LPFILETIME lpSystemTimeAsFileTime);
-#endif /* _INC_WINDOWS */
-#endif /* USE_WINDOWS_H */
-
+#define VOID void
+#define WINAPI __stdcall
+#define OUT
+#define WINBASEAPI
+
typedef long LONG;
+
typedef unsigned long DWORD;
+
typedef __int64 LONGLONG;
+

typedef struct _FILETIME
+{
+	
DWORD dwLowDateTime;
+	
DWORD dwHighDateTime;
+
} FILETIME, *LPFILETIME;
+

typedef union _LARGE_INTEGER
+{
+	
+		/* Removed unnamed struct,
+		 * it is not ANSI C compatible */ 
+		/* struct {
+		 * DWORD LowPart;
+		 * LONG HighPart;
+		 * }; */ 
+		struct
+	{
+		
DWORD LowPart;
+		
LONG HighPart;
+	
} u;
+	 
LONGLONG QuadPart;
+ 
} LARGE_INTEGER;
+
+

WINBASEAPI VOID WINAPI 
 GetSystemTimeAsFileTime(OUT LPFILETIME lpSystemTimeAsFileTime);
+
+#endif	/* _INC_WINDOWS */
+#endif	/* USE_WINDOWS_H */
+	
 #include <time.h>
-
+	
 #ifndef __GNUC__
 #define EPOCHFILETIME (116444736000000000i64)
-#else
+#else	/* 
 */
 #define EPOCHFILETIME (116444736000000000LL)
-#endif
-
-struct timeval {
-    long tv_sec;        /* seconds */
-    long tv_usec;  /* microseconds */
-};
-
-struct timezone {
-    int tz_minuteswest; /* minutes W of Greenwich */
-    int tz_dsttime;     /* type of dst correction */
-};
-
-__inline int gettimeofday(struct timeval *tv, struct timezone *tz)
-{
-    FILETIME        ft;
-    LARGE_INTEGER   li;
-    __int64         t;
-    static int      tzflag;
-
-    if (tv)
-    {
-        GetSystemTimeAsFileTime(&ft);
-
-        /* The following two lines have been modified to use the named
-           union member. Unnamed members are not ANSI C compatible. */
-        li.u.LowPart  = ft.dwLowDateTime;
-        li.u.HighPart = ft.dwHighDateTime;
-        t  = li.QuadPart;       /* In 100-nanosecond intervals */
-        t -= EPOCHFILETIME;     /* Offset to the Epoch time */
-        t /= 10;                /* In microseconds */
-        tv->tv_sec  = (long)(t / 1000000);
-        tv->tv_usec = (long)(t % 1000000);
-    }
-
-    if (tz)
-    {
-        if (!tzflag)
-        {
-            _tzset();
-            tzflag++;
-        }
-        tz->tz_minuteswest = _timezone / 60;
-        tz->tz_dsttime = _daylight;
-    }
-
-    return 0;
-}
-
-#else  /* _WIN32 */
-
+#endif	/* 
 */
+	
struct timeval
+{
+	
long tv_sec;				/* seconds */
+	 
 long tv_usec;			/* microseconds */
+ 
};
+

struct timezone
+{
+	
int tz_minuteswest;		/* minutes W of Greenwich */
+	 
 int tz_dsttime;			/* type of dst correction */
+ 
};
+

__inline int gettimeofday(struct timeval *tv, struct timezone *tz) 
+{
+	
FILETIME ft;
+	
LARGE_INTEGER li;
+	
__int64 t;
+	
static int tzflag;
+
+	

if(tv)
+		
+	{
+		
GetSystemTimeAsFileTime(&ft);
+		

+			/* The following two lines have been modified to use the named
+			 * union member. Unnamed members are not ANSI C compatible. */ 
+			li.u.LowPart = ft.dwLowDateTime;
+		
li.u.HighPart = ft.dwHighDateTime;
+		
t = li.QuadPart;		/* In 100-nanosecond intervals */
+		
t -= EPOCHFILETIME;	/* Offset to the Epoch time */
+		
t /= 10;				/* In microseconds */
+		
tv->tv_sec = (long) (t / 1000000);
+		
tv->tv_usec = (long) (t % 1000000);
+	
}
+	

if(tz)
+		
+	{
+		
if(!tzflag)
+			
+		{
+			
_tzset();
+			
tzflag++;
+		
}
+		
tz->tz_minuteswest = _timezone / 60;
+		
tz->tz_dsttime = _daylight;
+	
}
+	

return 0;
+
}
+
+

+#else	/* _WIN32 */
+	
 #include <sys/time.h>
-
-#endif /* _WIN32 */
-
-#endif /* _TIMEVAL_H */
+	
+#endif	/* _WIN32 */
+	
+#endif	/* _TIMEVAL_H */
diff --git a/src/include/doublefann.h b/src/include/doublefann.h
index 3c34f17..ae96ba4 100644
--- a/src/include/doublefann.h
+++ b/src/include/doublefann.h
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #define __doublefann_h__
 
 typedef double fann_type;
+
 #undef DOUBLEFANN
 #define DOUBLEFANN
 #define FANNPRINTF "%.20e"
diff --git a/src/include/fann.h b/src/include/fann.h
index 3f420f3..2d65477 100644
--- a/src/include/fann.h
+++ b/src/include/fann.h
@@ -15,53 +15,56 @@ Lesser General Public License for more details.
 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
+*/  
+	
 /* This file defines the user interface to the fann library.
    It is included from fixedfann.h, floatfann.h and doublefann.h and should
    NOT be included directly. If included directly it will react as if
    floatfann.h was included.
-*/
-
+*/ 
+	
 #ifndef FANN_INCLUDE
-/* just to allow for inclusion of fann.h in normal stuations where only floats are needed */
+/* just to allow for inclusion of fann.h in normal stuations where only floats are needed */ 
 #ifdef FIXEDFANN
 #include "fixedfann.h"
-#else
+#else	/* 
 */
 #include "floatfann.h"
-#endif /* FIXEDFANN  */
-
-#else
-
-/* COMPAT_TIME REPLACEMENT */
+#endif	/* FIXEDFANN  */
+	
+#else	/* 
 */
+	
+/* COMPAT_TIME REPLACEMENT */ 
 #ifndef _WIN32
-    #include <sys/time.h>
-#else  /* _WIN32 */
+#include <sys/time.h>
+#else	/* _WIN32 */
 #if !defined(_MSC_EXTENSIONS) &&
-!defined(_INC_WINDOWS)
-    extern unsigned long __stdcall GetTickCount(void);
-#else /* _MSC_EXTENSIONS */
-    #define WIN32_LEAN_AND_MEAN
-    #include <windows.h>
-#endif /* _MSC_EXTENSIONS */
-#endif /* _WIN32 */
-
+	 !defined(_INC_WINDOWS) 
 extern unsigned long __stdcall GetTickCount(void);
+
+
+#else	/* _MSC_EXTENSIONS */
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+#endif	/* _MSC_EXTENSIONS */
+#endif	/* _WIN32 */
+	
 #include "fann_data.h"
 #include "fann_internal.h"
 #include "fann_activation.h"
-
+	
 #ifndef __fann_h__
 #define __fann_h__
-
+	
 #ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+extern "C"
+{
+	
+#endif	/* __cplusplus */
 	
 #ifndef NULL
 #define NULL 0
-#endif /* NULL */
-
-/* ----- Macros used to define DLL external entrypoints ----- */
+#endif	/* NULL */
+	
+/* ----- Macros used to define DLL external entrypoints ----- */ 
 /*
  DLL Export, import and calling convention for Windows.
  Only defined for Microsoft VC++ FANN_EXTERNAL indicates
@@ -90,8 +93,8 @@ extern "C" {
  so the DLL and the application program both use the same
  calling convention. The callback functions must of this form:
      int FANN_API user_callback(unsigned int epochs, float error)
-*/
-
+*/ 
+	
 /*
  The following sets the default for MSVC++ 2003 or later to use
  the fann dll's. To use a lib or fixedfann.c, floatfann.c or doublefann.c
@@ -100,27 +103,26 @@ extern "C" {
  The default for previous MSVC compilers such as VC++ 6 is not
  to use dll's. To use dll's FANN_USE_DLL has to be defined before
  including the fann headers.
-*/
+*/ 
 #if (_MSC_VER > 1300)
 #ifndef FANN_NO_DLL
 #define FANN_USE_DLL
-#endif /* FANN_USE_LIB */
-#endif /* _MSC_VER */
+#endif	/* FANN_USE_LIB */
+#endif	/* _MSC_VER */
 #if defined(_MSC_VER) && (defined(FANN_USE_DLL) || defined(FANN_DLL_EXPORTS))
 #ifdef FANN_DLL_EXPORTS
 #define FANN_EXTERNAL __declspec(dllexport)
-#else
+#else	/* 
 */
 #define FANN_EXTERNAL __declspec(dllimport)
-#endif /* FANN_DLL_EXPORTS*/
+#endif	/* FANN_DLL_EXPORTS*/
 #define FANN_API __stdcall
-#else
+#else	/* 
 */
 #define FANN_EXTERNAL
 #define FANN_API
-#endif /* _MSC_VER */
-/* ----- End of macros used to define DLL external entrypoints ----- */
-
-
-/* ----- Implemented in fann.c Creation, running and destruction of ANNs ----- */
+#endif	/* _MSC_VER */
+/* ----- End of macros used to define DLL external entrypoints ----- */ 
+	
 
+/* ----- Implemented in fann.c Creation, running and destruction of ANNs ----- */ 
 	
 /* Constructs a backpropagation neural network, from an connection rate,
    a learning rate, the number of layers and the number of neurons in each
@@ -133,60 +135,73 @@ extern "C" {
    There will be a bias neuron in each layer (except the output layer),
    and this bias neuron will be connected to all neurons in the next layer.
    When running the network, the bias nodes always emits 1
-*/
-FANN_EXTERNAL struct fann * FANN_API fann_create(float connection_rate, float learning_rate,
-	/* the number of layers, including the input and output layer */
-	unsigned int num_layers,
-	/* the number of neurons in each of the layers, starting with
-	   the input layer and ending with the output layer */
-	...);
-
+*/ 
+	FANN_EXTERNAL struct fann *FANN_API fann_create(float connection_rate, float learning_rate, 
+													/* the number of layers, including the input and output layer */ 
+													unsigned int num_layers, 
+													/* the number of neurons in each of the layers, starting with
+													 * the input layer and ending with the output layer */ 
+													...);
+	 

 /* Just like fann_create, but with an array of layer sizes
    instead of individual parameters.
-*/
-FANN_EXTERNAL struct fann * FANN_API fann_create_array(float connection_rate, float learning_rate,
-	unsigned int num_layers, unsigned int * layers);
-
+*/ 
+	 
+		FANN_EXTERNAL struct fann *FANN_API fann_create_array(float connection_rate,
+															  float learning_rate,
+															  
unsigned int num_layers,
+															  unsigned int *layers);
+	 

 /* create a fully connected neural network with shortcut connections.
- */
-FANN_EXTERNAL struct fann * FANN_API fann_create_shortcut(float learning_rate,
-	unsigned int num_layers, /* the number of layers, including the input and output layer */
-	...); /* the number of neurons in each of the layers, starting with the input layer and ending with the output layer */
-
+ */ 
+	 
+		FANN_EXTERNAL struct fann *FANN_API fann_create_shortcut(float learning_rate,
+																 
unsigned int num_layers,
+																 /* the number of layers, including the input and output layer */
+																 
+																 ...);	/* the number of neurons in each of the layers, starting with the input layer and ending with the output layer */
+	 

 /* create a neural network with shortcut connections.
- */
-FANN_EXTERNAL struct fann * FANN_API fann_create_shortcut_array(float learning_rate, unsigned int num_layers, unsigned int * layers);	
-	
+ */ 
+	 
+		FANN_EXTERNAL struct fann *FANN_API fann_create_shortcut_array(float learning_rate,
+																	   unsigned int num_layers,
+																	   unsigned int *layers);
+	 

 /* Runs a input through the network, and returns the output.
- */
-FANN_EXTERNAL fann_type* FANN_API fann_run(struct fann *ann, fann_type *input);
-
+ */ 
+	  FANN_EXTERNAL fann_type * FANN_API fann_run(struct fann *ann, fann_type * input);
+	 

 /* Destructs the entire network.
    Be sure to call this function after finished using the network.
- */
-FANN_EXTERNAL void FANN_API fann_destroy(struct fann *ann);
-	
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_destroy(struct fann *ann);
+	 

 /* Randomize weights (from the beginning the weights are random between -0.1 and 0.1)
- */
-FANN_EXTERNAL void FANN_API fann_randomize_weights(struct fann *ann, fann_type min_weight, fann_type max_weight);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_randomize_weights(struct fann *ann, fann_type min_weight,
+														   fann_type max_weight);
+	 

 /* Initialize the weights using Widrow + Nguyen's algorithm.
-*/
-FANN_EXTERNAL void FANN_API fann_init_weights(struct fann *ann, struct fann_train_data * train_data);
-
-/* print out which connections there are in the ann */
-FANN_EXTERNAL void FANN_API fann_print_connections(struct fann *ann);	
-	
-/* ----- Implemented in fann_io.c Saving and loading of ANNs ----- */
-
+*/ 
+	 
+		FANN_EXTERNAL void FANN_API fann_init_weights(struct fann *ann,
+													  struct fann_train_data *train_data);
+	 

+/* print out which connections there are in the ann */ 
+	  FANN_EXTERNAL void FANN_API fann_print_connections(struct fann *ann);
+	 

+/* ----- Implemented in fann_io.c Saving and loading of ANNs ----- */ 
+	 
 /* Constructs a backpropagation neural network from a configuration file.
- */
-FANN_EXTERNAL struct fann * FANN_API fann_create_from_file(const char *configuration_file);
-
+ */ 
+	  FANN_EXTERNAL struct fann *FANN_API fann_create_from_file(const char *configuration_file);
+	 

 /* Save the entire network to a configuration file.
- */
-FANN_EXTERNAL void FANN_API fann_save(struct fann *ann, const char *configuration_file);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_save(struct fann *ann, const char *configuration_file);
+	 

 /* Saves the entire network to a configuration file.
    But it is saved in fixed point format no matter which
    format it is currently in.
@@ -211,45 +226,50 @@ FANN_EXTERNAL void FANN_API fann_save(struct fann *ann, const char *configuratio
    The fixed point use of this network is only intended for use on machines that
    have no floating point processor, like an iPAQ. On normal computers the floating
    point version is actually faster.
-*/
-FANN_EXTERNAL int FANN_API fann_save_to_fixed(struct fann *ann, const char *configuration_file);
-
-
-/* ----- Implemented in fann_train.c Training and testing of ANNs ----- */
-
+*/ 
+	 
+		FANN_EXTERNAL int FANN_API fann_save_to_fixed(struct fann *ann,
+													  const char *configuration_file);
+	 


+/* ----- Implemented in fann_train.c Training and testing of ANNs ----- */ 
+	 
 #ifndef FIXEDFANN
 /* Train one iteration with a set of inputs, and a set of desired outputs.
- */
-FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type *input, fann_type *desired_output);
-
-#endif /* NOT FIXEDFANN */
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type * input,
+											   fann_type * desired_output);
+	 

+#endif	/* NOT FIXEDFANN */
+	 
 /* Test with a set of inputs, and a set of desired outputs.
    This operation updates the mean square error, but does not
    change the network in any way.
-*/
-FANN_EXTERNAL fann_type * FANN_API fann_test(struct fann *ann, fann_type *input, fann_type *desired_output);
-
+*/ 
+	 
+		FANN_EXTERNAL fann_type * FANN_API fann_test(struct fann *ann, fann_type * input,
+													 fann_type * desired_output);
+	 

 /* Reads the mean square error from the network.
    (obsolete will be removed at some point, use fann_get_MSE)
- */
-FANN_EXTERNAL float FANN_API fann_get_error(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL float FANN_API fann_get_error(struct fann *ann);
+	 

 /* Reads the mean square error from the network.
- */
-FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann);
+	 

 /* Resets the mean square error from the network.
    (obsolete will be removed at some point, use fann_reset_MSE)
- */
-FANN_EXTERNAL void FANN_API fann_reset_error(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_reset_error(struct fann *ann);
+	 

 /* Resets the mean square error from the network.
- */
-FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann);
-
-/* ----- Implemented in fann_train_data.c Data for training of ANNs ----- */
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann);
+	 

+/* ----- Implemented in fann_train_data.c Data for training of ANNs ----- */ 
+	 
 /* Reads a file that stores training data, in the format:
    num_train_data num_input num_output\n
    inputdata seperated by space\n
@@ -261,267 +281,336 @@ FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann);
    
    inputdata seperated by space\n
    outputdata seperated by space\n
-*/
-FANN_EXTERNAL struct fann_train_data* FANN_API fann_read_train_from_file(char *filename);
-
+*/ 
+	  FANN_EXTERNAL struct fann_train_data *FANN_API fann_read_train_from_file(char *filename);
+	 

 /* Destructs the training data
    Be sure to call this function after finished using the training data.
- */
-FANN_EXTERNAL void FANN_API fann_destroy_train(struct fann_train_data* train_data);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_destroy_train(struct fann_train_data *train_data);
+	 

 #ifndef FIXEDFANN
-
+	 
 /* Train one epoch with a set of training data.
- */
-FANN_EXTERNAL float FANN_API fann_train_epoch(struct fann *ann, struct fann_train_data *data);
-
+ */ 
+	  FANN_EXTERNAL float FANN_API fann_train_epoch(struct fann *ann, struct fann_train_data *data);
+	 

 /* Test a set of training data and calculate the MSE
- */
-FANN_EXTERNAL float FANN_API fann_test_data(struct fann *ann, struct fann_train_data *data);
-	
+ */ 
+	  FANN_EXTERNAL float FANN_API fann_test_data(struct fann *ann, struct fann_train_data *data);
+	 

 /* Trains on an entire dataset, for a maximum of max_epochs
    epochs or until mean square error is lower than desired_error.
    Reports about the progress is given every
    epochs_between_reports epochs.
    If epochs_between_reports is zero, no reports are given.
-*/
-FANN_EXTERNAL void FANN_API fann_train_on_data(struct fann *ann, struct fann_train_data *data, unsigned int max_epochs, unsigned int epochs_between_reports, float desired_error);
-
+*/ 
+	 
+		FANN_EXTERNAL void FANN_API fann_train_on_data(struct fann *ann,
+													   struct fann_train_data *data,
+													   unsigned int max_epochs,
+													   unsigned int epochs_between_reports,
+													   float desired_error);
+	 

 /* Same as fann_train_on_data, but a callback function is given,
    which can be used to print out reports. (effective for gui programming).
    If the callback returns -1, then the training is terminated, otherwise
    it continues until the normal stop criteria.
-*/
-FANN_EXTERNAL void FANN_API fann_train_on_data_callback(struct fann *ann, struct fann_train_data *data, unsigned int max_epochs, unsigned int epochs_between_reports, float desired_error, int (FANN_API *callback)(unsigned int epochs, float error));
-
+*/ 
+	 
+		FANN_EXTERNAL void FANN_API fann_train_on_data_callback(struct fann *ann,
+																struct fann_train_data *data,
+																unsigned int max_epochs,
+																unsigned int epochs_between_reports,
+																float desired_error,
+																int (FANN_API *
+																	 callback) (unsigned int epochs,
+																				float error));
+	 

 /* Does the same as train_on_data, but reads the data directly from a file.
- */
-FANN_EXTERNAL void FANN_API fann_train_on_file(struct fann *ann, char *filename, unsigned int max_epochs, unsigned int epochs_between_reports, float desired_error);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_train_on_file(struct fann *ann, char *filename,
+													   unsigned int max_epochs,
+													   unsigned int epochs_between_reports,
+													   float desired_error);
+	 

 /* Does the same as train_on_data_callback, but
    reads the data directly from a file.
- */
-FANN_EXTERNAL void FANN_API fann_train_on_file_callback(struct fann *ann, char *filename, unsigned int max_epochs, unsigned int epochs_between_reports, float desired_error, int (FANN_API *callback)(unsigned int epochs, float error));
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_train_on_file_callback(struct fann *ann, char *filename,
+																unsigned int max_epochs,
+																unsigned int epochs_between_reports,
+																float desired_error,
+																int (FANN_API *
+																	 callback) (unsigned int epochs,
+																				float error));
+	 

 /* shuffles training data, randomizing the order
- */
-FANN_EXTERNAL void FANN_API fann_shuffle_train_data(struct fann_train_data *train_data);
-
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_shuffle_train_data(struct fann_train_data *train_data);
+	 


 /* Scales the inputs in the training data to the specified range
- */
-FANN_EXTERNAL void FANN_API fann_scale_input_train_data(struct fann_train_data *train_data, fann_type new_min, fann_type new_max);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_scale_input_train_data(struct fann_train_data *train_data,
+																fann_type new_min,
+																fann_type new_max);
+	 

 /* Scales the inputs in the training data to the specified range
- */
-FANN_EXTERNAL void FANN_API fann_scale_output_train_data(struct fann_train_data *train_data, fann_type new_min, fann_type new_max);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_scale_output_train_data(struct fann_train_data *train_data,
+																 fann_type new_min,
+																 fann_type new_max);
+	 

 /* Scales the inputs in the training data to the specified range
- */
-FANN_EXTERNAL void FANN_API fann_scale_train_data(struct fann_train_data *train_data, fann_type new_min, fann_type new_max);
-	
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_scale_train_data(struct fann_train_data *train_data,
+														  fann_type new_min, fann_type new_max);
+	 

 /* merges training data into a single struct.
- */
-FANN_EXTERNAL struct fann_train_data * FANN_API fann_merge_train_data(struct fann_train_data *data1, struct fann_train_data *data2);
-
+ */ 
+	 
+		FANN_EXTERNAL struct fann_train_data *FANN_API fann_merge_train_data(struct fann_train_data
+																			 *data1,
+																			 struct fann_train_data
+																			 *data2);
+	 

 /* return a copy of a fann_train_data struct
- */
-FANN_EXTERNAL struct fann_train_data * FANN_API fann_duplicate_train_data(struct fann_train_data *data);
-	
-#endif /* NOT FIXEDFANN */
-
+ */ 
+	 
+		FANN_EXTERNAL struct fann_train_data *FANN_API fann_duplicate_train_data(struct
+																				 fann_train_data
+																				 *data);
+	 

+#endif	/* NOT FIXEDFANN */
+	 
 /* Save the training structure to a file.
- */
-FANN_EXTERNAL void FANN_API fann_save_train(struct fann_train_data* data, char *filename);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_save_train(struct fann_train_data *data, char *filename);
+	 

 /* Saves the training structure to a fixed point data file.
  *  (Very usefull for testing the quality of a fixed point network).
- */
-FANN_EXTERNAL void FANN_API fann_save_train_to_fixed(struct fann_train_data* data, char *filename, unsigned int decimal_point);
-
-/* ----- Implemented in fann_cascade.c Used to train the ANN with cascade correlation ----- */
-void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data *data, float desired_error, int (*callback)(unsigned int epochs, float error), unsigned int max_out_epochs, unsigned int max_cand_epochs, unsigned int max_neurons, unsigned int neurons_between_reports);
-
-	
-/* ----- Implemented in fann_options.c Get and set options for the ANNs ----- */
-
-/* Prints all of the parameters and options of the ANN */
-FANN_EXTERNAL void FANN_API fann_print_parameters(struct fann *ann);
-	
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_save_train_to_fixed(struct fann_train_data *data,
+															 char *filename,
+															 unsigned int decimal_point);
+	 

+/* ----- Implemented in fann_cascade.c Used to train the ANN with cascade correlation ----- */ 
+	void fann_cascadetrain_on_data_callback(struct fann *ann, struct fann_train_data *data,
+											float desired_error,
+											int (*callback) (unsigned int epochs, float error),
+											unsigned int max_out_epochs,
+											unsigned int max_cand_epochs, unsigned int max_neurons,
+											unsigned int neurons_between_reports);
+	 


+/* ----- Implemented in fann_options.c Get and set options for the ANNs ----- */ 
+	 
+/* Prints all of the parameters and options of the ANN */ 
+	  FANN_EXTERNAL void FANN_API fann_print_parameters(struct fann *ann);
+	 

 /* Get the training algorithm.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_training_algorithm(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_training_algorithm(struct fann *ann);
+	 

 /* Set the training algorithm.
- */
-FANN_EXTERNAL void FANN_API fann_set_training_algorithm(struct fann *ann, unsigned int training_algorithm);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_training_algorithm(struct fann *ann,
+																unsigned int training_algorithm);
+	 

 /* Get the learning rate.
- */
-FANN_EXTERNAL float FANN_API fann_get_learning_rate(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL float FANN_API fann_get_learning_rate(struct fann *ann);
+	 

 /* Set the learning rate.
- */
-FANN_EXTERNAL void FANN_API fann_set_learning_rate(struct fann *ann, float learning_rate);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_set_learning_rate(struct fann *ann, float learning_rate);
+	 

 /* Get the activation function used in the hidden layers.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_activation_function_hidden(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_activation_function_hidden(struct fann *ann);
+	 

 /* Set the activation function for the hidden layers.
- */
-FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann, unsigned int activation_function);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann,
+																		unsigned int
+																		activation_function);
+	 

 /* Get the activation function used in the output layer.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_activation_function_output(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_activation_function_output(struct fann *ann);
+	 

 /* Set the activation function for the output layer.
- */
-FANN_EXTERNAL void FANN_API fann_set_activation_function_output(struct fann *ann, unsigned int activation_function);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_activation_function_output(struct fann *ann,
+																		unsigned int
+																		activation_function);
+	 

 /* Get the steepness parameter for the sigmoid function used in the hidden layers.
- */
-FANN_EXTERNAL fann_type FANN_API fann_get_activation_steepness_hidden(struct fann *ann);
-	
+ */ 
+	  FANN_EXTERNAL fann_type FANN_API fann_get_activation_steepness_hidden(struct fann *ann);
+	 

 /* Set the steepness of the sigmoid function used in the hidden layers.
    Only usefull if sigmoid function is used in the hidden layers (default 0.5).
- */
-FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *ann, fann_type steepness);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *ann,
+																		 fann_type steepness);
+	 

 /* Get the steepness parameter for the sigmoid function used in the output layer.
- */
-FANN_EXTERNAL fann_type FANN_API fann_get_activation_steepness_output(struct fann *ann);
-	
+ */ 
+	  FANN_EXTERNAL fann_type FANN_API fann_get_activation_steepness_output(struct fann *ann);
+	 

 /* Set the steepness of the sigmoid function used in the output layer.
    Only usefull if sigmoid function is used in the output layer (default 0.5).
- */
-FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *ann, fann_type steepness);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *ann,
+																		 fann_type steepness);
+	 

 /* OBSOLETE use fann_get_activation_steepness_hidden
    Get the steepness parameter for the sigmoid function used in the hidden layers.
- */
-FANN_EXTERNAL fann_type FANN_API fann_get_activation_hidden_steepness(struct fann *ann);
-	
+ */ 
+	  FANN_EXTERNAL fann_type FANN_API fann_get_activation_hidden_steepness(struct fann *ann);
+	 

 /* OBSOLETE use fann_set_activation_steepness_hidden
    Set the steepness of the sigmoid function used in the hidden layers.
    Only usefull if sigmoid function is used in the hidden layers (default 0.5).
- */
-FANN_EXTERNAL void FANN_API fann_set_activation_hidden_steepness(struct fann *ann, fann_type steepness);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_activation_hidden_steepness(struct fann *ann,
+																		 fann_type steepness);
+	 

 /* OBSOLETE use fann_get_activation_steepness_output
   Get the steepness parameter for the sigmoid function used in the output layer.
- */
-FANN_EXTERNAL fann_type FANN_API fann_get_activation_output_steepness(struct fann *ann);
-	
+ */ 
+	  FANN_EXTERNAL fann_type FANN_API fann_get_activation_output_steepness(struct fann *ann);
+	 

 /* OBSOLETE use fann_set_activation_steepness_output
   Set the steepness of the sigmoid function used in the output layer.
    Only usefull if sigmoid function is used in the output layer (default 0.5).
- */
-FANN_EXTERNAL void FANN_API fann_set_activation_output_steepness(struct fann *ann, fann_type steepness);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_activation_output_steepness(struct fann *ann,
+																		 fann_type steepness);
+	 

 /* Get the error function used during training. (default FANN_ERRORFUNC_TANH)
- */
-FANN_EXTERNAL void FANN_API fann_set_train_error_function(struct fann *ann, unsigned int train_error_function);
-
+ */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_train_error_function(struct fann *ann,
+																  unsigned int
+																  train_error_function);
+	 

 /* Get the error function used during training.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_train_error_function(struct fann *ann);
-
-/* Decay is used to make the weights do not go so high (default -0.0001). */
-FANN_EXTERNAL float FANN_API fann_get_quickprop_decay(struct fann *ann);
-	
-/* Decay is used to make the weights do not go so high (default -0.0001). */
-FANN_EXTERNAL void FANN_API fann_set_quickprop_decay(struct fann *ann, float quickprop_decay);
-	
-/* Mu is a factor used to increase and decrease the stepsize (default 1.75). */
-FANN_EXTERNAL float FANN_API fann_get_quickprop_mu(struct fann *ann);
-
-/* Mu is a factor used to increase and decrease the stepsize (default 1.75). */
-FANN_EXTERNAL void FANN_API fann_set_quickprop_mu(struct fann *ann, float quickprop_mu);
-
-/* Tells how much the stepsize should increase during learning (default 1.2). */
-FANN_EXTERNAL float FANN_API fann_get_rprop_increase_factor(struct fann *ann);
-
-/* Tells how much the stepsize should increase during learning (default 1.2). */
-FANN_EXTERNAL void FANN_API fann_set_rprop_increase_factor(struct fann *ann, float rprop_increase_factor);
-
-/* Tells how much the stepsize should decrease during learning (default 0.5). */
-FANN_EXTERNAL float FANN_API fann_get_rprop_decrease_factor(struct fann *ann);
-
-/* Tells how much the stepsize should decrease during learning (default 0.5). */
-FANN_EXTERNAL void FANN_API fann_set_rprop_decrease_factor(struct fann *ann, float rprop_decrease_factor);
-
-/* The minimum stepsize (default 0.0). */
-FANN_EXTERNAL float FANN_API fann_get_rprop_delta_min(struct fann *ann);
-
-/* The minimum stepsize (default 0.0). */
-FANN_EXTERNAL void FANN_API fann_set_rprop_delta_min(struct fann *ann, float rprop_delta_min);
-
-/* The maximum stepsize (default 50.0). */
-FANN_EXTERNAL float FANN_API fann_get_rprop_delta_max(struct fann *ann);
-
-/* The maximum stepsize (default 50.0). */
-FANN_EXTERNAL void FANN_API fann_set_rprop_delta_max(struct fann *ann, float rprop_delta_max);	
-	
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_train_error_function(struct fann *ann);
+	 

+/* Decay is used to make the weights do not go so high (default -0.0001). */ 
+	  FANN_EXTERNAL float FANN_API fann_get_quickprop_decay(struct fann *ann);
+	 

+/* Decay is used to make the weights do not go so high (default -0.0001). */ 
+	  FANN_EXTERNAL void FANN_API fann_set_quickprop_decay(struct fann *ann, float quickprop_decay);
+	 

+/* Mu is a factor used to increase and decrease the stepsize (default 1.75). */ 
+	  FANN_EXTERNAL float FANN_API fann_get_quickprop_mu(struct fann *ann);
+	 

+/* Mu is a factor used to increase and decrease the stepsize (default 1.75). */ 
+	  FANN_EXTERNAL void FANN_API fann_set_quickprop_mu(struct fann *ann, float quickprop_mu);
+	 

+/* Tells how much the stepsize should increase during learning (default 1.2). */ 
+	  FANN_EXTERNAL float FANN_API fann_get_rprop_increase_factor(struct fann *ann);
+	 

+/* Tells how much the stepsize should increase during learning (default 1.2). */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_rprop_increase_factor(struct fann *ann,
+																   float rprop_increase_factor);
+	 

+/* Tells how much the stepsize should decrease during learning (default 0.5). */ 
+	  FANN_EXTERNAL float FANN_API fann_get_rprop_decrease_factor(struct fann *ann);
+	 

+/* Tells how much the stepsize should decrease during learning (default 0.5). */ 
+	 
+		FANN_EXTERNAL void FANN_API fann_set_rprop_decrease_factor(struct fann *ann,
+																   float rprop_decrease_factor);
+	 

+/* The minimum stepsize (default 0.0). */ 
+	  FANN_EXTERNAL float FANN_API fann_get_rprop_delta_min(struct fann *ann);
+	 

+/* The minimum stepsize (default 0.0). */ 
+	  FANN_EXTERNAL void FANN_API fann_set_rprop_delta_min(struct fann *ann, float rprop_delta_min);
+	 

+/* The maximum stepsize (default 50.0). */ 
+	  FANN_EXTERNAL float FANN_API fann_get_rprop_delta_max(struct fann *ann);
+	 

+/* The maximum stepsize (default 50.0). */ 
+	  FANN_EXTERNAL void FANN_API fann_set_rprop_delta_max(struct fann *ann, float rprop_delta_max);
+	 

 /* Get the number of input neurons.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_num_input(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_num_input(struct fann *ann);
+	 

 /* Get the number of output neurons.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_num_output(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_num_output(struct fann *ann);
+	 

 /* Get the total number of neurons in the entire network.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_total_neurons(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_total_neurons(struct fann *ann);
+	 

 /* Get the total number of connections in the entire network.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_total_connections(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_total_connections(struct fann *ann);
+	 

 #ifdef FIXEDFANN
-
+	 
 /* returns the position of the decimal point.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_decimal_point(struct fann *ann);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_decimal_point(struct fann *ann);
+	 

 /* returns the multiplier that fix point data is multiplied with.
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_multiplier(struct fann *ann);
-#endif /* FIXEDFANN */
-	
-/* ----- Implemented in fann_error.c Access error information about the ANN ----- */
-	
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_multiplier(struct fann *ann);
+	 
+#endif	/* FIXEDFANN */
+	 
+/* ----- Implemented in fann_error.c Access error information about the ANN ----- */ 
+	 
 /* change where errors are logged to
- */
-FANN_EXTERNAL void FANN_API fann_set_error_log(struct fann_error *errdat, FILE *log_file);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_set_error_log(struct fann_error *errdat, FILE * log_file);
+	 

 /* returns the last error number
- */
-FANN_EXTERNAL unsigned int FANN_API fann_get_errno(struct fann_error *errdat);
-
+ */ 
+	  FANN_EXTERNAL unsigned int FANN_API fann_get_errno(struct fann_error *errdat);
+	 

 /* resets the last error number
- */
-FANN_EXTERNAL void FANN_API fann_reset_errno(struct fann_error *errdat);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_reset_errno(struct fann_error *errdat);
+	 

 /* resets the last error string
- */
-FANN_EXTERNAL void FANN_API fann_reset_errstr(struct fann_error *errdat);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_reset_errstr(struct fann_error *errdat);
+	 

 /* returns the last errstr.
  * This function calls fann_reset_errno and fann_reset_errstr
- */
-FANN_EXTERNAL char * FANN_API fann_get_errstr(struct fann_error *errdat);
-
+ */ 
+	  FANN_EXTERNAL char *FANN_API fann_get_errstr(struct fann_error *errdat);
+	 

 /* prints the last error to stderr
- */
-FANN_EXTERNAL void FANN_API fann_print_error(struct fann_error *errdat);
-
+ */ 
+	  FANN_EXTERNAL void FANN_API fann_print_error(struct fann_error *errdat);
+	 

 #ifdef __cplusplus
-}
-#endif /* __cplusplus */
-
-#endif /* __fann_h__ */
-
-#endif /* NOT FANN_INCLUDE */
+} 
+#endif	/* __cplusplus */
+ 
+#endif	/* __fann_h__ */
+ 
+#endif	/* NOT FANN_INCLUDE */
diff --git a/src/include/fann_activation.h b/src/include/fann_activation.h
index 3491277..057a1f0 100644
--- a/src/include/fann_activation.h
+++ b/src/include/fann_activation.h
@@ -30,91 +30,92 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    d is the derivation.
  */
 
-enum {
+enum
+{
 	/* Linear activation function.
-	   span: -inf < y < inf
-	   y = x*s, d = 1*s
-	   Can NOT be used in fixed point.
-	*/
+	 * span: -inf < y < inf
+	 * y = x*s, d = 1*s
+	 * Can NOT be used in fixed point.
+	 */
 	FANN_LINEAR = 0,
 
 	/* Threshold activation function.
-	   x < 0 -> y = 0, x >= 0 -> y = 1
-	   Can NOT be used during training.
-	*/
+	 * x < 0 -> y = 0, x >= 0 -> y = 1
+	 * Can NOT be used during training.
+	 */
 	FANN_THRESHOLD,
 
 	/* Threshold activation function.
-	   x < 0 -> y = 0, x >= 0 -> y = 1
-	   Can NOT be used during training.
-	*/
+	 * x < 0 -> y = 0, x >= 0 -> y = 1
+	 * Can NOT be used during training.
+	 */
 	FANN_THRESHOLD_SYMMETRIC,
 
 	/* Sigmoid activation function.
-	   One of the most used activation functions.
-	   span: 0 < y < 1
-	   y = 1/(1 + exp(-2*s*x))
-	   d = 2*s*y*(1 - y)
-	*/
+	 * One of the most used activation functions.
+	 * span: 0 < y < 1
+	 * y = 1/(1 + exp(-2*s*x))
+	 * d = 2*s*y*(1 - y)
+	 */
 	FANN_SIGMOID,
 
 	/* Stepwise linear approximation to sigmoid.
-	   Faster than sigmoid but a bit less precise.
-	*/
-	FANN_SIGMOID_STEPWISE, /* (default) */
+	 * Faster than sigmoid but a bit less precise.
+	 */
+	FANN_SIGMOID_STEPWISE,		/* (default) */
 
 
 	/* Symmetric sigmoid activation function, aka. tanh.
-	   One of the most used activation functions.
-	   span: -1 < y < 1
-	   y = tanh(s*x) = 2/(1 + exp(-2*s*x)) - 1
-	   d = s*(1-(y*y))
-	*/
+	 * One of the most used activation functions.
+	 * span: -1 < y < 1
+	 * y = tanh(s*x) = 2/(1 + exp(-2*s*x)) - 1
+	 * d = s*(1-(y*y))
+	 */
 	FANN_SIGMOID_SYMMETRIC,
-	
+
 	/* Stepwise linear approximation to symmetric sigmoid.
-	   Faster than symmetric sigmoid but a bit less precise.
-	*/
+	 * Faster than symmetric sigmoid but a bit less precise.
+	 */
 	FANN_SIGMOID_SYMMETRIC_STEPWISE,
 
 	/* Gaussian activation function.
-	   0 when x = -inf, 1 when x = 0 and 0 when x = inf
-	   span: 0 < y < 1
-	   y = exp(-x*s*x*s)
-	   d = -2*x*s*y*s
-	*/
+	 * 0 when x = -inf, 1 when x = 0 and 0 when x = inf
+	 * span: 0 < y < 1
+	 * y = exp(-x*s*x*s)
+	 * d = -2*x*s*y*s
+	 */
 	FANN_GAUSSIAN,
 
 	/* Symmetric gaussian activation function.
-	   -1 when x = -inf, 1 when x = 0 and 0 when x = inf
-	   span: -1 < y < 1
-	   y = exp(-x*s*x*s)*2-1
-	   d = -2*x*s*(y+1)*s
-	*/
+	 * -1 when x = -inf, 1 when x = 0 and 0 when x = inf
+	 * span: -1 < y < 1
+	 * y = exp(-x*s*x*s)*2-1
+	 * d = -2*x*s*(y+1)*s
+	 */
 	FANN_GAUSSIAN_SYMMETRIC,
 
 	/* Stepwise linear approximation to gaussian.
-	   Faster than gaussian but a bit less precise.
-	   NOT implemented yet.
-	*/
+	 * Faster than gaussian but a bit less precise.
+	 * NOT implemented yet.
+	 */
 	FANN_GAUSSIAN_STEPWISE,
 
 	/* Fast (sigmoid like) activation function defined by David Elliott
-	   span: 0 < y < 1
-	   y = ((x*s) / 2) / (1 + |x*s|) + 0.5
-	   d = s*1/(2*(1+|x*s|)*(1+|x*s|))
-	*/
+	 * span: 0 < y < 1
+	 * y = ((x*s) / 2) / (1 + |x*s|) + 0.5
+	 * d = s*1/(2*(1+|x*s|)*(1+|x*s|))
+	 */
 	FANN_ELLIOT,
 
 	/* Fast (symmetric sigmoid like) activation function defined by David Elliott
-	   span: -1 < y < 1   
-	   y = (x*s) / (1 + |x*s|)
-	   d = s*1/((1+|x*s|)*(1+|x*s|))
-	*/
+	 * span: -1 < y < 1   
+	 * y = (x*s) / (1 + |x*s|)
+	 * d = s*1/((1+|x*s|)*(1+|x*s|))
+	 */
 	FANN_ELLIOT_SYMMETRIC
 };
 
-static char const * const FANN_ACTIVATION_NAMES[] = {
+static char const *const FANN_ACTIVATION_NAMES[] = {
 	"FANN_LINEAR",
 	"FANN_THRESHOLD",
 	"FANN_THRESHOLD_SYMMETRIC",
diff --git a/src/include/fann_data.h b/src/include/fann_data.h
index 5572732..505d8a1 100644
--- a/src/include/fann_data.h
+++ b/src/include/fann_data.h
@@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 struct fann_neuron
 {
 	/* Index to the first and last connection
-	   (actually the last is a past end index)
+	 * (actually the last is a past end index)
 	 */
 	unsigned int first_con;
 	unsigned int last_con;
@@ -42,7 +42,7 @@ struct fann_neuron
 	/* Used to choose which activation function to use */
 	unsigned int activation_function;
 #ifdef __GNUC__
-}__attribute__((packed));
+} __attribute__ ((packed));
 #else
 };
 #endif
@@ -74,7 +74,7 @@ struct fann
 	FILE *error_log;
 
 	/* A string representation of the last error. */
-	char * errstr;
+	char *errstr;
 
 	/* the learning rate of the network */
 	float learning_rate;
@@ -117,7 +117,7 @@ struct fann
 
 	/* The connection array */
 	struct fann_neuron **connections;
-	
+
 	/* Used to contain the errors used during training
 	 * Is allocated during first training session,
 	 * which means that if we do not train, it is never allocated.
@@ -130,20 +130,20 @@ struct fann
 
 #ifdef FIXEDFANN
 	/* the decimal_point, used for shifting the fix point
-	   in fixed point integer operatons.
-	*/
+	 * in fixed point integer operatons.
+	 */
 	unsigned int decimal_point;
-	
+
 	/* the multiplier, used for multiplying the fix point
-	   in fixed point integer operatons.
-	   Only used in special cases, since the decimal_point is much faster.
-	*/
+	 * in fixed point integer operatons.
+	 * Only used in special cases, since the decimal_point is much faster.
+	 */
 	unsigned int multiplier;
 
 	/* When in choosen (or in fixed point), the sigmoid function is
-	   calculated as a stepwise linear function. In the
-	   activation_results array, the result is saved, and in the
-	   two values arrays, the values that gives the results are saved.
+	 * calculated as a stepwise linear function. In the
+	 * activation_results array, the result is saved, and in the
+	 * two values arrays, the values that gives the results are saved.
 	 */
 	fann_type sigmoid_results[6];
 	fann_type sigmoid_values[6];
@@ -165,7 +165,7 @@ struct fann
 	unsigned int num_MSE;
 
 	/* the total error value.
-	   the real mean square error is MSE_value/num_MSE
+	 * the real mean square error is MSE_value/num_MSE
 	 */
 	float MSE_value;
 
@@ -176,23 +176,23 @@ struct fann
 	/* The error function used during training. (default FANN_ERRORFUNC_TANH)
 	 */
 	unsigned int train_error_function;
-	
+
 	/* Variables for use with Cascade Correlation */
 
 	/* The error must change by at least this
-	   fraction of its old value to count as a
-	   significant change.
-	*/
+	 * fraction of its old value to count as a
+	 * significant change.
+	 */
 	float cascade_change_fraction;
 
 	/* No change in this number of epochs will cause
-	   stagnation.
-	*/
+	 * stagnation.
+	 */
 	unsigned int cascade_stagnation_epochs;
 
 	/* The number of candidate neurons used during cascade correlation
-	   training.
-	*/
+	 * training.
+	 */
 	unsigned int cascade_num_candidates;
 
 	/* The current best candidate, which will be installed.
@@ -206,21 +206,21 @@ struct fann
 	/* Scale of copied candidate output weights
 	 */
 	fann_type cascade_weight_multiplier;
-	
+
 	/* An array consisting of the score of the individual candidates,
-	   which is used to decide which candidate is the best
-	*/
+	 * which is used to decide which candidate is the best
+	 */
 	fann_type *cascade_candidate_scores;
 
 	/* The number of allocated neurons during cascade correlation algorithms.
-	   This number might be higher than the actual number of neurons to avoid
-	   allocating new space too often.
+	 * This number might be higher than the actual number of neurons to avoid
+	 * allocating new space too often.
 	 */
 	unsigned int total_neurons_allocated;
 
 	/* The number of allocated connections during cascade correlation algorithms.
-	   This number might be higher than the actual number of neurons to avoid
-	   allocating new space too often.
+	 * This number might be higher than the actual number of neurons to avoid
+	 * allocating new space too often.
 	 */
 	unsigned int total_connections_allocated;
 
@@ -245,7 +245,7 @@ struct fann
 
 	/* The maximum stepsize */
 	float rprop_delta_max;
-	
+
 	/* The initial stepsize */
 	float rprop_delta_zero;
 
@@ -256,12 +256,12 @@ struct fann
 	fann_type *train_slopes;
 
 	/* The previous step taken by the quickprop/rprop procedures.
-	   Not allocated if not used.
+	 * Not allocated if not used.
 	 */
 	fann_type *prev_steps;
 
 	/* The slope values used by the quickprop/rprop procedures.
-	   Not allocated if not used.
+	 * Not allocated if not used.
 	 */
 	fann_type *prev_train_slopes;
 };
@@ -285,10 +285,11 @@ struct fann_error
 {
 	unsigned int errno_f;
 	FILE *error_log;
-	char * errstr;
+	char *errstr;
 };
 
-enum {
+enum
+{
 	/* Standard backpropagation incremental or online training */
 	FANN_TRAIN_INCREMENTAL = 0,
 	/* Standard backpropagation batch training */
@@ -299,22 +300,23 @@ enum {
 	FANN_TRAIN_QUICKPROP
 };
 
-static char const * const FANN_TRAIN_NAMES[] = {
+static char const *const FANN_TRAIN_NAMES[] = {
 	"FANN_TRAIN_INCREMENTAL",
 	"FANN_TRAIN_BATCH",
 	"FANN_TRAIN_RPROP",
 	"FANN_TRAIN_QUICKPROP"
 };
 
-enum {
+enum
+{
 	/* Standard linear error function */
 	FANN_ERRORFUNC_LINEAR = 0,
 	/* Tanh error function, usually better but can require
-	   a lower learning rate */
+	 * a lower learning rate */
 	FANN_ERRORFUNC_TANH
 };
 
-static char const * const FANN_ERRORFUNC_NAMES[] = {
+static char const *const FANN_ERRORFUNC_NAMES[] = {
 	"FANN_ERRORFUNC_LINEAR",
 	"FANN_ERRORFUNC_TANH"
 };
diff --git a/src/include/fann_errno.h b/src/include/fann_errno.h
index 99a87b4..c43c537 100644
--- a/src/include/fann_errno.h
+++ b/src/include/fann_errno.h
@@ -21,61 +21,63 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #define __fann_errno_h__
 
 #ifdef __cplusplus
-extern "C" {
-#endif /* __cplusplus */
+extern "C"
+{
+#endif							/* __cplusplus */
 
 /* Maximum length (in bytes) of an error message */
 #define FANN_ERRSTR_MAX 128
 
-enum {
-	/* No error */
-	FANN_E_NO_ERROR = 0,
+	enum
+	{
+		/* No error */
+		FANN_E_NO_ERROR = 0,
 
-	/* Unable to open configuration file for reading */
-	FANN_E_CANT_OPEN_CONFIG_R,
+		/* Unable to open configuration file for reading */
+		FANN_E_CANT_OPEN_CONFIG_R,
 
-	/* Unable to open configuration file for writing */
-	FANN_E_CANT_OPEN_CONFIG_W,
+		/* Unable to open configuration file for writing */
+		FANN_E_CANT_OPEN_CONFIG_W,
 
-	/* Wrong version of configuration file */
-	FANN_E_WRONG_CONFIG_VERSION,
+		/* Wrong version of configuration file */
+		FANN_E_WRONG_CONFIG_VERSION,
 
-	/* Error reading info from configuration file */
-	FANN_E_CANT_READ_CONFIG,
+		/* Error reading info from configuration file */
+		FANN_E_CANT_READ_CONFIG,
 
-	/* Error reading neuron info from configuration file */
-	FANN_E_CANT_READ_NEURON,
+		/* Error reading neuron info from configuration file */
+		FANN_E_CANT_READ_NEURON,
 
-	/* Error reading connections from configuration file */
-	FANN_E_CANT_READ_CONNECTIONS,
+		/* Error reading connections from configuration file */
+		FANN_E_CANT_READ_CONNECTIONS,
 
-	/* Number of connections not equal to the number expected. */
-	FANN_E_WRONG_NUM_CONNECTIONS,
+		/* Number of connections not equal to the number expected. */
+		FANN_E_WRONG_NUM_CONNECTIONS,
 
-	/* Unable to open train data file for writing */
-	FANN_E_CANT_OPEN_TD_W,
+		/* Unable to open train data file for writing */
+		FANN_E_CANT_OPEN_TD_W,
 
-	/* Unable to open train data file for reading. */
-	FANN_E_CANT_OPEN_TD_R,
+		/* Unable to open train data file for reading. */
+		FANN_E_CANT_OPEN_TD_R,
 
-	/* Error reading training data from file. */
-	FANN_E_CANT_READ_TD,
+		/* Error reading training data from file. */
+		FANN_E_CANT_READ_TD,
 
-	/* Unable to allocate memory. */
-	FANN_E_CANT_ALLOCATE_MEM,
+		/* Unable to allocate memory. */
+		FANN_E_CANT_ALLOCATE_MEM,
 
-	/* Unable to train with the selected activation function */
-	FANN_E_CANT_TRAIN_ACTIVATION,
+		/* Unable to train with the selected activation function */
+		FANN_E_CANT_TRAIN_ACTIVATION,
 
-	/* Unable to use the selected activation function */
-	FANN_E_CANT_USE_ACTIVATION,
+		/* Unable to use the selected activation function */
+		FANN_E_CANT_USE_ACTIVATION,
 
-	/* Irreconcilable differences between two fann_train_data structures */
-	FANN_E_TRAIN_DATA_MISMATCH
-};
+		/* Irreconcilable differences between two fann_train_data structures */
+		FANN_E_TRAIN_DATA_MISMATCH
+	};
 
 #ifdef __cplusplus
 }
-#endif /* __cplusplus */
+#endif							/* __cplusplus */
 
-#endif /* __fann_errno_h__ */
+#endif							/* __fann_errno_h__ */
diff --git a/src/include/fann_internal.h b/src/include/fann_internal.h
index 8836741..e78de78 100644
--- a/src/include/fann_internal.h
+++ b/src/include/fann_internal.h
@@ -36,15 +36,19 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #define FANN_CONF_VERSION FANN_FLO_VERSION
 #endif
 
-struct fann * fann_allocate_structure(float learning_rate, unsigned int num_layers);
+struct fann *fann_allocate_structure(float learning_rate, unsigned int num_layers);
 void fann_allocate_neurons(struct fann *ann);
 
 void fann_allocate_connections(struct fann *ann);
 
-int fann_save_internal(struct fann *ann, const char *configuration_file, unsigned int save_as_fixed);
-int fann_save_internal_fd(struct fann *ann, FILE *conf, const char *configuration_file, unsigned int save_as_fixed);
-void fann_save_train_internal(struct fann_train_data* data, char *filename, unsigned int save_as_fixed, unsigned int decimal_point);
-void fann_save_train_internal_fd(struct fann_train_data* data, FILE *file, char *filename, unsigned int save_as_fixed, unsigned int decimal_point);
+int fann_save_internal(struct fann *ann, const char *configuration_file,
+					   unsigned int save_as_fixed);
+int fann_save_internal_fd(struct fann *ann, FILE * conf, const char *configuration_file,
+						  unsigned int save_as_fixed);
+void fann_save_train_internal(struct fann_train_data *data, char *filename,
+							  unsigned int save_as_fixed, unsigned int decimal_point);
+void fann_save_train_internal_fd(struct fann_train_data *data, FILE * file, char *filename,
+								 unsigned int save_as_fixed, unsigned int decimal_point);
 
 void fann_seed_rand();
 
@@ -53,27 +57,30 @@ void fann_update_stepwise(struct fann *ann);
 void fann_error(struct fann_error *errdat, const unsigned int errno_f, ...);
 void fann_init_error_data(struct fann_error *errdat);
 
-struct fann * fann_create_from_fd(FILE *conf, const char *configuration_file);
-struct fann_train_data* fann_read_train_from_fd(FILE *file, char *filename);
+struct fann *fann_create_from_fd(FILE * conf, const char *configuration_file);
+struct fann_train_data *fann_read_train_from_fd(FILE * file, char *filename);
 
-void fann_compute_MSE(struct fann *ann, fann_type *desired_output);
+void fann_compute_MSE(struct fann *ann, fann_type * desired_output);
 void fann_update_output_weights(struct fann *ann);
 void fann_backpropagate_MSE(struct fann *ann);
 void fann_update_weights(struct fann *ann);
-void fann_update_slopes_batch(struct fann *ann, struct fann_layer *layer_begin, struct fann_layer *layer_end);
-void fann_update_weights_quickprop(struct fann *ann, unsigned int num_data, unsigned int first_weight, unsigned int past_end);
-void fann_update_weights_batch(struct fann *ann, unsigned int num_data, unsigned int first_weight, unsigned int past_end);
-void fann_update_weights_irpropm(struct fann *ann, unsigned int first_weight, unsigned int past_end);
+void fann_update_slopes_batch(struct fann *ann, struct fann_layer *layer_begin,
+							  struct fann_layer *layer_end);
+void fann_update_weights_quickprop(struct fann *ann, unsigned int num_data,
+								   unsigned int first_weight, unsigned int past_end);
+void fann_update_weights_batch(struct fann *ann, unsigned int num_data, unsigned int first_weight,
+							   unsigned int past_end);
+void fann_update_weights_irpropm(struct fann *ann, unsigned int first_weight,
+								 unsigned int past_end);
 
 void fann_clear_train_arrays(struct fann *ann);
 
-fann_type fann_activation_old(struct fann *ann, unsigned int is_output_layer,
-	fann_type value);
-fann_type fann_activation_new(struct fann *ann, unsigned int activation_function, fann_type steepness,
-	fann_type value);
+fann_type fann_activation_old(struct fann *ann, unsigned int is_output_layer, fann_type value);
+fann_type fann_activation_new(struct fann *ann, unsigned int activation_function,
+							  fann_type steepness, fann_type value);
 
 fann_type fann_activation_derived(unsigned int activation_function,
-	fann_type steepness, fann_type value, fann_type sum);
+								  fann_type steepness, fann_type value, fann_type sum);
 
 /* called fann_max, in order to not interferre with predefined versions of max */
 #define fann_max(x, y) (((x) > (y)) ? (x) : (y))
diff --git a/src/include/fixedfann.h b/src/include/fixedfann.h
index 88467ca..26df4fc 100644
--- a/src/include/fixedfann.h
+++ b/src/include/fixedfann.h
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #define __fixedfann_h__
 
 typedef int fann_type;
+
 #undef FIXEDFANN
 #define FIXEDFANN
 #define FANNPRINTF "%d"
diff --git a/src/include/floatfann.h b/src/include/floatfann.h
index f995272..9fc8fde 100644
--- a/src/include/floatfann.h
+++ b/src/include/floatfann.h
@@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #define __floatfann_h__
 
 typedef float fann_type;
+
 #undef FLOATFANN
 #define FLOATFANN
 #define FANNPRINTF "%.20e"

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libfann.git



More information about the debian-science-commits mailing list