C-XSC - A C++ Class Library for Extended Scientific Computing  2.5.4
cxsc_blas.hpp
1 /*
2 ** CXSC is a C++ library for eXtended Scientific Computing (V 2.5.4)
3 **
4 ** Copyright (C) 1990-2000 Institut fuer Angewandte Mathematik,
5 ** Universitaet Karlsruhe, Germany
6 ** (C) 2000-2014 Wiss. Rechnen/Softwaretechnologie
7 ** Universitaet Wuppertal, Germany
8 **
9 ** This library is free software; you can redistribute it and/or
10 ** modify it under the terms of the GNU Library General Public
11 ** License as published by the Free Software Foundation; either
12 ** version 2 of the License, or (at your option) any later version.
13 **
14 ** This library is distributed in the hope that it will be useful,
15 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 ** Library General Public License for more details.
18 **
19 ** You should have received a copy of the GNU Library General Public
20 ** License along with this library; if not, write to the Free
21 ** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23 
24 /* CVS $Id: cxsc_blas.hpp,v 1.11 2014/01/30 17:23:44 cxsc Exp $ */
25 
26 /*
27 ** FastPLSS: A library of (parallel) verified linear (interval) system
28 ** solvers using C-XSC (V 0.2)
29 **
30 ** Author: Michael Zimmer
31 **
32 ** This software is based on:
33 ** - Module LinSys of the C-XSC-Toolbox
34 ** Authors: Rolf Hammer, Matthias Hocks, Dietmar Ratz
35 ** - Self-verifying solver for a dense system of linear equations
36 ** Authors: Carlos Holbig, Walter Kraemer, Paulo Sergio Morandi Junior,
37 ** Bernardo Frederes Kramer Alcalde,
38 */
39 
40 
41 #ifndef _CXSC_BLAS_HEADER_INCLUDED
42 #define _CXSC_BLAS_HEADER_INCLUDED
43 
44 namespace cxsc {
45 
46 enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};
47 enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113};
48 enum CBLAS_UPLO {CblasUpper=121, CblasLower=122};
49 enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132};
50 enum CBLAS_SIDE {CblasLeft=141, CblasRight=142};
51 
52 //Declaration of BLAS-routines
53 extern "C" {
54  double cblas_ddot(const int N, const double *X, const int incX,
55  const double *Y, const int incY);
56 
57  void cblas_zdotu_sub(const int N, const void *X, const int incX,
58  const void *Y, const int incY, void *dotu);
59 
60  void cblas_daxpy(const int N, const double alpha, const double *X,
61  const int incX, double *Y, const int incY);
62 
63  void cblas_zaxpy(const int N, const double alpha, const double *X,
64  const int incX, double *Y, const int incY);
65 
66  void cblas_dgemv(const enum CBLAS_ORDER order,
67  const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
68  const double alpha, const double *A, const int lda,
69  const double *X, const int incX, const double beta,
70  double *Y, const int incY);
71 
72  void cblas_zgemv(const enum CBLAS_ORDER order,
73  const enum CBLAS_TRANSPOSE TransA, const int M, const int N,
74  const void *alpha, const void *A, const int lda,
75  const void *X, const int incX, const void *beta,
76  void *Y, const int incY);
77 
78  void cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
79  const enum CBLAS_TRANSPOSE TransB, const int M, const int N,
80  const int K, const double alpha, const double *A,
81  const int lda, const double *B, const int ldb,
82  const double beta, double *C, const int ldc);
83 
84  void cblas_zgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA,
85  const enum CBLAS_TRANSPOSE TransB, const int M, const int N,
86  const int K, const void *alpha, const void *A,
87  const int lda, const void *B, const int ldb,
88  const void *beta, void *C, const int ldc);
89 
90 }
91 
92 inline void blasdot(const rvector& x, const rvector& y, real& res);
93 
94 inline void blasdot(const rvector& x, const rvector& y, interval& res);
95 
96 inline void blasdot(const rvector& x, const cvector& y, complex& res);
97 
98 inline void blasdot(const cvector& x, const rvector& y, complex& res);
99 
100 inline void blasdot(const rvector& x, const cvector& y, cinterval& res);
101 
102 inline void blasdot(const cvector& x, const rvector& y, cinterval& res);
103 
104 inline void blasdot(const cvector& x, const cvector& y, complex& res);
105 
106 inline void blasdot(const cvector& x, const cvector& y, cinterval& res);
107 
108 inline void bsort(const ivector &x, const ivector &y, rvector& x_inf, rvector& y_inf, rvector &x_sup, rvector &y_sup, int n, int lb1, int lb2);
109 
110 //Sorts inf and sup of an interval vector and a real vector into two real vector for the computation of the infimum
111 //and two real vectors for the computation of the supremum. Rounding mode must be set to upwards!
112 inline void bsort(const ivector &x, const rvector &y, rvector& x_inf, rvector& y_inf, rvector &x_sup, rvector &y_sup, int n, int lb1, int lb2);
113 
114 //Sorts inf and sup of an interval vector and a real vector into two real vector for the computation of the infimum
115 //and two real vectors for the computation of the supremum. Rounding mode must be set to upwards!
116 inline void bsort(const rvector &y, const ivector &x, rvector& x_inf, rvector& y_inf, rvector &x_sup, rvector &y_sup, int n, int lb1, int lb2);
117 
118 inline void blasdot(const ivector& x, const ivector& y, interval& res);
119 
120 inline void blasdot(const ivector& x, const rvector& y, interval& res);
121 
122 inline void blasdot(const rvector& x, const ivector& y, interval& res);
123 
124 inline void blasdot(const rvector& x, const civector& y, cinterval& res);
125 
126 inline void blasdot(const civector& x, const rvector& y, cinterval& res);
127 
128 inline void blasdot(const cvector& x, const ivector& y, cinterval& res);
129 
130 inline void blasdot(const ivector& x, const cvector& y, cinterval& res);
131 
132 inline void blasdot(const civector& x, const civector& y, cinterval& res);
133 
134 inline void blasdot(const civector& x, const cvector& y, cinterval& res);
135 
136 inline void blasdot(const cvector& x, const civector& y, cinterval& res);
137 
138 inline void blasdot(const civector& x, const ivector& y, cinterval& res);
139 
140 inline void blasdot(const ivector& x, const civector& y, cinterval& res);
141 
142 /***************************************************************************/
143 
144 inline void blasmvmul(const rmatrix& A, const rvector& x, rvector& r);
145 
146 inline void blasmvmul(const rmatrix& A, const rvector& x, ivector& r);
147 
148 inline void blasmvmul(const rmatrix& A, const ivector& x, ivector& r);
149 
150 inline void blasmvmul(const imatrix& A, const rvector& x, ivector& r);
151 
152 inline void blasmvmul(const imatrix& A, const ivector& x, ivector& r);
153 
154 inline void blasmvmul(const cmatrix& A, const ivector& x, civector& r);
155 
156 inline void blasmvmul(const imatrix& A, const cvector& x, civector& r);
157 
158 inline void blasmvmul(const rmatrix& A, const civector& x, civector& r);
159 
160 inline void blasmvmul(const cimatrix& A, const rvector& x, civector& r);
161 
162 inline void blasmvmul(const cmatrix& A, const civector& x, civector& r);
163 
164 inline void blasmvmul(const cimatrix& A, const cvector& x, civector& r);
165 
166 inline void blasmvmul(const imatrix& A, const civector& x, civector& r);
167 
168 inline void blasmvmul(const cimatrix& A, const ivector& x, civector& r);
169 
170 inline void blasmvmul(const cimatrix& A, const civector& x, civector& r);
171 
172 inline void blasmvmul(const cmatrix& A, const cvector& x, cvector& r);
173 
174 inline void blasmvmul(const cmatrix& A, const cvector& x, civector& r);
175 
176 inline void blasmvmul(const rmatrix& A, const cvector& x, cvector& r);
177 
178 inline void blasmvmul(const cmatrix& A, const rvector& x, cvector& r);
179 
180 inline void blasmvmul(const rmatrix& A, const cvector& x, civector& r);
181 
182 inline void blasmvmul(const cmatrix& A, const rvector& x, civector& r);
183 
184 /***************************************************************************/
185 
186 inline void blasmatmul(const rmatrix &A, const rmatrix &B, imatrix &C);
187 
188 inline void blasmatmul(const rmatrix &A, const rmatrix &B, rmatrix &C);
189 
190 inline void blasmatmul(const imatrix &A, const imatrix &B, imatrix &C);
191 
192 inline void blasmatmul(const rmatrix &A, const imatrix &B, imatrix &C);
193 
194 inline void blasmatmul(const imatrix &A, const rmatrix &B, imatrix &C);
195 
196 inline void blasmatmul(const cmatrix &A, const cmatrix &B, cmatrix &C);
197 
198 inline void blasmatmul(const cmatrix &A, const cmatrix &B, cimatrix &C);
199 
200 inline void blasmatmul(const cmatrix &A, const rmatrix &B, cmatrix &C);
201 
202 inline void blasmatmul(const rmatrix &A, const cmatrix &B, cmatrix &C);
203 
204 inline void blasmatmul(const cmatrix &A, const rmatrix &B, cimatrix &C);
205 
206 inline void blasmatmul(const rmatrix &A, const cmatrix &B, cimatrix &C);
207 
208 inline void blasmatmul(const cmatrix &A, const imatrix &B, cimatrix &C);
209 
210 inline void blasmatmul(const imatrix &A, const cmatrix &B, cimatrix &C);
211 
212 inline void blasmatmul(const rmatrix &A, const cimatrix &B, cimatrix &C);
213 
214 inline void blasmatmul(const cimatrix &A, const rmatrix &B, cimatrix &C);
215 
216 inline void blasmatmul(const imatrix &A, const cimatrix &B, cimatrix &C);
217 
218 inline void blasmatmul(const cimatrix &A, const imatrix &B, cimatrix &C);
219 
220 inline void blasmatmul(const cimatrix &A, const cmatrix &B, cimatrix &C);
221 
222 inline void blasmatmul(const cmatrix &A, const cimatrix &B, cimatrix &C);
223 
224 inline void blasmatmul(const cimatrix &A, const cimatrix &B, cimatrix &C);
225 
226 }
227 
228 #endif
cxsc
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition: cdot.cpp:29