inference/dimmwitted/src/dimmwitted.cc
// the command-line entry point
the command-line entry point
the command - line entry point
int dw(int argc, const char *const argv[]) {
  const std::map<std::string, int (*)(const CmdParser &)> MODES = {
      {"gibbs", gibbs},  
      {"text2bin", text2bin},  
      {"bin2text", bin2text},  
  };
  CmdParser cmd_parser(argc, argv, MODES);
  if (cmd_parser.num_errors() > 0) return cmd_parser.num_errors();
  const auto &mode = MODES.find(cmd_parser.app_name);
  return (mode != MODES.end()) ? mode->second(cmd_parser) : 1;
}
int dw ( int argc , const char * const argv [ ] ) { const std :: map < std :: string , int ( * ) ( const CmdParser & ) > MODES = { { " " , gibbs } , { " " , text2bin } , { " " , bin2text } , } ; CmdParser cmd_parser ( argc , argv , MODES ) ; if ( cmd_parser . num_errors ( ) > 0 ) return cmd_parser . num_errors ( ) ; const auto & mode = MODES . find ( cmd_parser . app_name ) ; return ( mode != MODES . end ( ) ) ? mode -> second ( cmd_parser ) : 1 ; }
the command-line entry point
the command - line entry point
// available modes // to do the learning and inference with Gibbs sampling // to generate binary factor graphs from TSV // to dump TSV of binary factor graphs // parse command-line arguments // dispatch to the correct function