This file contains a "platonic" example of FASTlib code for a stand-alone executable. More...
Go to the source code of this file.
Functions | |
int | main (int argc, char *argv[]) |
Variables | |
const fx_module_doc | allnn_main_doc |
const fx_entry_doc | allnn_main_entries [] |
const fx_submodule_doc | allnn_main_submodules [] |
This file contains a "platonic" example of FASTlib code for a stand-alone executable.
It makes use of an accompanying library implimenting a rudimentary dual-tree all-nearest-neighbors algorithm, but more importantly, it demonstrates useful functions for common tasks as well as proper coding style.
Note however that the degree of documentation in this file well exceeds expectations. You should always provide Doxygen-parsed comments (those starting with slash-star-star) for classes, their members, and functions, but snippets of code only deserve documentation if it is not immediately clear what they do. Here, we assume you are a total beginner with FASTlib and a novice with C++, so many additional explanations have been provided. We will denote explanatory comments not needed in normal coding with slash-slash and the appropriate degree of code documentation with slash-star and slash-star-star.
Definition in file allnn_main.cc.
const fx_module_doc allnn_main_doc |
{ allnn_main_entries, allnn_main_submodules, "This is an example program written to demonstrate FASTlib components.\n" "It performs the all-nearest-neighbors dual-tree computation.\n" }
Definition at line 87 of file allnn_main.cc.
const fx_entry_doc allnn_main_entries[] |
{ {"r", FX_REQUIRED, FX_STR, NULL, " A file containing reference data.\n"}, {"q", FX_PARAM, FX_STR, NULL, " A file containing query data (defaults to r).\n"}, {"do_naive", FX_PARAM, FX_BOOL, NULL, " Whether to perform naive computation as well.\n"}, {"output_filename", FX_PARAM, FX_STR, NULL, " A file to receive the results of computation.\n"}, FX_ENTRY_DOC_DONE }
Definition at line 67 of file allnn_main.cc.
const fx_submodule_doc allnn_main_submodules[] |
{ {"allnn", &allnn_doc, " Responsible for dual-tree computation.\n"}, {"naive", &allnn_naive_doc, " Stores results for naive computation.\n"}, FX_SUBMODULE_DOC_DONE }
Definition at line 79 of file allnn_main.cc.