////////////////////////////////////////////////////////////////////////////////
// 
// CommandlineOptions.hh 
//
//    produced: 04 Oct 1999 jr
//
////////////////////////////////////////////////////////////////////////////////
#ifndef COMMANDLINEOPTIONS_HH
#define COMMANDLINEOPTIONS_HH

#include <cstring>
#include <fstream>
#include <thread>
#include <filesystem>

#include "Global.hh"
#include "Message.hh"

namespace topcom {

  class CommandlineOptions {
  private:
    static bool           _verbose;
    static bool           _debug;
    static bool           _iterative_dfs;
    static bool           _parallel_enumeration;
    static bool           _workbuffercontrol;
    static bool           _parallel_symmetries;
    static bool           _use_random_order;
    static bool           _use_volume_order;
    static bool           _use_volumes;
    static bool           _use_gkz;
    static bool           _use_critelm_tables;
    static bool           _use_switch_tables;
    static bool           _use_classified_symmetries;
    static bool           _use_naive_symmetries;
    static bool           _preprocess_points;
    static bool           _simpidx_symmetries;
    static bool           _full_extension_check;
    static bool           _no_extension_check;
    static bool           _extension_check_first;
    static bool           _memopt;
    static bool           _check_triang;
    static bool           _check_symmetries;
    static bool           _neighborcount;
    static bool           _input_chiro;
    static bool           _fine_only;
    static bool           _reduce_points;
    static bool           _dont_add_points;
    static bool           _dont_change_card;
    static bool           _output_triangs;
    static bool           _output_flips;
    static bool           _output_flipconnectivity;
    static bool           _output_flipregularity;
    static bool           _output_asy;
    static bool           _output_stats;
    static bool           _compute_all;
    static bool           _preprocess_chiro;
    static bool           _observe_seed;
    static bool           _observe_required_symmetries;
    static bool           _check_regular;
    static bool           _check_regular_early;
    static bool           _check_full;
    static bool           _check_unimodular;
    static bool           _check_flag;
    static bool           _check_nonregular;
    static bool           _check_nonsubregular;
    static bool           _check_nonsupregular;
    static bool           _check_nonregular_comp;
    static bool           _check_possibly_nonregular_comp;
    static bool           _skip_heuristics;
    static bool           _check_findregular;
    static bool           _check_randomfindregular;
    static bool           _require_point;
    static bool           _ignore_symmetries;
    static bool           _skip_orbitcount;
    static bool           _symmetries_are_affine;
    static bool           _symmetries_are_isometric;
    static bool           _output_heights;
    static bool           _output_gkzvecs;
    static bool           _use_qsopt_ex;
    static bool           _use_soplex;
    static bool           _dump_status;
    static bool           _read_status;
    static parameter_type _required_point;
    static size_type      _report_frequency;
    static size_type      _findregular_frequency;
    static size_type      _chirocache;
    static size_type      _localcache;
    static size_type      _no_of_simplices;
    static size_type      _max_no_of_simplices;
    static size_type      _dump_frequency;
    static size_type      _min_nodebudget;
    static size_type      _max_nodebudget;
    static int            _scale_nodebudget;
    static int            _no_of_threads;
    static int            _min_workbuffersize;
    static int            _max_workbuffersize;
    static int            _dump_rotations;
    static int            _no_of_symtables;
    static const char*    _input_file;
    static const char*    _dump_file;
    static const char*    _read_file;
    static const char*    _asy_file;
    static const char*    _stats_file;
    static const char*    _client;

    // derived variables:
    static bool           _admissibles_restricted;
    static bool           _lp_solver_needed;
    static bool           _regularity_checks_needed;
    static bool           _full_inctable_needed;
    static bool           _simpidx_table_needed;
    static bool           _orbit_traversal_needed;
    static bool           _points_simpidx_syms_needed;
    static bool           _multithreading_needed;
    static int            _user_no_of_threads;
  public:
    CommandlineOptions() {}
    CommandlineOptions(const CommandlineOptions&) {}
  public:

    // initialization:
    static void init(const int argc, const char** argv);

    // accessors for switches and parameters:
    inline static bool           verbose()                        { return _verbose; }
    inline static bool           debug()                          { return _debug; }
    inline static bool           iterative_dfs()                  { return _iterative_dfs; }
    inline static bool           parallel_enumeration()           { return _parallel_enumeration; }
    inline static bool           workbuffercontrol()              { return _workbuffercontrol; }
    inline static bool           parallel_symmetries()            { return _parallel_symmetries; }
    inline static bool           use_random_order()               { return _use_random_order; }
    inline static bool           use_volume_order()               { return _use_volume_order; }
    inline static bool           use_volumes()                    { return _use_volumes; }
    inline static bool           use_gkz()                        { return _use_gkz; }
    inline static bool           use_critelm_tables()             { return _use_critelm_tables; }
    inline static bool           use_switch_tables()              { return _use_switch_tables; }
    inline static bool           use_classified_symmetries()      { return _use_classified_symmetries; }
    inline static bool           use_naive_symmetries()           { return _use_naive_symmetries; }
    inline static bool           preprocess_points()              { return _preprocess_points; }
    inline static bool           simpidx_symmetries()             { return _simpidx_symmetries; }
    inline static bool           full_extension_check()           { return _full_extension_check; }
    inline static bool           no_extension_check()             { return _no_extension_check; }
    inline static bool           extension_check_first()          { return _extension_check_first; }
    inline static bool           memopt()                         { return _memopt; }
    inline static bool           check_triang()                   { return _check_triang; }
    inline static bool           check_symmetries()               { return _check_symmetries; }
    inline static bool           neighborcount()                  { return _neighborcount; }
    inline static bool           input_chiro()                    { return _input_chiro; }
    inline static bool           fine_only()                      { return _fine_only; }
    inline static bool           reduce_points()                  { return _reduce_points; }
    inline static bool           dont_add_points()                { return _dont_add_points; }
    inline static bool           dont_change_card()               { return _dont_change_card; }
    inline static bool           compute_all()                    { return _compute_all; }
    inline static bool           preprocess_chiro()               { return _preprocess_chiro; }
    inline static bool           output_triangs()                 { return _output_triangs; }
    inline static bool           output_flips()                   { return _output_flips; }
    inline static bool           output_flipconnectivity()        { return _output_flipconnectivity; }
    inline static bool           output_flipregularity()          { return _output_flipregularity; }
    inline static bool           output_asy()                     { return _output_asy; }
    inline static bool           output_stats()                   { return _output_stats; }
    inline static bool           observe_seed()                   { return _observe_seed; }
    inline static bool           observe_required_symmetries()    { return _observe_required_symmetries; }
    inline static bool           check_regular()                  { return _check_regular; }
    inline static bool           check_regular_early()            { return _check_regular_early; }
    inline static bool           check_full()                     { return _check_full; }
    inline static bool           check_unimodular()               { return _check_unimodular; }
    inline static bool           check_flag()                     { return _check_flag; }
    inline static bool           check_nonregular()               { return _check_nonregular; }
    inline static bool           check_nonsubregular()            { return _check_nonsubregular; }
    inline static bool           check_nonsupregular()            { return _check_nonsupregular; }
    inline static bool           check_nonregular_comp()          { return _check_nonregular_comp; }
    inline static bool           check_possibly_nonregular_comp() { return _check_possibly_nonregular_comp; }
    inline static bool           skip_heuristics()                { return _skip_heuristics; }
    inline static bool           check_findregular()              { return _check_findregular; }
    inline static bool           check_randomfindregular()        { return _check_randomfindregular; }
    inline static bool           require_point()                  { return _require_point; }
    inline static bool           skip_orbitcount()                { return _skip_orbitcount; }
    inline static bool           ignore_symmetries()              { return _ignore_symmetries; }
    inline static bool           symmetries_are_affine()          { return _symmetries_are_affine; }
    inline static bool           symmetries_are_isometric()       { return _symmetries_are_isometric; }
    inline static bool           output_heights()                 { return _output_heights; }
    inline static bool           output_gkzvecs()                 { return _output_gkzvecs; }
    inline static bool           use_qsopt_ex()                   { return _use_qsopt_ex; }
    inline static bool           use_soplex()                     { return _use_soplex; }
    inline static bool           dump_status()                    { return _dump_status; }
    inline static bool           read_status()                    { return _read_status; }
    inline static parameter_type required_point()                 { return _required_point; }
    inline static size_type      report_frequency()               { return _report_frequency; }
    inline static size_type      findregular_frequency()          { return _findregular_frequency; }
    inline static size_type      chirocache()                     { return _chirocache; }
    inline static size_type      localcache()                     { return _localcache; }
    inline static size_type      no_of_simplices()                { return _no_of_simplices; }
    inline static size_type      max_no_of_simplices()            { return _max_no_of_simplices; }
    inline static size_type      dump_frequency()                 { return _dump_frequency; }
    inline static size_type      min_nodebudget()                 { return _min_nodebudget; }
    inline static size_type      max_nodebudget()                 { return _max_nodebudget; }
    inline static int            scale_nodebudget()               { return _scale_nodebudget; }
    inline static int            no_of_threads()                  { return _no_of_threads; }
    inline static int            min_workbuffersize()             { return _min_workbuffersize; }
    inline static int            max_workbuffersize()             { return _max_workbuffersize; }
    inline static int            dump_rotations()                 { return _dump_rotations; }
    inline static int            no_of_symtables()                { return _no_of_symtables; }

    inline static const char*    input_file()                     { return _input_file; }
    inline static const char*    dump_file()                      { return _dump_file; }
    inline static const char*    read_file()                      { return _read_file; }
    inline static const char*    asy_file()                       { return _asy_file; }
    inline static const char*    stats_file()                     { return _stats_file; }

    // auxiliary queries:
    inline static bool           admissibles_restricted()         { return _admissibles_restricted; }
    inline static bool           lp_solver_needed()               { return _lp_solver_needed; }
    inline static bool           regularity_checks_needed()       { return _regularity_checks_needed; }
    inline static bool           full_inctable_needed()           { return _full_inctable_needed; }
    inline static bool           simpidx_table_needed()           { return _simpidx_table_needed; }
    inline static bool           orbit_traversal_needed()         { return _orbit_traversal_needed; }
    inline static bool           points_simpidx_syms_needed()     { return _points_simpidx_syms_needed; }
    inline static bool           multithreading_needed()          { return _multithreading_needed; }
    inline static int            user_no_of_threads()             { return _user_no_of_threads; }

    // which TOPCOM client is runnning?
    inline static const char*    client()                         { return _client; }

  };

}; // namespace topcom

#endif

// eof CommandlineOptions.hh
