All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
test_vectorAccess< Vector const > Struct Template Reference

Public Member Functions

 test_vectorAccess ()
 

Detailed Description

template<typename Vector>
struct test_vectorAccess< Vector const >

Definition at line 611 of file geo_vectors_utils_test.cc.

Constructor & Destructor Documentation

template<typename Vector >
test_vectorAccess< Vector const >::test_vectorAccess ( )
inline

Definition at line 613 of file geo_vectors_utils_test.cc.

613  {
614 
615  // BUG the double brace syntax is required to work around clang bug 21629
616  // (https://bugs.llvm.org/show_bug.cgi?id=21629)
617  std::array<double, 3U> const coords = {{ 1.0, 5.0, 9.0 }};
618  Vector const v{ coords[0], coords[1], coords[2] };
619 
620  unsigned int iCoord = 0;
621  for(auto coordMan: geo::vect::coordReaders<Vector>()) {
622  auto const expected = coords[iCoord++];
623  auto mc = geo::vect::bindCoord(v, coordMan);
624  BOOST_TEST(mc() == expected);
625  BOOST_TEST(mc == expected);
626  } // for
627  BOOST_TEST(iCoord == 3U);
628 
629  auto x = geo::vect::Xcoord(v);
630  auto c0 = geo::vect::coord(v, 0U);
631  auto mx = geo::vect::bindCoord(v, geo::vect::XcoordManager<Vector>);
632  auto mc0 = geo::vect::bindCoord(v, geo::vect::coordManager<Vector>(0U));
633  BOOST_TEST(x() == 1.0);
634  BOOST_TEST(x == 1.0);
635  BOOST_TEST(x() == v.X());
636  BOOST_TEST(c0() == v.X());
637  BOOST_TEST(mx() == 1.0);
638  BOOST_TEST(mx == 1.0);
639  BOOST_TEST(mx() == v.X());
640  BOOST_TEST(mc0() == v.X());
641 
642  auto y = geo::vect::Ycoord(v);
643  auto c1 = geo::vect::coord(v, 1U);
644  auto my = geo::vect::bindCoord(v, geo::vect::YcoordManager<Vector>);
645  auto mc1 = geo::vect::bindCoord(v, geo::vect::coordManager<Vector>(1U));
646  BOOST_TEST(y() == 5.0);
647  BOOST_TEST(y == 5.0);
648  BOOST_TEST(y() == v.Y());
649  BOOST_TEST(c1() == v.Y());
650  BOOST_TEST(my() == 5.0);
651  BOOST_TEST(my == 5.0);
652  BOOST_TEST(my() == v.Y());
653  BOOST_TEST(mc1() == v.Y());
654 
655 
656  auto z = geo::vect::Zcoord(v);
657  auto c2 = geo::vect::coord(v, 2U);
658  auto mz = geo::vect::bindCoord(v, geo::vect::ZcoordManager<Vector>);
659  auto mc2 = geo::vect::bindCoord(v, geo::vect::coordManager<Vector>(2U));
660  BOOST_TEST(z() == 9.0);
661  BOOST_TEST(z == 9.0);
662  BOOST_TEST(z() == v.Z());
663  BOOST_TEST(c2() == v.Z());
664  BOOST_TEST(mz() == 9.0);
665  BOOST_TEST(mz == 9.0);
666  BOOST_TEST(mz() == v.Z());
667  BOOST_TEST(mc2() == v.Z());
668 
669  } // test_vectorAccess()
process_name opflash particleana ie ie ie z
auto Zcoord(Vector &v)
Returns an object to manage the coordinate Z of the vector v.
process_name opflash particleana ie x
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
constexpr auto bindCoord(Vector const &v, CoordReader_t< Vector > helper)
Binds the specified constant vector to the coordinate reader.
my($xml, $fcl, $workdir, $check, $merge)
process_name opflash particleana ie ie y
auto Ycoord(Vector &v)
Returns an object to manage the coordinate Y of the vector v.
auto Xcoord(Vector &v)
Returns an object to manage the coordinate X of the vector v.

The documentation for this struct was generated from the following file: