1 /*
2  *   Copyright (c) 2012, 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 CXXLAPACK_INTERFACE_LANTR_TCC
34 #define CXXLAPACK_INTERFACE_LANTR_TCC 1
35 
36 #include <iostream>
37 #include "xflens/cxxlapack/interface/interface.h"
38 #include "xflens/cxxlapack/netlib/netlib.h"
39 
40 namespace cxxlapack {
41 
42 template <typename IndexType>
43 float
lantr(char norm,char upLo,char diag,IndexType m,IndexType n,const float * A,IndexType ldA,float * work)44 lantr(char              norm,
45       char              upLo,
46       char              diag,
47       IndexType         m,
48       IndexType         n,
49       const float       *A,
50       IndexType         ldA,
51       float             *work)
52 {
53     CXXLAPACK_DEBUG_OUT("slantr");
54 
55     return LAPACK_IMPL(slantr)(&norm,
56                                &upLo,
57                                &diag,
58                                &m,
59                                &n,
60                                A,
61                                &ldA,
62                                work);
63 }
64 
65 
66 template <typename IndexType>
67 double
lantr(char norm,char upLo,char diag,IndexType m,IndexType n,const double * A,IndexType ldA,double * work)68 lantr(char              norm,
69       char              upLo,
70       char              diag,
71       IndexType         m,
72       IndexType         n,
73       const double      *A,
74       IndexType         ldA,
75       double            *work)
76 {
77     CXXLAPACK_DEBUG_OUT("dlantr");
78 
79     return LAPACK_IMPL(dlantr)(&norm,
80                                &upLo,
81                                &diag,
82                                &m,
83                                &n,
84                                A,
85                                &ldA,
86                                work);
87 }
88 
89 template <typename IndexType>
90 float
lantr(char norm,char upLo,char diag,IndexType m,IndexType n,const std::complex<float> * A,IndexType ldA,float * work)91 lantr(char                          norm,
92       char                          upLo,
93       char                          diag,
94       IndexType                     m,
95       IndexType                     n,
96       const std::complex<float >    *A,
97       IndexType                     ldA,
98       float                         *work)
99 {
100     CXXLAPACK_DEBUG_OUT("clantr");
101 
102     return LAPACK_IMPL(clantr)(&norm,
103                                &upLo,
104                                &diag,
105                                &m,
106                                &n,
107                                reinterpret_cast<const float  *>(A),
108                                &ldA,
109                                work);
110 }
111 
112 template <typename IndexType>
113 double
lantr(char norm,char upLo,char diag,IndexType m,IndexType n,const std::complex<double> * A,IndexType ldA,double * work)114 lantr(char                          norm,
115       char                          upLo,
116       char                          diag,
117       IndexType                     m,
118       IndexType                     n,
119       const std::complex<double>    *A,
120       IndexType                     ldA,
121       double                        *work)
122 {
123     CXXLAPACK_DEBUG_OUT("zlantr");
124 
125     return LAPACK_IMPL(zlantr)(&norm,
126                                &upLo,
127                                &diag,
128                                &m,
129                                &n,
130                                reinterpret_cast<const double *>(A),
131                                &ldA,
132                                work);
133 }
134 
135 } // namespace cxxlapack
136 
137 #endif // CXXLAPACK_INTERFACE_LANTR_TCC
138