1 /*
2 * Copyright (c) 2009, Michael Lehn
3 *
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1) Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2) Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3) Neither the name of the FLENS development group nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 #ifndef FLENS_DEBUG_AUX_TYPEID_TCC
34 #define FLENS_DEBUG_AUX_TYPEID_TCC 1
35
36 #include <flens/matrixtypes/matrixtypes.h>
37 #include <flens/vectortypes/vectortypes.h>
38
39 namespace flens { namespace verbose {
40
41 template <typename T>
42 std::string
43 typeId(const T &)
44 {
45 if (IsScalar<T>::value) {
46 return "Scalar";
47 }
48 return "unknown";
49 }
50
51 template <typename T>
52 std::string
53 typeId(const ScalarValue<T> &)
54 {
55 return "Scalar";
56 }
57
58 template <typename I>
59 std::string
60 typeId(const Matrix<I> &)
61 {
62 return "Matrix";
63 }
64
65 template <typename FS>
66 std::string
67 typeId(const GeMatrix<FS> &)
68 {
69 return "GeMatrix";
70 }
71
72 template <typename FS>
73 std::string
74 typeId(const TrMatrix<FS> &)
75 {
76 return "TrMatrix";
77 }
78
79 template <typename I>
80 std::string
81 typeId(const Vector<I> &)
82 {
83 return "Vector";
84 }
85
86 template <typename A>
87 std::string
88 typeId(const DenseVector<A> &)
89 {
90 return "DenseVector";
91 }
92
93 } } // namespace verbose, namespace flens
94
95 #endif // FLENS_DEBUG_AUX_TYPEID_TCC
2 * Copyright (c) 2009, Michael Lehn
3 *
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1) Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2) Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in
14 * the documentation and/or other materials provided with the
15 * distribution.
16 * 3) Neither the name of the FLENS development group nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 #ifndef FLENS_DEBUG_AUX_TYPEID_TCC
34 #define FLENS_DEBUG_AUX_TYPEID_TCC 1
35
36 #include <flens/matrixtypes/matrixtypes.h>
37 #include <flens/vectortypes/vectortypes.h>
38
39 namespace flens { namespace verbose {
40
41 template <typename T>
42 std::string
43 typeId(const T &)
44 {
45 if (IsScalar<T>::value) {
46 return "Scalar";
47 }
48 return "unknown";
49 }
50
51 template <typename T>
52 std::string
53 typeId(const ScalarValue<T> &)
54 {
55 return "Scalar";
56 }
57
58 template <typename I>
59 std::string
60 typeId(const Matrix<I> &)
61 {
62 return "Matrix";
63 }
64
65 template <typename FS>
66 std::string
67 typeId(const GeMatrix<FS> &)
68 {
69 return "GeMatrix";
70 }
71
72 template <typename FS>
73 std::string
74 typeId(const TrMatrix<FS> &)
75 {
76 return "TrMatrix";
77 }
78
79 template <typename I>
80 std::string
81 typeId(const Vector<I> &)
82 {
83 return "Vector";
84 }
85
86 template <typename A>
87 std::string
88 typeId(const DenseVector<A> &)
89 {
90 return "DenseVector";
91 }
92
93 } } // namespace verbose, namespace flens
94
95 #endif // FLENS_DEBUG_AUX_TYPEID_TCC