• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
9 #include "init.hpp"
10 #include "benchmark.hpp"
11 
12 namespace boost { namespace numeric { namespace ublas { namespace benchmark {
13 
14 template <typename S> class add;
15 
16 template <typename R, typename O1, typename O2>
17 class add<R(O1, O2)> : public benchmark
18 {
19 public:
add(std::string const & name)20   add(std::string const &name) : benchmark(name) {}
setup(long l)21   virtual void setup(long l)
22   {
23     init(a, l, 200);
24     init(b, l, 200);
25   }
operation(long l)26   virtual void operation(long l)
27   {
28     c = a + b;
29   }
30 private:
31   O1 a;
32   O2 b;
33   R c;
34 };
35 
36 }}}}
37