Interface for even-odd designs

Contains functions to generate even-odd designs.

The generation is done by defining a special ordering in the set of designs. The primary ordering is based in the J5 value of 5-column designs, the secondary ordering is the regular LMC ordering.

Typedefs

typedef Pareto<mvalue_t<long>, array_link>::pValue (*pareto_cb)(const array_link&, int)

callback function for Pareto calculations

typedef Pareto<mvalue_t<long>, array_link>::pValue (*pareto_cb_cache)(const array_link&, int, rankStructure &rs)

callback function for Pareto calculations with cache

Enums

enum depth_alg_t

Values:

enumerator DEPTH_DIRECT
enumerator DEPTH_EXTENSIONS

Functions

void processDepth(const arraylist_t &goodarrays, depth_alg_t depthalg, depth_extend_t &dextend, depth_extend_sub_t &dextendsublight, int extensioncol, int verbose = 0)

Extend arrays using a depth-first or breadth-first approach

Parameters:
  • goodarrays – List of arrays to extend

  • depthalg – Extend using depth-first or breadth-first

  • dextend – Option structure for the extension

  • dextendsublight – Data structure for the extensions

  • extensioncol – Column to extend

  • verbose – Verbosity level

void depth_extend_hybrid(const arraylist_t &alist, depth_extend_t &dextend, int extcol, const OAextend &oaextendx, int verbose)

depth-first extension of arrays. depending on the symmetry group of the array to be extended a direct method is used or a method with caching of candidate columns

void depth_extend_direct(const arraylist_t &alist, depth_extend_t &dextend, int extcol, const OAextend &oaextendx, int verbose)

variation of depth_extend for arrays with large symmetry groups

void depth_extend_array(const array_link &al, depth_extend_t &dextend, const arraydata_t &adfull, int verbose, depth_extensions_storage_t *ds = 0, int = 0)

depth extend a single array

template<class IndexType>
inline Pareto<mvalue_t<long>, IndexType>::pValue calculateArrayParetoJ5Cache(const array_link &al, int verbose, rankStructure &rs)
void addArraysToPareto(Pareto<mvalue_t<long>, array_link> &pset, pareto_cb paretofunction, const arraylist_t &arraylist, int jj, int verbose)

add arrays to set of Pareto results

void addArraysToPareto(Pareto<mvalue_t<long>, array_link> &pset, pareto_cb_cache paretofunction, const arraylist_t &arraylist, int jj, int verbose)

add arrays to set of Pareto results

Jcounter readStatisticsFile(const char *numbersfile, int verbose)

read statistics object from disk

void writeStatisticsFile(const char *numbersfile, const Jcounter &jc, int verbose)

write statistics object to disk

Jcounter calculateJstatistics(const char *afile, int jj = 5, int verbose = 1)

calculate J-value statistics

Return -1 if the first array is smaller in J54 ordering than the second array, 0 if equal and 1 otherwise

struct depth_path_t
#include <evenodd.h>

structure containing current position in search tree

Public Functions

inline depth_path_t()
inline void updatePositionGEC(int k, int goodextensioncols)
inline void updatePosition(int k, int c, int m, int extensioncols, int goodextensioncols)
inline void show(int depth, int maxentries = 8) const
inline void init(int ncols, int _depthstart = 9)

Public Members

std::vector<int> ncurr

vector with current position

std::vector<int> nmax

vector with target

std::vector<int> necols

number of extension columns

std::vector<int> ngecols

number of good extension columns

int depthstart
struct counter_t
#include <evenodd.h>

structure to count and show number of arrays generated, the structure is thread safe

Public Functions

counter_t(int n)
void addNfound(int col, int num)
long nArrays() const
void addNumberFound(int n, int k)
void clearNumberFound()
void addNumberFound(const counter_t &de)
void showcountscompact() const

show information about the number of arrays found

void showcounts(const arraydata_t &ad) const

show information about the number of arrays found

void showcounts(const char *str, int first, int last) const

show information about the number of arrays found

Public Members

std::vector<int> nfound
struct depth_extend_sub_t
#include <evenodd.h>

Helper structure for dynamic extension

In this structure we keep track of pointers to valid column extensions

Public Functions

inline depth_extend_sub_t(int nn = 0)
inline void resize(int nn)
inline size_t n() const
inline std::vector<int> updateExtensionPointers(int extcol)
arraylist_t initialize(const arraylist_t &alist, const arraydata_t &adf, const OAextend &oaextend)

initialize the new list of extension columns

inline arraylist_t selectArraysZ(const arraylist_t &alist) const

select the arrays with are LMC and hence need to be written to disk

inline arraylist_t selectArraysXX(const array_link &al, const arraylist_t &elist) const
inline void info() const

Public Members

std::vector<int> lmctype
std::vector<int> lastcol

last column changed in lmc check

std::vector<double> strengthcheck
std::vector<int> valididx
int verbose
struct depth_extend_t
#include <evenodd.h>

Helper structure for dynamic extension.

This structure allows for writing the generated arrays to disk. It also contains functions to print progress of the extension.

Multiple copies of this class are made, but they all share the same counter_t and arraywriter_t object. Also t0 and tp are shared

Public Functions

inline depth_extend_t(const arraydata_t *ad_, double _logtime = 10000000, int _discardJ5 = -1)
inline depth_extend_t(const depth_extend_t &de)
inline ~depth_extend_t()
inline void show()
inline void setNarraysMax(long n)
inline void maxArrayCheck()
inline void showsearchpath(int depth) const
inline bool showprogress(int showtime = 1, int depth = 0, int forcelog = 0)

show information about the progress of the loop

inline void info() const
inline void setposition(int k, int c, int m, int extensioncols = -1, int goodextensioncols = -1)

set the position in the dextend structure

inline void setpositionGEC(int k, int goodextensioncols)

set the position in the dextend structure

Public Members

int verbose
OAextend oaextend
const arraydata_t *ad
int loglevelcol
double logtime

print progress every x seconds

arraylist_t extension_column_list
int writearrays

if set to true write arrays to disk

int discardJ5
long discardJ5number

if true, then we discard the designs which have J5 maximal

arraywriter_t *arraywriter
counter_t *counter

Public Static Attributes

static double t0
static double tp

Private Members

long narraysmax
depth_path_t searchpath
struct depth_extensions_storage_t
#include <evenodd.h>

Helper structure for the even-odd depth extension.

Public Functions

inline void resize(size_t s)
inline void set(int ai, const arraylist_t &goodarrays, const arraylist_t &extension_column_list, depth_alg_t depthalg, const depth_extend_sub_t &dextendsub)

Public Members

std::vector<arraylist_t> columnextensionsList
std::vector<arraylist_t> goodarrayslist
std::vector<depth_alg_t> depthalglist
std::vector<depth_extend_sub_t> dextendsubList
struct jindex_t
#include <evenodd.h>

helper class for indexing statistics of designs

The index consists of the number of columns and the value for the J-characteristic

Public Functions

inline jindex_t(int colindex, int jvalue)
inline bool operator<(const jindex_t &rhs) const
inline std::string toString() const

Public Members

int k

number of columns

int j

J-value.

class Jcounter
#include <evenodd.h>

object to hold counts of maximum J_k-values

Public Functions

inline Jcounter()
inline Jcounter(int N, int jj = 5, int k = -1)
bool validData()
bool hasColumn(int col) const

return true if specified column is in the data

inline bool isOpen() const
inline void showPerformance() const
long narrays() const
void show() const

show statistics of the object

int maxCols() const
long getCount(int k, int j) const
std::vector<long> getTotalsJvalue(int jval) const
std::vector<long> getTotals() const
void showcompact() const

show statistics of the object

Jcounter &operator+=(Jcounter &jc)
void addArrays(const arraylist_t &arraylist, int verbose = 0)

add list of arrays to object

void addArray(const array_link &al, int verbose = 0)

add single array to statistics object

Public Members

int N

number of rows

int jj
std::vector<int> fvals
std::map<jindex_t, long> maxJcounts
double dt

time needed for calculation

Private Functions

void init(int N, int jj, int k = -1)