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
oaLHSUtility.h
Go to the documentation of this file.
1 
22 #ifndef OALHSUTILITY_H
23 #define OALHSUTILITY_H
24 
25 #include <vector>
26 
27 namespace oalhslib
28 {
36  template <class T>
37  void findUniqueColumnElements(const bclib::matrix<T> & A, std::vector<std::vector<T> > & U)
38  {
39  if (U.size() != A.colsize())
40  {
41  U = std::vector<std::vector<T> >(A.colsize());
42  }
43  for (typename bclib::matrix<T>::size_type i = 0; i < A.colsize(); i++)
44  {
45  U[i] = std::vector<T>();
46  for (typename bclib::matrix<T>::const_columnwise_iterator it = A.columnwisebegin(i); it != A.columnwiseend(i); ++it)
47  {
48  typename std::vector<T>::iterator tempit = std::find(U[i].begin(), U[i].end(), *it);
49  if (tempit == U[i].end())
50  {
51  U[i].push_back(*it);
52  }
53  }
54  }
55  }
56 
57 }
58 
59 #endif /* OALHSUTILITY_H */
60 
oalhslib::findUniqueColumnElements
void findUniqueColumnElements(const bclib::matrix< T > &A, std::vector< std::vector< T > > &U)
The the unique column elements of a matrix.
Definition: oaLHSUtility.h:37