2020// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2121//
2222
23- #include < cstdlib>
2423#include < getopt.h>
2524#include < iostream>
2625#include < fstream>
@@ -34,7 +33,7 @@ using namespace Gambit::Nash;
3433
3534template <class T >
3635void PrintCliques (const List<List<MixedStrategyProfile<T>>> &p_cliques,
37- std::shared_ptr<StrategyProfileRenderer <T>> p_renderer)
36+ std::shared_ptr<MixedProfileRenderer <T>> p_renderer)
3837{
3938 for (size_t cl = 1 ; cl <= p_cliques.size (); cl++) {
4039 for (size_t i = 1 ; i <= p_cliques[cl].size (); i++) {
@@ -75,7 +74,7 @@ int main(int argc, char *argv[])
7574 int numDecimals = 6 ;
7675
7776 int long_opt_index = 0 ;
78- struct option long_options[] = {
77+ option long_options[] = {
7978 {" help" , 0 , nullptr , ' h' }, {" version" , 0 , nullptr , ' v' }, {nullptr , 0 , nullptr , 0 }};
8079 while ((c = getopt_long (argc, argv, " d:vhqcS" , long_options, &long_opt_index)) != -1 ) {
8180 switch (c) {
@@ -99,7 +98,7 @@ int main(int argc, char *argv[])
9998 break ;
10099 case ' ?' :
101100 if (isprint (optopt)) {
102- std::cerr << argv[0 ] << " : Unknown option `-" << (( char ) optopt) << " '.\n " ;
101+ std::cerr << argv[0 ] << " : Unknown option `-" << static_cast < char >( optopt) << " '.\n " ;
103102 }
104103 else {
105104 std::cerr << argv[0 ] << " : Unknown option character `\\ x" << optopt << " `.\n " ;
@@ -130,8 +129,7 @@ int main(int argc, char *argv[])
130129 try {
131130 const Game game = ReadGame (*input_stream);
132131 if (useFloat) {
133- std::shared_ptr<StrategyProfileRenderer<double >> renderer =
134- std::make_shared<MixedStrategyCSVRenderer<double >>(std::cout, numDecimals);
132+ auto renderer = MakeMixedStrategyProfileRenderer<double >(std::cout, numDecimals, false );
135133 auto solution = EnumMixedStrategySolveDetailed<double >(
136134 game, [&](const MixedStrategyProfile<double > &p, const std::string &label) {
137135 renderer->Render (p, label);
@@ -141,8 +139,7 @@ int main(int argc, char *argv[])
141139 }
142140 }
143141 else {
144- std::shared_ptr<StrategyProfileRenderer<Rational>> renderer (
145- new MixedStrategyCSVRenderer<Rational>(std::cout));
142+ auto renderer = MakeMixedStrategyProfileRenderer<Rational>(std::cout, numDecimals, false );
146143 auto solution = EnumMixedStrategySolveDetailed<Rational>(
147144 game, [&](const MixedStrategyProfile<Rational> &p, const std::string &label) {
148145 renderer->Render (p, label);
0 commit comments