SVN r8748

This commit is contained in:
Jordan Sherer
2018-06-14 21:27:34 -04:00
parent 419c039d08
commit 4f1fe4fc94
581 changed files with 69338 additions and 39836 deletions
@@ -0,0 +1,88 @@
#include "revision_utils.hpp"
#include <cstring>
#include <QCoreApplication>
#include <QRegularExpression>
#include "scs_version.h"
namespace
{
QString revision_extract_number (QString const& s)
{
QString revision;
// try and match a number (hexadecimal allowed)
QRegularExpression re {R"(^[$:]\w+: (r?[\da-f]+[^$]*)\$$)"};
auto match = re.match (s);
if (match.hasMatch ())
{
revision = match.captured (1);
}
return revision;
}
}
QString revision (QString const& scs_rev_string)
{
QString result;
auto revision_from_scs = revision_extract_number (scs_rev_string);
#if defined (CMAKE_BUILD)
QString scs_info {":Rev: " WSJTX_STRINGIZE (SCS_VERSION) " $"};
auto revision_from_scs_info = revision_extract_number (scs_info);
if (!revision_from_scs_info.isEmpty ())
{
// we managed to get the revision number from svn info etc.
result = revision_from_scs_info;
}
else if (!revision_from_scs.isEmpty ())
{
// fall back to revision passed in if any
result = revision_from_scs;
}
else
{
// match anything
QRegularExpression re {R"(^[$:]\w+: ([^$]*)\$$)"};
auto match = re.match (scs_info);
if (match.hasMatch ())
{
result = match.captured (1);
}
}
#else
if (!revision_from_scs.isEmpty ())
{
// not CMake build so all we have is revision passed
result = revision_from_scs;
}
#endif
return result.trimmed ();
}
QString version (bool include_patch)
{
#if defined (CMAKE_BUILD)
QString v {WSJTX_STRINGIZE (WSJTX_VERSION_MAJOR) "." WSJTX_STRINGIZE (WSJTX_VERSION_MINOR)};
if (include_patch)
{
v += "." WSJTX_STRINGIZE (WSJTX_VERSION_PATCH)
# if defined (WSJTX_RC)
+ "-rc" WSJTX_STRINGIZE (WSJTX_RC)
# endif
;
}
#else
QString v {"Not for Release"};
#endif
return v;
}
QString program_title (QString const& revision)
{
QString id {QCoreApplication::applicationName () + " v" + QCoreApplication::applicationVersion ()};
return id + " " + revision + " by K1JT";
}
@@ -1,40 +0,0 @@
#ifndef CYCLESOFGRAPH
#define CYCLESOFGRAPH 1
#include <cstdlib>
#include <iostream> // C++ I/O library header
//#include <iomanip.h>
class NodesOfGraph{
public:
int numOfParityConnections;
int *parityConnections;
int numOfSymbolConnections;
int *symbolConnections;
int numOfSymbolMapping;
int *symbolMapping;
NodesOfGraph(void);
~NodesOfGraph(void);
void setParityConnections(int num, int *value);
void setSymbolConnections(int num, int *value);
void setSymbolMapping(int num, int *values);
}; //Why this is necessary?
class CyclesOfGraph {
public:
int M, N;
int *(*H);
int *cyclesTable;
NodesOfGraph *nodesOfGraph;
CyclesOfGraph(int mm, int n, int *(*h));
~CyclesOfGraph(void);
void getCyclesTable(void);
void printCyclesTable(void);
int girth(void);
private:
int *tmp, *med, *tmpCycles;
};
#endif