ALPSCore reference
Main Page
Related Pages
Classes
Files
File List
File Members
alps
type_traits
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
12
#include <
alps/type_traits/average_type.hpp
>
13
#include <
alps/type_traits/element_type.hpp
>
14
#include <
alps/type_traits/is_sequence.hpp
>
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>
31
struct
covariance_type
32
{
33
typedef
typename
std::conditional<
34
is_sequence<T>::value
,
35
detail::matrix_covariance_type<
36
typename
average_type<typename element_type<T>::type
>
::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
alps::average_type
Definition:
average_type.hpp:21
alps::is_sequence
Definition:
is_sequence.hpp:24
average_type.hpp
alps::covariance_type
Definition:
covariance_type.hpp:31
is_sequence.hpp
alps::covariance_type::type
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
Definition:
covariance_type.hpp:39
element_type.hpp
alps
Definition:
boost_array_functions.hpp:24
Generated on Sun Oct 14 2018 12:18:30 for ALPSCore reference by
1.8.11