Hammer  1.0.0
Helicity Amplitude Module for Matrix Element Reweighting
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Optimize.hh
Go to the documentation of this file.
1 ///
2 /// @file Optimize.hh
3 /// @brief Tensor storage re-optimization algorithm
4 ///
5 
6 //**** This file is a part of the HAMMER library
7 //**** Copyright (C) 2016 - 2020 The HAMMER Collaboration
8 //**** HAMMER is licensed under version 3 of the GPL; see COPYING for details
9 //**** Please note the MCnet academic guidelines; see GUIDELINES for details
10 
11 // -*- C++ -*-
12 #ifndef HAMMER_MATH_MULTIDIM_OPS_OPTIMIZE
13 #define HAMMER_MATH_MULTIDIM_OPS_OPTIMIZE
14 
16 
17 #include <complex>
18 
19 namespace Hammer {
20 
21 
22  namespace MultiDimensional {
23 
24  class IContainer;
25  class VectorContainer;
26  class SparseContainer;
27  class OuterContainer;
28 
29  namespace Ops {
30 
31  class Optimize final {
32  public:
33  Optimize();
34 
38 
40 
41  };
42 
43  inline bool shouldBeSparse(size_t fill, size_t total) {
44  return (fill * (sizeof(std::complex<double>) + sizeof(PositionType)) < total * sizeof(std::complex<double>));
45  }
46 
47 
48  } // namespace Ops
49 
50  } // namespace MultiDimensional
51 
52 } // namespace Hammer
53 
54 
55 #endif
size_t PositionType
Forward declarations of types used in the tensor classes.
IContainer * error(IContainer &)
Definition: Optimize.cc:80
bool shouldBeSparse(size_t fill, size_t total)
Definition: Optimize.hh:43
IContainer * operator()(VectorContainer &first)
Definition: Optimize.cc:45