Orthogonal Array Library  1.0.0
Libray for generating orthogonal arrays based on Art Owen's oa library
All Classes Namespaces Files Functions Variables Typedefs Macros Pages
COrthogonalArray.h
Go to the documentation of this file.
1 
25 #ifndef CORTHOGONALARRAY_H
26 #define CORTHOGONALARRAY_H
27 
28 #include "OACommonDefines.h"
29 #include "GaloisField.h"
30 #include "construct.h"
31 #include "runif.h"
32 #include "rutils.h"
33 #include "oa.h"
34 #include "primes.h"
35 
37 #define ROWCHECK 50
38 
39 #define NOMESSAGES 0
40 
41 #define SOMEMESSAGES 1
42 
43 #define ALLMESSAGES 2
44 
48 namespace oacpp {
55  {
56  public:
65 
107  void addelkemp(int q, int k, int* n);
108 
168  void addelkemp3(int q, int k, int* n);
169 
193  void addelkempn(int akn, int q, int k, int* n);
194 
211  void bose(int q, int k, int* n);
212 
236  void bosebush(int q, int k, int *n);
237 
271  void bosebushl(int lambda, int q, int k, int* n);
272 
292  void bush(int q, int k, int* n);
293 
311  void busht(int str, int q, int k, int* n);
312 
350  int oaagree(bool verbose);
394  int oatriple(bool verbose);
395 
399  void oadimen();
400 
428  void oarand(int is, int js, int ks, int ls);
429 
463  int oastr(bool verbose);
464 
489  bool oastr1(bool verbose);
490 
520  bool oastr2(bool verbose);
526  bool oastr3(bool verbose);
532  bool oastr4(bool verbose);
533 
539  bool oastrt(int t, bool verbose);
540 
545  int getnrows();
550  int getncols();
555  int getq();
560  const bclib::matrix<int> & getoa();
561 
562  private:
563  GaloisField m_gf;
564  bclib::matrix<int> m_A;
565  int m_nrow;
566  int m_ncol;
567  int m_q;
568  RUnif m_randomClass;
569 
575  void createGaloisField(int q);
580  void checkDesignMemory();
588  int checkMaxColumns(int k, int maxColumns);
597  void checkResult(int result, int nvalue, int * n);
598  };
599 
600  inline
602  {
603  PRINT_OUTPUT << "\nThe array has " << m_nrow << " rows, " << m_ncol << " columns and appears\n";
604  PRINT_OUTPUT << "to have " << m_q << " symbols, since the largest symbol is " << m_q - 1 << ".\n";
605  }
606 
607  inline
609  {
610  return m_nrow;
611  }
612  inline
614  {
615  return m_ncol;
616  }
617  inline
619  {
620  return m_q;
621  }
622  inline
623  const bclib::matrix<int> & COrthogonalArray::getoa()
624  {
625  return m_A;
626  }
627 }
628 
629 #endif
PRINT_OUTPUT
#define PRINT_OUTPUT
A print macro to enable printing with or without R.
Definition: OACommonDefines.h:55
oacpp::COrthogonalArray::oastr2
bool oastr2(bool verbose)
Similar to oastr, but only checking strength 2.
Definition: COrthogonalArray.cpp:327
oacpp::COrthogonalArray::getq
int getq()
symbol accessor
Definition: COrthogonalArray.h:618
runif.h
oacpp::COrthogonalArray::addelkemp3
void addelkemp3(int q, int k, int *n)
Construct an orthogonal array using the Addelman Kempthorne algorithm.
Definition: COrthogonalArray.cpp:90
oacpp::COrthogonalArray
Orthogonal Array Class.
Definition: COrthogonalArray.h:55
GaloisField.h
oacpp::COrthogonalArray::addelkempn
void addelkempn(int akn, int q, int k, int *n)
Construct an orthogonal array using the Addelman Kempthorne algorithm.
Definition: COrthogonalArray.cpp:102
oacpp
Orthogonal Array Namespace.
Definition: ak.h:39
oacpp::GaloisField
Class to define a Galois Field and Methods for operations.
Definition: GaloisField.h:27
oacpp::COrthogonalArray::oaagree
int oaagree(bool verbose)
Count the number of columns for which each pair of rows agree.
Definition: COrthogonalArray.cpp:201
oacpp::COrthogonalArray::getncols
int getncols()
column accessor
Definition: COrthogonalArray.h:613
oacpp::COrthogonalArray::bosebushl
void bosebushl(int lambda, int q, int k, int *n)
Construct an orthogonal array using the Bose-Bush algorithm.
Definition: COrthogonalArray.cpp:142
construct.h
primes.h
oacpp::COrthogonalArray::getoa
const bclib::matrix< int > & getoa()
orthogonal array accessor
Definition: COrthogonalArray.h:623
OACommonDefines.h
oacpp::RUnif
Marsaglia - Zaman universal random number generator.
Definition: runif.h:77
oacpp::COrthogonalArray::oastr3
bool oastr3(bool verbose)
Similar to oastr, but only checking strength 3.
Definition: COrthogonalArray.cpp:333
oa.h
oacpp::COrthogonalArray::bush
void bush(int q, int k, int *n)
Construct an orthogonal array using the Bush algorithm.
Definition: COrthogonalArray.cpp:173
oacpp::COrthogonalArray::bosebush
void bosebush(int q, int k, int *n)
Construct an orthogonal array using the Bose-Bush algorithm.
Definition: COrthogonalArray.cpp:126
oacpp::COrthogonalArray::oastr
int oastr(bool verbose)
Find the strength of an orthogonal array.
Definition: COrthogonalArray.cpp:300
oacpp::COrthogonalArray::~COrthogonalArray
~COrthogonalArray()
Default Destructor.
Definition: COrthogonalArray.h:64
rutils.h
oacpp::COrthogonalArray::getnrows
int getnrows()
row accessor
Definition: COrthogonalArray.h:608
oacpp::COrthogonalArray::busht
void busht(int str, int q, int k, int *n)
Construct an orthogonal array using the Bush algorithm.
Definition: COrthogonalArray.cpp:185
oacpp::COrthogonalArray::bose
void bose(int q, int k, int *n)
Construct an orthogonal array using the Bose algorithm.
Definition: COrthogonalArray.cpp:114
oacpp::COrthogonalArray::oadimen
void oadimen()
Print the dimension of the orthogonal array.
Definition: COrthogonalArray.h:601
oacpp::COrthogonalArray::oastr4
bool oastr4(bool verbose)
Similar to oastr, but only checking strength 4.
Definition: COrthogonalArray.cpp:339
oacpp::COrthogonalArray::oastrt
bool oastrt(int t, bool verbose)
Similar to oastr, but only checking for strength t.
Definition: COrthogonalArray.cpp:345
oacpp::COrthogonalArray::oastr1
bool oastr1(bool verbose)
Similar to oastr, but only checking strength 1.
Definition: COrthogonalArray.cpp:321
oacpp::COrthogonalArray::addelkemp
void addelkemp(int q, int k, int *n)
Construct an orthogonal array using the Addelman Kempthorne algorithm.
Definition: COrthogonalArray.cpp:78
oacpp::COrthogonalArray::oatriple
int oatriple(bool verbose)
Count the number of columns for which each three rows agree.
Definition: COrthogonalArray.cpp:247
oacpp::COrthogonalArray::COrthogonalArray
COrthogonalArray()
Default Constructor.
Definition: COrthogonalArray.cpp:29
oacpp::COrthogonalArray::oarand
void oarand(int is, int js, int ks, int ls)
Randomize an orthogonal array.
Definition: COrthogonalArray.cpp:286