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
44namespace cxsc {
45
46enum CBLAS_ORDER {CblasRowMajor=101, CblasColMajor=102};
47enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113};
48enum CBLAS_UPLO {CblasUpper=121, CblasLower=122};
49enum CBLAS_DIAG {CblasNonUnit=131, CblasUnit=132};
50enum CBLAS_SIDE {CblasLeft=141, CblasRight=142};
51
52//Declaration of BLAS-routines
53extern "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
92inline void blasdot(const rvector& x, const rvector& y, real& res);
93
94inline void blasdot(const rvector& x, const rvector& y, interval& res);
95
96inline void blasdot(const rvector& x, const cvector& y, complex& res);
97
98inline void blasdot(const cvector& x, const rvector& y, complex& res);
99
100inline void blasdot(const rvector& x, const cvector& y, cinterval& res);
101
102inline void blasdot(const cvector& x, const rvector& y, cinterval& res);
103
104inline void blasdot(const cvector& x, const cvector& y, complex& res);
105
106inline void blasdot(const cvector& x, const cvector& y, cinterval& res);
107
108inline 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!
112inline 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!
116inline 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
118inline void blasdot(const ivector& x, const ivector& y, interval& res);
119
120inline void blasdot(const ivector& x, const rvector& y, interval& res);
121
122inline void blasdot(const rvector& x, const ivector& y, interval& res);
123
124inline void blasdot(const rvector& x, const civector& y, cinterval& res);
125
126inline void blasdot(const civector& x, const rvector& y, cinterval& res);
127
128inline void blasdot(const cvector& x, const ivector& y, cinterval& res);
129
130inline void blasdot(const ivector& x, const cvector& y, cinterval& res);
131
132inline void blasdot(const civector& x, const civector& y, cinterval& res);
133
134inline void blasdot(const civector& x, const cvector& y, cinterval& res);
135
136inline void blasdot(const cvector& x, const civector& y, cinterval& res);
137
138inline void blasdot(const civector& x, const ivector& y, cinterval& res);
139
140inline void blasdot(const ivector& x, const civector& y, cinterval& res);
141
142/***************************************************************************/
143
144inline void blasmvmul(const rmatrix& A, const rvector& x, rvector& r);
145
146inline void blasmvmul(const rmatrix& A, const rvector& x, ivector& r);
147
148inline void blasmvmul(const rmatrix& A, const ivector& x, ivector& r);
149
150inline void blasmvmul(const imatrix& A, const rvector& x, ivector& r);
151
152inline void blasmvmul(const imatrix& A, const ivector& x, ivector& r);
153
154inline void blasmvmul(const cmatrix& A, const ivector& x, civector& r);
155
156inline void blasmvmul(const imatrix& A, const cvector& x, civector& r);
157
158inline void blasmvmul(const rmatrix& A, const civector& x, civector& r);
159
160inline void blasmvmul(const cimatrix& A, const rvector& x, civector& r);
161
162inline void blasmvmul(const cmatrix& A, const civector& x, civector& r);
163
164inline void blasmvmul(const cimatrix& A, const cvector& x, civector& r);
165
166inline void blasmvmul(const imatrix& A, const civector& x, civector& r);
167
168inline void blasmvmul(const cimatrix& A, const ivector& x, civector& r);
169
170inline void blasmvmul(const cimatrix& A, const civector& x, civector& r);
171
172inline void blasmvmul(const cmatrix& A, const cvector& x, cvector& r);
173
174inline void blasmvmul(const cmatrix& A, const cvector& x, civector& r);
175
176inline void blasmvmul(const rmatrix& A, const cvector& x, cvector& r);
177
178inline void blasmvmul(const cmatrix& A, const rvector& x, cvector& r);
179
180inline void blasmvmul(const rmatrix& A, const cvector& x, civector& r);
181
182inline void blasmvmul(const cmatrix& A, const rvector& x, civector& r);
183
184/***************************************************************************/
185
186inline void blasmatmul(const rmatrix &A, const rmatrix &B, imatrix &C);
187
188inline void blasmatmul(const rmatrix &A, const rmatrix &B, rmatrix &C);
189
190inline void blasmatmul(const imatrix &A, const imatrix &B, imatrix &C);
191
192inline void blasmatmul(const rmatrix &A, const imatrix &B, imatrix &C);
193
194inline void blasmatmul(const imatrix &A, const rmatrix &B, imatrix &C);
195
196inline void blasmatmul(const cmatrix &A, const cmatrix &B, cmatrix &C);
197
198inline void blasmatmul(const cmatrix &A, const cmatrix &B, cimatrix &C);
199
200inline void blasmatmul(const cmatrix &A, const rmatrix &B, cmatrix &C);
201
202inline void blasmatmul(const rmatrix &A, const cmatrix &B, cmatrix &C);
203
204inline void blasmatmul(const cmatrix &A, const rmatrix &B, cimatrix &C);
205
206inline void blasmatmul(const rmatrix &A, const cmatrix &B, cimatrix &C);
207
208inline void blasmatmul(const cmatrix &A, const imatrix &B, cimatrix &C);
209
210inline void blasmatmul(const imatrix &A, const cmatrix &B, cimatrix &C);
211
212inline void blasmatmul(const rmatrix &A, const cimatrix &B, cimatrix &C);
213
214inline void blasmatmul(const cimatrix &A, const rmatrix &B, cimatrix &C);
215
216inline void blasmatmul(const imatrix &A, const cimatrix &B, cimatrix &C);
217
218inline void blasmatmul(const cimatrix &A, const imatrix &B, cimatrix &C);
219
220inline void blasmatmul(const cimatrix &A, const cmatrix &B, cimatrix &C);
221
222inline void blasmatmul(const cmatrix &A, const cimatrix &B, cimatrix &C);
223
224inline void blasmatmul(const cimatrix &A, const cimatrix &B, cimatrix &C);
225
226}
227
228#endif
The namespace cxsc, providing all functionality of the class library C-XSC.
Definition cdot.cpp:29