26 #include "boost/static_assert.hpp"
34 using namespace pwiz::util;
35 using namespace pwiz::math;
52 copy(pairs.
begin(), pairs.
end(), ostream_iterator<OrderedPair>(*
os_,
" "));
83 vector<OrderedPair> v;
84 copy(pairs.
begin(), pairs.
end(), back_inserter(v));
97 if (
os_) *
os_ <<
"testArray()\n";
98 double a[] = {1, 2, 3, 4, 5, 6};
106 if (
os_) *
os_ <<
"testVectorDouble()\n";
108 for (
int i=1; i<=6; i++) v.push_back(i);
115 if (
os_) *
os_ <<
"testVectorOrderedPair()\n";
116 vector<OrderedPair> v;
124 #pragma pack(push, 1)
131 if (
os_) *
os_ <<
"testVectorCustomPair()\n";
132 vector<CustomPair> v;
142 if (
os_) *
os_ <<
"testEquality()\n";
143 vector<OrderedPair> v;
148 vector<OrderedPair> w = v;
155 v.back().y = w.back().y;
162 vector<OrderedPair> v;
163 istringstream iss(
"(420,666) (421,667)");
164 copy(istream_iterator<OrderedPair>(iss), istream_iterator<OrderedPair>(), back_inserter(v));
184 int main(
int argc,
char* argv[])
190 if (argc>1 && !strcmp(argv[1],
"-v"))
os_ = &cout;
void testVectorOrderedPair()
void testVectorCustomPair()
int main(int argc, char *argv[])
const_iterator end() const
const_iterator begin() const
BOOST_STATIC_ASSERT(sizeof(OrderedPair)==2 *sizeof(double))
CustomPair(double _a, double _b)
#define TEST_PROLOG(argc, argv)
KernelTraitsBase< Kernel >::space_type::abscissa_type x
KernelTraitsBase< Kernel >::space_type::ordinate_type y
wrapper class for accessing contiguous data as a container of OrderedPairs; note that it does not own...
void testContainer(const OrderedPairContainerRef &pairs)