Skip to content

Commit

Permalink
fann.c calls a cascade function even if FIXEDFANN is defined. Added i…
Browse files Browse the repository at this point in the history
…fndef FIXEDFANN to excluded cascade related code from compilation.
  • Loading branch information
joelself committed Nov 5, 2015
1 parent 0472d17 commit 46a04e2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/fann.c
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ FANN_EXTERNAL struct fann* FANN_API fann_copy(struct fann* orig)
copy->train_stop_function = orig->train_stop_function;
copy->training_algorithm = orig->training_algorithm;
copy->callback = orig->callback;
copy->user_data = orig->user_data;
#ifndef FIXEDFANN
copy->cascade_output_change_fraction = orig->cascade_output_change_fraction;
copy->cascade_output_stagnation_epochs = orig->cascade_output_stagnation_epochs;
copy->cascade_candidate_change_fraction = orig->cascade_candidate_change_fraction;
Expand All @@ -913,7 +915,6 @@ FANN_EXTERNAL struct fann* FANN_API fann_copy(struct fann* orig)
copy->cascade_weight_multiplier = orig->cascade_weight_multiplier;
copy->cascade_max_out_epochs = orig->cascade_max_out_epochs;
copy->cascade_max_cand_epochs = orig->cascade_max_cand_epochs;
copy->user_data = orig->user_data;

/* copy cascade activation functions */
copy->cascade_activation_functions_count = orig->cascade_activation_functions_count;
Expand Down Expand Up @@ -958,6 +959,7 @@ FANN_EXTERNAL struct fann* FANN_API fann_copy(struct fann* orig)
}
memcpy(copy->cascade_candidate_scores,orig->cascade_candidate_scores,fann_get_cascade_num_candidates(copy) * sizeof(fann_type));
}
#endif /* FIXEDFANN */

copy->quickprop_decay = orig->quickprop_decay;
copy->quickprop_mu = orig->quickprop_mu;
Expand Down
2 changes: 1 addition & 1 deletion src/include/fann_cascade.h
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,6 @@ FANN_EXTERNAL unsigned int FANN_API fann_get_cascade_num_candidate_groups(struct
FANN_EXTERNAL void FANN_API fann_set_cascade_num_candidate_groups(struct fann *ann,
unsigned int cascade_num_candidate_groups);

#endif // FIXEDFANN
#endif /* FIXEDFANN */

#endif
2 changes: 1 addition & 1 deletion src/include/fann_training_data_cpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ namespace FANN {
fann_type get_max_output() {
return fann_get_max_train_output(train_data);
}
#endif // FIXEDFANN
#endif /* FIXEDFANN */

/* Method: scale_input_train_data
Expand Down

0 comments on commit 46a04e2

Please sign in to comment.