Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) TestBinaryNewickVector

 

TestBinaryNewickVector is a tool to test the BinaryNewickVector class.

 

 

 

 

 

TestBinaryNewickVector downloads

 

 

 

 

 

 

Older TestBinaryNewickVector downloads

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./ToolTestBinaryNewickVector/ToolTestBinaryNewickVectorDesktop.pro

 

include(../../DesktopApplication.pri)

include(../../Libraries/Boost.pri)
include(../../Libraries/BigInteger.pri)

include(../../Classes/CppAbout/CppAbout.pri)
include(../../Classes/CppFileIo/CppFileIo.pri)
include(../../Classes/CppHelp/CppHelp.pri)
include(../../Classes/CppMenuDialog/CppMenuDialog.pri)
include(../../Classes/CppRichelBilderbeekProgram/CppRichelBilderbeekProgram.pri)
include(../../Classes/CppTrace/CppTrace.pri)

include(../../Classes/CppQtAboutDialog/CppQtAboutDialog.pri)
include(../../Classes/CppQtHideAndShowDialog/CppQtHideAndShowDialog.pri)

#Specific
include(../../Classes/CppBinaryNewickVector/CppBinaryNewickVector.pri)
include(../../Classes/CppFuzzy_equal_to/CppFuzzy_equal_to.pri)
include(../../Classes/CppNewick/CppNewick.pri)
include(../../Classes/CppSortedBinaryNewickVector/CppSortedBinaryNewickVector.pri)

#Specific
include(../../Tools/ToolTestBinaryNewickVector/ToolTestBinaryNewickVectorDesktop.pri)

SOURCES += qtmain.cpp

 

 

 

 

 

./ToolTestBinaryNewickVector/ToolTestBinaryNewickVectorConsole.pri

 

INCLUDEPATH += \
    ../../Tools/ToolTestBinaryNewickVector

OTHER_FILES += \
    ../../Tools/ToolTestBinaryNewickVector/Licence.txt

HEADERS += \
    ../../Tools/ToolTestBinaryNewickVector/testbinarynewickvectormenudialog.h

SOURCES += \
    ../../Tools/ToolTestBinaryNewickVector/testbinarynewickvectormenudialog.cpp

 

 

 

 

 

./ToolTestBinaryNewickVector/ToolTestBinaryNewickVectorDesktop.pri

 

include(../../Tools/ToolTestBinaryNewickVector/ToolTestBinaryNewickVectorConsole.pri)

FORMS += \
    ../../Tools/ToolTestBinaryNewickVector/qttestbinarynewickvectormaindialog.ui \
    ../../Tools/ToolTestBinaryNewickVector/qttestbinarynewickvectormenudialog.ui

RESOURCES += \
    ../../Tools/ToolTestBinaryNewickVector/ToolTestBinaryNewickVector.qrc

HEADERS += \
    ../../Tools/ToolTestBinaryNewickVector/qttestbinarynewickvectormaindialog.h \
    ../../Tools/ToolTestBinaryNewickVector/qttestbinarynewickvectormenudialog.h

SOURCES += \
    ../../Tools/ToolTestBinaryNewickVector/qttestbinarynewickvectormaindialog.cpp \
    ../../Tools/ToolTestBinaryNewickVector/qttestbinarynewickvectormenudialog.cpp

 

 

 

 

 

./ToolTestBinaryNewickVector/ToolTestBinaryNewickVectorWebsite.pri

 

include(../../Tools/ToolTestBinaryNewickVector/ToolTestBinaryNewickVectorConsole.pri)

 

 

 

 

 

./ToolTestBinaryNewickVector/qtmain.cpp

 

//---------------------------------------------------------------------------
/*
TestBinaryNewickVector, GUI tool to test BinaryNewickVector
Copyright (C) 2010-2011 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestBinaryNewickVector.htm
//---------------------------------------------------------------------------
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include <QApplication>
#include "qttestbinarynewickvectormaindialog.h"
#pragma GCC diagnostic pop

int main(int argc, char *argv[])
{
  QApplication a(argc, argv);
  ribi::QtTestBinaryNewickVectorMainDialog w;
  w.show();
  return a.exec();
}

 

 

 

 

 

./ToolTestBinaryNewickVector/qttestbinarynewickvectormaindialog.h

 

//---------------------------------------------------------------------------
/*
TestBinaryNewickVector, GUI tool to test BinaryNewickVector
Copyright (C) 2010-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestBinaryNewickVector.htm
//---------------------------------------------------------------------------
#ifndef DIALOGTESTBINARYNEWICKVECTOR_H
#define DIALOGTESTBINARYNEWICKVECTOR_H

#include "qthideandshowdialog.h"

namespace Ui {
  class QtTestBinaryNewickVectorMainDialog;
}

namespace ribi {

class QtTestBinaryNewickVectorMainDialog : public QtHideAndShowDialog
{
  Q_OBJECT

public:
  explicit QtTestBinaryNewickVectorMainDialog(QWidget *parent = 0);
  QtTestBinaryNewickVectorMainDialog(const QtTestBinaryNewickVectorMainDialog&) = delete;
  QtTestBinaryNewickVectorMainDialog& operator=(const QtTestBinaryNewickVectorMainDialog&) = delete;
  ~QtTestBinaryNewickVectorMainDialog() noexcept;

private:
  Ui::QtTestBinaryNewickVectorMainDialog *ui;
  QTimer * m_timer;
private slots:
  void on_button_calculate_clicked();
  void on_button_about_clicked();
  void on_button_demo_clicked();
  void OnAnyChange();
  void OnDemoTick();

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // DIALOGTESTBINARYNEWICKVECTOR_H

 

 

 

 

 

./ToolTestBinaryNewickVector/qttestbinarynewickvectormaindialog.cpp

 

//---------------------------------------------------------------------------
/*
TestBinaryNewickVector, GUI tool to test BinaryNewickVector
Copyright (C) 2010-2015 Richel Bilderbeek

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program.If not, see <http://www.gnu.org/licenses/>.
*/
//---------------------------------------------------------------------------
//From http://www.richelbilderbeek.nl/ToolTestBinaryNewickVector.htm
//---------------------------------------------------------------------------
#include <cassert>
#include <cstdlib>
#include <iostream>
#include <string>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"

#include <boost/foreach.hpp>

#include <QTimer>

#include "BigIntegerLibrary.hh"

#include "about.h"
#include "qttestbinarynewickvectormaindialog.h"
#include "testtimer.h"
#include "testbinarynewickvectormenudialog.h"
#include "newick.h"
#include "newickstorage.h"
#include "binarynewickvector.h"
#include "sortedbinarynewickvector.h"
#include "qtaboutdialog.h"
#include "ui_qttestbinarynewickvectormaindialog.h"

#pragma GCC diagnostic pop

///QtTestBinaryNewickVectorMainDialog constructor performs most Newick tests
ribi::QtTestBinaryNewickVectorMainDialog::QtTestBinaryNewickVectorMainDialog(QWidget *parent)
  : QtHideAndShowDialog(parent),
    ui(new Ui::QtTestBinaryNewickVectorMainDialog),
    m_timer(new QTimer)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);
  QObject::connect(
    ui->edit_newick,
    static_cast<void (QLineEdit::*)(const QString&)>(&QLineEdit::textChanged),
    this,
    &ribi::QtTestBinaryNewickVectorMainDialog::OnAnyChange
  );
  QObject::connect(
    ui->edit_theta,
    static_cast<void (QLineEdit::*)(const QString&)>(&QLineEdit::textChanged),
    this,
    &ribi::QtTestBinaryNewickVectorMainDialog::OnAnyChange
  );
  QObject::connect(
    m_timer,&QTimer::timeout,
    this,
    &ribi::QtTestBinaryNewickVectorMainDialog::OnAnyChange
  );

  #ifndef NDEBUG
  setWindowTitle(windowTitle()+" (debug)");
  #else
  setWindowTitle(windowTitle()+" (release)");
  #endif

  #ifndef NDEBUG
  //Test general Newick functions
  Newick().Test();
  BinaryNewickVector::Test();

  #endif //~#ifndef NDEBUG

  this->OnAnyChange();
}

ribi::QtTestBinaryNewickVectorMainDialog::~QtTestBinaryNewickVectorMainDialog() noexcept
{
  m_timer->stop();
  delete ui;
  delete m_timer;
}


void ribi::QtTestBinaryNewickVectorMainDialog::OnAnyChange()
{
  //Set the lables that everything failed
  //ui->label_valid->setText("Valid Newick: No");
  //ui->label_simpler->setText("Simpler Newicks: N/A");
  //ui->label_branches->setText("(X,Y) = N/A");
  //ui->label_is_binary->setText("Binary Newick: N/A");
  ui->edit_text->clear();

  const std::string s = ui->edit_newick->text().toStdString();
  if (!Newick().IsNewick(s))
  {
    ui->edit_text->appendPlainText("Valid Newick: No");
    //No Newick, why not?
    try
    {
      Newick().CheckNewick(s);
    }
    catch (std::exception& e)
    {
      //Must get here
      ui->edit_text->appendPlainText(QString("Exception: ")
        + QString(e.what()));
    }
    return;
  }
  assert(Newick().IsNewick(s));
  ui->edit_text->appendPlainText("Valid Newick: Yes");
  try
  {
    boost::lexical_cast<double>(
      std::string(ui->edit_theta->text().toStdString()));
  }
  catch (boost::bad_lexical_cast&)
  {
    ui->edit_text->appendPlainText("Valid theta: No");
    return;
  }
  ui->edit_text->appendPlainText("Valid theta: Yes");

  //Check the std::vector Newick
  try
  {
    const std::vector<int> v = Newick().StringToNewick(s);
    Newick().CheckNewick(v);
  }
  catch (std::exception& e)
  {
    //Should not get here
    ui->edit_text->appendPlainText(
      QString(
          "Unexpected exception after checking conversion to std::vector: ")
      + QString(e.what()));
    return;
  }
  //Calculate the complexity
  {
    const BinaryNewickVector n(s);
    const BigInteger c = Newick().CalcComplexity(n.Peek());
    ui->edit_text->appendPlainText("Newick complexity: "
      + QString(bigIntegerToString(c).c_str()));
  }
  //Check if simple Newick
  if (Newick().IsSimple(Newick().StringToNewick(s)))
  {
    ui->edit_text->appendPlainText("Simple Newick: Yes");
    const double theta = boost::lexical_cast<double>(
      std::string(ui->edit_theta->text().toStdString()));
    const double p = Newick().CalcProbabilitySimpleNewick(Newick().StringToNewick(s),theta);
    ui->edit_text->appendPlainText("Ewens probability: "
      + QString(boost::lexical_cast<std::string>(p).c_str()));
  }
  else
  {
    ui->edit_text->appendPlainText("Simple Newick: No");
  }
  //Check if binary Newick
  if (Newick().IsBinaryNewick(Newick().StringToNewick(s)))
  {
    ui->edit_text->appendPlainText("Binary Newick: Yes");
  }
  else
  {
    ui->edit_text->appendPlainText("Binary Newick: No");
  }
  if (Newick().IsTrinaryNewick(Newick().StringToNewick(s)))
  {
    ui->edit_text->appendPlainText("Trinary Newick: Yes");
  }
  else
  {
    ui->edit_text->appendPlainText("Trinary Newick: No");
  }


  //Check the simpler Newicks
  if(!Newick().IsBinaryNewick(Newick().StringToNewick(s))) return;
  assert(Newick().IsBinaryNewick(Newick().StringToNewick(s)));
  if (Newick().IsBinaryNewick(Newick().StringToNewick(s)))
  {
    const std::vector<std::vector<int> > simpler
      = Newick().GetSimplerBinaryNewicks(Newick().StringToNewick(s));
    std::string text = "Simpler Newicks:\n";
    BOOST_FOREACH(const std::vector<int> simple,simpler)
    {
      try
      {
        Newick().CheckNewick(simple);
        text+="  ";
        text+=Newick().NewickToString(simple);
        text+='\n';
      }
      catch (std::exception& e)
      {
        //Should not get here
        text += std::string(e.what()) + "\n";
      }
    }
    if (simpler.empty()) text+=" [none]\n";
    //Pop the trailing '\n'
    text.resize(text.size() - 1);
    ui->edit_text->appendPlainText(text.c_str());
  }
  assert(Newick().IsBinaryNewick(Newick().StringToNewick(s)));
  if (Newick().StringToNewick(s).size()>3
    && Newick().IsBinaryNewick(Newick().StringToNewick(s)))
  {
    std::string text = "(X,Y) =\n";

    const std::pair<std::vector<int>,std::vector<int> > b
      = Newick().GetRootBranchesBinary(
          Newick().StringToNewick(s));
    try
    {
      Newick().CheckNewick(b.first);
      text+="  " + Newick().NewickToString(b.first);
    }
    catch (std::exception& e)
    {
      text+=std::string(e.what());
    }
    text+="\n";
    try
    {
      Newick().CheckNewick(b.second);
      text+="  " + Newick().NewickToString(b.second);
    }
    catch (std::exception& e)
    {
      text+=std::string(e.what());
    }
    ui->edit_text->appendPlainText(text.c_str());
  }
  //Check CalcNumOfCombinations and CalcNumOfSymmetries
  {
    const BinaryNewickVector n(s);
    const BigInteger n_s = n.CalcNumOfSymmetries();
    const BigInteger n_c = n.CalcNumOfCombinations();
    ui->edit_text->appendPlainText(
      QString("Number of symmetries: ")
      + QString(boost::lexical_cast<std::string>(n_s).c_str()));
    ui->edit_text->appendPlainText(
      QString("Number of combinations: ")
      + QString(bigIntegerToString(n_c).c_str()));
  }
}

void ribi::QtTestBinaryNewickVectorMainDialog::OnDemoTick()
{
  //Get any Newick
  if ((std::rand() >> 4) % 2)
  {
    const std::vector<std::string> v = Newick().CreateValidNewicks();
    const std::string s = v[std::rand() % v.size()];
    ui->edit_newick->setText(QString(s.c_str()));
  }
  else
  {
    const std::vector<std::string> v = Newick().CreateInvalidNewicks();
    const std::string s = v[std::rand() % v.size()];
    ui->edit_newick->setText(QString(s.c_str()));
  }
}

//#ifndef WIN32
///CliToStr converts a cln::cl_I to std::string.
///From http://www.richelbilderbeek.nl/CppCliToStr.htm
//const std::string CliToStr(const cln::cl_I& i)
//{
//  std::stringstream s;
//  s << i;
//  return s.str();
//}
//#endif

void ribi::QtTestBinaryNewickVectorMainDialog::on_button_demo_clicked()
{
  if (m_timer->isActive())
  {
    m_timer->stop();
    assert(!m_timer->isActive());
    ui->button_demo->setText("&Start demo");
  }
  else
  {
    m_timer->start(1000);
    assert(m_timer->isActive());
    ui->button_demo->setText("&Stop demo");
  }
}

void ribi::QtTestBinaryNewickVectorMainDialog::on_button_about_clicked()
{
  QtAboutDialog d(TestBinaryNewickVectorMenuDialog().GetAbout());
  this->ShowChild(&d);
}

void ribi::QtTestBinaryNewickVectorMainDialog::on_button_calculate_clicked()
{
  OnAnyChange();
  const std::string s = ui->edit_newick->text().toStdString();
  if (!Newick().IsNewick(s))
  {
    ui->edit_text->appendPlainText("NOT A VALID NEWICK");
    return;
  }
  if (!Newick().IsBinaryNewick(Newick().StringToNewick(s)))
  {
    ui->edit_text->appendPlainText("NOT A VALID BINARY NEWICK");
    return;
  }
  try
  {
    boost::lexical_cast<double>(std::string(ui->edit_theta->text().toStdString()));
  }
  catch (std::exception& e)
  {
    ui->edit_text->appendPlainText("NOT A VALID THETA");
    return;
  }
  const SortedBinaryNewickVector newick(s);
  const double theta = boost::lexical_cast<double>(
    std::string(ui->edit_theta->text().toStdString()));
  NewickStorage<SortedBinaryNewickVector> storage(newick);

  const double probability
    = Newick().CalculateProbability(
        newick,
        theta,
        storage);

  ui->edit_text->appendPlainText(
    QString("PROBABILITY: ")
    + boost::lexical_cast<std::string>(probability).c_str());
}

#ifndef NDEBUG
void ribi::QtTestBinaryNewickVectorMainDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
}
#endif

 

 

 

 

 

./ToolTestBinaryNewickVector/qttestbinarynewickvectormenudialog.h

 

#ifndef QTTESTBINARYNEWICKVECTORMENUDIALOG_H
#define QTTESTBINARYNEWICKVECTORMENUDIALOG_H

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "qthideandshowdialog.h"
#pragma GCC diagnostic pop

namespace Ui {
  class QtTestBinaryNewickVectorMenuDialog;
}

namespace ribi {

class QtTestBinaryNewickVectorMenuDialog : public QtHideAndShowDialog
{
  Q_OBJECT

public:
  explicit QtTestBinaryNewickVectorMenuDialog(QWidget *parent = 0);
  QtTestBinaryNewickVectorMenuDialog(const QtTestBinaryNewickVectorMenuDialog&) = delete;
  QtTestBinaryNewickVectorMenuDialog& operator=(const QtTestBinaryNewickVectorMenuDialog&) = delete;
  ~QtTestBinaryNewickVectorMenuDialog() noexcept;

private slots:
  void on_button_about_clicked();
  void on_button_quit_clicked();
  void on_button_start_clicked();

private:
  Ui::QtTestBinaryNewickVectorMenuDialog *ui;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // QTTESTBINARYNEWICKVECTORMENUDIALOG_H

 

 

 

 

 

./ToolTestBinaryNewickVector/qttestbinarynewickvectormenudialog.cpp

 

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#include "qttestbinarynewickvectormenudialog.h"

#include <cassert>

#include "testbinarynewickvectormenudialog.h"
#include "qtaboutdialog.h"
#include "qttestbinarynewickvectormaindialog.h"
#include "testtimer.h"
#include "trace.h"
#include "ui_qttestbinarynewickvectormenudialog.h"
#pragma GCC diagnostic pop

ribi::QtTestBinaryNewickVectorMenuDialog::QtTestBinaryNewickVectorMenuDialog(QWidget *parent) :
  QtHideAndShowDialog(parent),
  ui(new Ui::QtTestBinaryNewickVectorMenuDialog)
{
  #ifndef NDEBUG
  Test();
  #endif
  ui->setupUi(this);
}

ribi::QtTestBinaryNewickVectorMenuDialog::~QtTestBinaryNewickVectorMenuDialog() noexcept
{
  delete ui;
}

void ribi::QtTestBinaryNewickVectorMenuDialog::on_button_start_clicked()
{
  QtTestBinaryNewickVectorMainDialog d;
  this->ShowChild(&d);
}

void ribi::QtTestBinaryNewickVectorMenuDialog::on_button_about_clicked()
{
  QtAboutDialog d(TestBinaryNewickVectorMenuDialog().GetAbout());
  this->ShowChild(&d);
}

void ribi::QtTestBinaryNewickVectorMenuDialog::on_button_quit_clicked()
{
  this->close();
}

#ifndef NDEBUG
void ribi::QtTestBinaryNewickVectorMenuDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  QtTestBinaryNewickVectorMainDialog();
  const TestTimer test_timer(__func__,__FILE__,1.0);
}
#endif

 

 

 

 

 

./ToolTestBinaryNewickVector/testbinarynewickvectormenudialog.h

 

#ifndef TESTBINARYNEWICKVECTORMENUDIALOG_H
#define TESTBINARYNEWICKVECTORMENUDIALOG_H

#include <string>
#include <vector>

#include "menudialog.h"

namespace ribi {

///GUI independent TestBinaryNewick menu dialog
struct TestBinaryNewickVectorMenuDialog final : public MenuDialog
{
  TestBinaryNewickVectorMenuDialog();
  About GetAbout() const noexcept override;
  Help GetHelp() const noexcept override;
  boost::shared_ptr<const Program> GetProgram() const noexcept override;
  std::string GetVersion() const noexcept override;
  std::vector<std::string> GetVersionHistory() const noexcept override;

  private:
  int ExecuteSpecific(const std::vector<std::string>& argv) noexcept override;

  #ifndef NDEBUG
  static void Test() noexcept;
  #endif
};

} //~namespace ribi

#endif // TESTBINARYNEWICKVECTORMENUDIALOG_H

 

 

 

 

 

./ToolTestBinaryNewickVector/testbinarynewickvectormenudialog.cpp

 

#include "testbinarynewickvectormenudialog.h"

#include <cassert>
#include <iostream>
#include <iterator>
#include <sstream>

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Weffc++"
#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
#include <boost/shared_ptr.hpp>
#include <boost/lexical_cast.hpp>

#include "binarynewickvector.h"
#include "richelbilderbeekprogram.h"
#include "trace.h"
#include "testtimer.h"
#pragma GCC diagnostic pop

ribi::TestBinaryNewickVectorMenuDialog::TestBinaryNewickVectorMenuDialog()
{
  #ifndef NDEBUG
  Test();
  #endif
}

int ribi::TestBinaryNewickVectorMenuDialog::ExecuteSpecific(const std::vector<std::string>& argv) noexcept
{
  const int argc = static_cast<int>(argv.size());
  if (argc == 1)
  {
    std::cout << GetHelp() << '\n';
    return 1;
  }

  assert(!"TODO");
  return 1;
}

ribi::About ribi::TestBinaryNewickVectorMenuDialog::GetAbout() const noexcept
{
  About a(
    "Richel Bilderbeek",
    "TestBinaryNewickVector",
    "GUI tool to test BinaryNewickVector",
    "the 6th of December 2013",
    "2010-2015",
    "http://www.richelbilderbeek.nl/ToolTestBinaryNewickVector.htm",
    GetVersion(),
    GetVersionHistory());
  a.AddLibrary("BigInt: version 2010.04.30");
  a.AddLibrary("BinaryNewickVector: " + BinaryNewickVector::GetVersion());
  a.AddLibrary("Trace version: " + Trace::GetVersion());
  return a;
}

ribi::Help ribi::TestBinaryNewickVectorMenuDialog::GetHelp() const noexcept
{
  return ribi::Help(
    this->GetAbout().GetFileTitle(),
    this->GetAbout().GetFileDescription(),
    {
      //Options
    },
    {
      //Example uses
    }
  );
}

boost::shared_ptr<const ribi::Program> ribi::TestBinaryNewickVectorMenuDialog::GetProgram() const noexcept
{
  const boost::shared_ptr<const ribi::Program> p(new ProgramTestBinaryNewickVector);
  assert(p);
  return p;
}

std::string ribi::TestBinaryNewickVectorMenuDialog::GetVersion() const noexcept
{
  return "3.2";
}

std::vector<std::string> ribi::TestBinaryNewickVectorMenuDialog::GetVersionHistory() const noexcept
{
  return {
    "2010-08-20: Version 1.0: initial version, tool was called TestNewickVector",
    "2010-08-21: Version 1.1: added more debug checks, added IsBinary,  GetSimpler and GetRootBranches",
    "2010-08-24: Version 1.2: calculates the total number of derived Newicks and (related to this) the number of symmetries in a Newick",
    "2010-08-25: Version 1.3: calculates the Ewens probability of simple Newicks",
    "2010-09-04: Version 1.4: '(1,(3))' is added to the set of invalid Newicks",
    "2010-09-16: Version 1.5: added library version numbers, created difference in debug and release version, fixed a bug in BinaryNewickVector::GetSimplerNewicks, added '(0)' to the set of invalid Newicks",
    "2010-10-01: Version 1.6: transition from CLN to BigInt library, so TestBinaryNewickVector can run under Windows. Kept checks comparing CLN and BigInt library in under Ubuntu",
    "2011-02-20: Version 2.0: major revision of architecture, removed use of CLN library, renamed program to TestBinaryNewickVector",
    "2011-03-01: Version 3.0: major rewrite of algorithms",
    "2011-03-08: Version 3.1: minor rewrite of algorithms",
    "2013-12-06: Version 3.2: conformized to ProjectRichelBilderbeek"
  };
}

#ifndef NDEBUG
void ribi::TestBinaryNewickVectorMenuDialog::Test() noexcept
{
  {
    static bool is_tested{false};
    if (is_tested) return;
    is_tested = true;
  }
  {
    BinaryNewickVector::Test();
  }
  const TestTimer test_timer(__func__,__FILE__,1.0);
}
#endif

 

 

 

 

 

./ToolTestBinaryNewickVector/zip.sh

 

#!/bin/sh
#zip packs all the files to port into a single .zip file,
#minicking the same folder structure
#Folder structure
# *
#   * Classes
#     * CppAbout
#     * CppBinaryNewickVector
#     * CppNewick
#     * CppQtAboutDialog
#     * CppSortedBinaryNewickVector
#   * Libraries
#     * bigint-2010.04.30
#   * Tools
#    * ToolTestBinaryNewickVector
echo "Mimicking file structure"
mkdir temp_zip
mkdir temp_zip/Classes
mkdir temp_zip/Classes/CppAbout
mkdir temp_zip/Classes/CppBinaryNewickVector
mkdir temp_zip/Classes/CppNewick
mkdir temp_zip/Classes/CppQtAboutDialog
mkdir temp_zip/Classes/CppSortedBinaryNewickVector
mkdir temp_zip/Libraries
mkdir temp_zip/Libraries/bigint-2010.04.30
mkdir temp_zip/Tools
mkdir temp_zip/Tools/ToolTestBinaryNewickVector

echo "Copying files"
cp ../../Classes/CppAbout/*.* temp_zip/Classes/CppAbout
cp ../../Classes/CppBinaryNewickVector/*.* temp_zip/Classes/CppBinaryNewickVector
cp ../../Classes/CppNewick/*.* temp_zip/Classes/CppNewick
cp ../../Classes/CppQtAboutDialog/*.* temp_zip/Classes/CppQtAboutDialog
cp ../../Classes/CppSortedBinaryNewickVector/*.* temp_zip/Classes/CppSortedBinaryNewickVector
cp ../../Libraries/bigint-2010.04.30/*.* temp_zip/Libraries/bigint-2010.04.30
cp ../../Tools/ToolTestBinaryNewickVector/*.* temp_zip/Tools/ToolTestBinaryNewickVector

echo "Compressing files"
cd temp_zip

zip -r ToolTestBinaryNewickVectorSource_3_1 Classes
zip -r ToolTestBinaryNewickVectorSource_3_1 Libraries
zip -r ToolTestBinaryNewickVectorSource_3_1 Tools

echo "Copying zipped file from temp folder to this folder"

cd ..
cp temp_zip/ToolTestBinaryNewickVectorSource_3_1.zip ToolTestBinaryNewickVectorSource_3_1.zip

echo "Cleaning up"
#Classes
rm temp_zip/Classes/CppAbout/*.*
rm temp_zip/Classes/CppBinaryNewickVector/*.*
rm temp_zip/Classes/CppNewick/*.*
rm temp_zip/Classes/CppQtAboutDialog/*.*
rm temp_zip/Classes/CppSortedBinaryNewickVector/*.*
rmdir temp_zip/Classes/CppAbout
rmdir temp_zip/Classes/CppBinaryNewickVector
rmdir temp_zip/Classes/CppNewick
rmdir temp_zip/Classes/CppQtAboutDialog
rmdir temp_zip/Classes/CppSortedBinaryNewickVector
rmdir temp_zip/Classes
#Libraries
rm temp_zip/Libraries/bigint-2010.04.30/*.*
rmdir temp_zip/Libraries/bigint-2010.04.30
rmdir temp_zip/Libraries
#Tools
rm temp_zip/Tools/ToolTestBinaryNewickVector/*.*
rmdir temp_zip/Tools/ToolTestBinaryNewickVector
rmdir temp_zip/Tools
rm temp_zip/*.*
rmdir temp_zip
echo "Done"

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml