ALPSCore reference
covariance_type.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 
7 /* $Id: obsvalue.h 3435 2009-11-28 14:45:38Z troyer $ */
8 
9 #ifndef ALPS_TYPE_TRAITS_COVARIANCE_TYPE_H
10 #define ALPS_TYPE_TRAITS_COVARIANCE_TYPE_H
11 
15 
16 #include <type_traits>
17 
18 namespace alps {
19 
20  namespace detail {
21  template <typename T>
22  struct matrix_covariance_type {
23  matrix_covariance_type() {
24  throw std::logic_error("Matrix covariance type is not implemented."
25  " Use ALEA if you need covariance between vectors!");
26  }
27  };
28  }
29 
30 template <class T>
32 {
33  typedef typename std::conditional<
35  detail::matrix_covariance_type<
37  >,
38  typename average_type<T>::type
39  >::type type;
40 };
41 
42 
43 } // end namespace alps
44 
45 #endif // ALPS_TYPE_TRAITS_COVARIANCE_TYPE_H
std::conditional< is_sequence< T >::value, detail::matrix_covariance_type< typename average_type< typename element_type< T >::type >::type >, typename average_type< T >::type >::type type