is_identity.hpp 1.05 KB
Newer Older
1
// Software License for MTL
2
3
//
// Copyright (c) 2007 The Trustees of Indiana University.
4
//               2008 Dresden University of Technology and the Trustees of Indiana University.
5
//               2010 SimuNova UG (haftungsbeschränkt), www.simunova.com.
6
7
// All rights reserved.
// Authors: Peter Gottschling and Andrew Lumsdaine
8
//
9
// This file is part of the Matrix Template Library
10
//
11
12
13
14
15
16
17
18
19
20
21
// See also license.mtl.txt in the distribution.

#ifndef ITL_PC_IS_IDENTITY_INCLUDE
#define ITL_PC_IS_IDENTITY_INCLUDE

#include <boost/mpl/bool.hpp>
#include <boost/numeric/itl/itl_fwd.hpp>

namespace itl { namespace pc {

template <typename PC>
22
bool is_identity(const PC&)
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{ return false; }

template <typename Matrix, typename Value>
bool is_identity(const itl::pc::identity<Matrix, Value>&)
{ return true; }

template <typename PC>
struct static_is_identity
  : boost::mpl::false_
{};

template <typename Matrix, typename Value>
struct static_is_identity<itl::pc::identity<Matrix, Value> >
  : boost::mpl::true_
{};

}} // namespace itl::pc

#endif // ITL_PC_IS_IDENTITY_INCLUDE