prod.hpp 737 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // Copyright (c) 2018 Stefan Seefeld
  3. // All rights reserved.
  4. //
  5. // This file is part of Boost.uBLAS. It is made available under the
  6. // Boost Software License, Version 1.0.
  7. // (Consult LICENSE or http://www.boost.org/LICENSE_1_0.txt)
  8. #include "init.hpp"
  9. #include "benchmark.hpp"
  10. namespace boost { namespace numeric { namespace ublas { namespace benchmark {
  11. template <typename S> class prod;
  12. template <typename R, typename O1, typename O2>
  13. class prod<R(O1, O2)> : public benchmark
  14. {
  15. public:
  16. prod(std::string const &name) : benchmark(name) {}
  17. virtual void setup(long l)
  18. {
  19. init(a, l, 200);
  20. init(b, l, 200);
  21. }
  22. virtual void operation(long l)
  23. {
  24. c = ublas::prod(a, b);
  25. }
  26. private:
  27. O1 a;
  28. O2 b;
  29. R c;
  30. };
  31. }}}}