3 * Copyright (C) 1996, 1997, 1998, 1999, 2000 Gerard Jungman
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #ifndef __GSL_BLAS_H__
24 #define __GSL_BLAS_H__
26 #include <gsl/gsl_vector.h>
27 #include <gsl/gsl_matrix.h>
29 #include <gsl/gsl_blas_types.h>
35 # define __BEGIN_DECLS extern "C" {
36 # define __END_DECLS }
38 # define __BEGIN_DECLS /* empty */
39 # define __END_DECLS /* empty */
45 /* ========================================================================
47 * ========================================================================
50 int gsl_blas_sdsdot (float alpha,
51 const gsl_vector_float * X,
52 const gsl_vector_float * Y,
56 int gsl_blas_dsdot (const gsl_vector_float * X,
57 const gsl_vector_float * Y,
61 int gsl_blas_sdot (const gsl_vector_float * X,
62 const gsl_vector_float * Y,
66 int gsl_blas_ddot (const gsl_vector * X,
72 int gsl_blas_cdotu (const gsl_vector_complex_float * X,
73 const gsl_vector_complex_float * Y,
74 gsl_complex_float * dotu);
76 int gsl_blas_cdotc (const gsl_vector_complex_float * X,
77 const gsl_vector_complex_float * Y,
78 gsl_complex_float * dotc);
80 int gsl_blas_zdotu (const gsl_vector_complex * X,
81 const gsl_vector_complex * Y,
84 int gsl_blas_zdotc (const gsl_vector_complex * X,
85 const gsl_vector_complex * Y,
89 float gsl_blas_snrm2 (const gsl_vector_float * X);
90 float gsl_blas_sasum (const gsl_vector_float * X);
91 double gsl_blas_dnrm2 (const gsl_vector * X);
92 double gsl_blas_dasum (const gsl_vector * X);
93 float gsl_blas_scnrm2 (const gsl_vector_complex_float * X);
94 float gsl_blas_scasum (const gsl_vector_complex_float * X);
95 double gsl_blas_dznrm2 (const gsl_vector_complex * X);
96 double gsl_blas_dzasum (const gsl_vector_complex * X);
99 CBLAS_INDEX_t gsl_blas_isamax (const gsl_vector_float * X);
100 CBLAS_INDEX_t gsl_blas_idamax (const gsl_vector * X);
101 CBLAS_INDEX_t gsl_blas_icamax (const gsl_vector_complex_float * X);
102 CBLAS_INDEX_t gsl_blas_izamax (const gsl_vector_complex * X);
105 int gsl_blas_sswap (gsl_vector_float * X,
106 gsl_vector_float * Y);
108 int gsl_blas_scopy (const gsl_vector_float * X,
109 gsl_vector_float * Y);
111 int gsl_blas_saxpy (float alpha,
112 const gsl_vector_float * X,
113 gsl_vector_float * Y);
115 int gsl_blas_dswap (gsl_vector * X,
118 int gsl_blas_dcopy (const gsl_vector * X,
121 int gsl_blas_daxpy (double alpha,
122 const gsl_vector * X,
125 int gsl_blas_cswap (gsl_vector_complex_float * X,
126 gsl_vector_complex_float * Y);
128 int gsl_blas_ccopy (const gsl_vector_complex_float * X,
129 gsl_vector_complex_float * Y);
131 int gsl_blas_caxpy (const gsl_complex_float alpha,
132 const gsl_vector_complex_float * X,
133 gsl_vector_complex_float * Y);
135 int gsl_blas_zswap (gsl_vector_complex * X,
136 gsl_vector_complex * Y);
138 int gsl_blas_zcopy (const gsl_vector_complex * X,
139 gsl_vector_complex * Y);
141 int gsl_blas_zaxpy (const gsl_complex alpha,
142 const gsl_vector_complex * X,
143 gsl_vector_complex * Y);
146 int gsl_blas_srotg (float a[], float b[], float c[], float s[]);
148 int gsl_blas_srotmg (float d1[], float d2[], float b1[], float b2, float P[]);
150 int gsl_blas_srot (gsl_vector_float * X,
151 gsl_vector_float * Y,
154 int gsl_blas_srotm (gsl_vector_float * X,
155 gsl_vector_float * Y,
158 int gsl_blas_drotg (double a[], double b[], double c[], double s[]);
160 int gsl_blas_drotmg (double d1[], double d2[], double b1[],
161 double b2, double P[]);
163 int gsl_blas_drot (gsl_vector * X,
165 const double c, const double s);
167 int gsl_blas_drotm (gsl_vector * X,
172 void gsl_blas_sscal (float alpha, gsl_vector_float * X);
173 void gsl_blas_dscal (double alpha, gsl_vector * X);
174 void gsl_blas_cscal (const gsl_complex_float alpha, gsl_vector_complex_float * X);
175 void gsl_blas_zscal (const gsl_complex alpha, gsl_vector_complex * X);
176 void gsl_blas_csscal (float alpha, gsl_vector_complex_float * X);
177 void gsl_blas_zdscal (double alpha, gsl_vector_complex * X);
180 /* ===========================================================================
182 * ===========================================================================
186 * Routines with standard 4 prefixes (S, D, C, Z)
188 int gsl_blas_sgemv (CBLAS_TRANSPOSE_t TransA,
190 const gsl_matrix_float * A,
191 const gsl_vector_float * X,
193 gsl_vector_float * Y);
195 int gsl_blas_strmv (CBLAS_UPLO_t Uplo,
196 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
197 const gsl_matrix_float * A,
198 gsl_vector_float * X);
200 int gsl_blas_strsv (CBLAS_UPLO_t Uplo,
201 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
202 const gsl_matrix_float * A,
203 gsl_vector_float * X);
205 int gsl_blas_dgemv (CBLAS_TRANSPOSE_t TransA,
207 const gsl_matrix * A,
208 const gsl_vector * X,
212 int gsl_blas_dtrmv (CBLAS_UPLO_t Uplo,
213 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
214 const gsl_matrix * A,
217 int gsl_blas_dtrsv (CBLAS_UPLO_t Uplo,
218 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
219 const gsl_matrix * A,
222 int gsl_blas_cgemv (CBLAS_TRANSPOSE_t TransA,
223 const gsl_complex_float alpha,
224 const gsl_matrix_complex_float * A,
225 const gsl_vector_complex_float * X,
226 const gsl_complex_float beta,
227 gsl_vector_complex_float * Y);
229 int gsl_blas_ctrmv (CBLAS_UPLO_t Uplo,
230 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
231 const gsl_matrix_complex_float * A,
232 gsl_vector_complex_float * X);
234 int gsl_blas_ctrsv (CBLAS_UPLO_t Uplo,
235 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
236 const gsl_matrix_complex_float * A,
237 gsl_vector_complex_float * X);
239 int gsl_blas_zgemv (CBLAS_TRANSPOSE_t TransA,
240 const gsl_complex alpha,
241 const gsl_matrix_complex * A,
242 const gsl_vector_complex * X,
243 const gsl_complex beta,
244 gsl_vector_complex * Y);
246 int gsl_blas_ztrmv (CBLAS_UPLO_t Uplo,
247 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
248 const gsl_matrix_complex * A,
249 gsl_vector_complex * X);
251 int gsl_blas_ztrsv (CBLAS_UPLO_t Uplo,
252 CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag,
253 const gsl_matrix_complex * A,
254 gsl_vector_complex *X);
257 * Routines with S and D prefixes only
259 int gsl_blas_ssymv (CBLAS_UPLO_t Uplo,
261 const gsl_matrix_float * A,
262 const gsl_vector_float * X,
264 gsl_vector_float * Y);
266 int gsl_blas_sger (float alpha,
267 const gsl_vector_float * X,
268 const gsl_vector_float * Y,
269 gsl_matrix_float * A);
271 int gsl_blas_ssyr (CBLAS_UPLO_t Uplo,
273 const gsl_vector_float * X,
274 gsl_matrix_float * A);
276 int gsl_blas_ssyr2 (CBLAS_UPLO_t Uplo,
278 const gsl_vector_float * X,
279 const gsl_vector_float * Y,
280 gsl_matrix_float * A);
282 int gsl_blas_dsymv (CBLAS_UPLO_t Uplo,
284 const gsl_matrix * A,
285 const gsl_vector * X,
288 int gsl_blas_dger (double alpha,
289 const gsl_vector * X,
290 const gsl_vector * Y,
293 int gsl_blas_dsyr (CBLAS_UPLO_t Uplo,
295 const gsl_vector * X,
298 int gsl_blas_dsyr2 (CBLAS_UPLO_t Uplo,
300 const gsl_vector * X,
301 const gsl_vector * Y,
305 * Routines with C and Z prefixes only
308 int gsl_blas_chemv (CBLAS_UPLO_t Uplo,
309 const gsl_complex_float alpha,
310 const gsl_matrix_complex_float * A,
311 const gsl_vector_complex_float * X,
312 const gsl_complex_float beta,
313 gsl_vector_complex_float * Y);
315 int gsl_blas_cgeru (const gsl_complex_float alpha,
316 const gsl_vector_complex_float * X,
317 const gsl_vector_complex_float * Y,
318 gsl_matrix_complex_float * A);
320 int gsl_blas_cgerc (const gsl_complex_float alpha,
321 const gsl_vector_complex_float * X,
322 const gsl_vector_complex_float * Y,
323 gsl_matrix_complex_float * A);
325 int gsl_blas_cher (CBLAS_UPLO_t Uplo,
327 const gsl_vector_complex_float * X,
328 gsl_matrix_complex_float * A);
330 int gsl_blas_cher2 (CBLAS_UPLO_t Uplo,
331 const gsl_complex_float alpha,
332 const gsl_vector_complex_float * X,
333 const gsl_vector_complex_float * Y,
334 gsl_matrix_complex_float * A);
336 int gsl_blas_zhemv (CBLAS_UPLO_t Uplo,
337 const gsl_complex alpha,
338 const gsl_matrix_complex * A,
339 const gsl_vector_complex * X,
340 const gsl_complex beta,
341 gsl_vector_complex * Y);
343 int gsl_blas_zgeru (const gsl_complex alpha,
344 const gsl_vector_complex * X,
345 const gsl_vector_complex * Y,
346 gsl_matrix_complex * A);
348 int gsl_blas_zgerc (const gsl_complex alpha,
349 const gsl_vector_complex * X,
350 const gsl_vector_complex * Y,
351 gsl_matrix_complex * A);
353 int gsl_blas_zher (CBLAS_UPLO_t Uplo,
355 const gsl_vector_complex * X,
356 gsl_matrix_complex * A);
358 int gsl_blas_zher2 (CBLAS_UPLO_t Uplo,
359 const gsl_complex alpha,
360 const gsl_vector_complex * X,
361 const gsl_vector_complex * Y,
362 gsl_matrix_complex * A);
365 * ===========================================================================
366 * Prototypes for level 3 BLAS
367 * ===========================================================================
371 * Routines with standard 4 prefixes (S, D, C, Z)
373 int gsl_blas_sgemm (CBLAS_TRANSPOSE_t TransA,
374 CBLAS_TRANSPOSE_t TransB,
376 const gsl_matrix_float * A,
377 const gsl_matrix_float * B,
379 gsl_matrix_float * C);
381 int gsl_blas_ssymm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo,
383 const gsl_matrix_float * A,
384 const gsl_matrix_float * B,
386 gsl_matrix_float * C);
388 int gsl_blas_ssyrk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans,
390 const gsl_matrix_float * A,
392 gsl_matrix_float * C);
394 int gsl_blas_ssyr2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans,
396 const gsl_matrix_float * A,
397 const gsl_matrix_float * B,
399 gsl_matrix_float * C);
401 int gsl_blas_strmm (CBLAS_SIDE_t Side,
402 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
405 const gsl_matrix_float * A,
406 gsl_matrix_float * B);
408 int gsl_blas_strsm (CBLAS_SIDE_t Side,
409 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
412 const gsl_matrix_float * A,
413 gsl_matrix_float * B);
415 int gsl_blas_dgemm (CBLAS_TRANSPOSE_t TransA,
416 CBLAS_TRANSPOSE_t TransB,
418 const gsl_matrix * A,
419 const gsl_matrix * B,
423 int gsl_blas_dsymm (CBLAS_SIDE_t Side,
426 const gsl_matrix * A,
427 const gsl_matrix * B,
431 int gsl_blas_dsyrk (CBLAS_UPLO_t Uplo,
432 CBLAS_TRANSPOSE_t Trans,
434 const gsl_matrix * A,
438 int gsl_blas_dsyr2k (CBLAS_UPLO_t Uplo,
439 CBLAS_TRANSPOSE_t Trans,
441 const gsl_matrix * A,
442 const gsl_matrix * B,
446 int gsl_blas_dtrmm (CBLAS_SIDE_t Side,
447 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
450 const gsl_matrix * A,
453 int gsl_blas_dtrsm (CBLAS_SIDE_t Side,
454 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
457 const gsl_matrix * A,
460 int gsl_blas_cgemm (CBLAS_TRANSPOSE_t TransA,
461 CBLAS_TRANSPOSE_t TransB,
462 const gsl_complex_float alpha,
463 const gsl_matrix_complex_float * A,
464 const gsl_matrix_complex_float * B,
465 const gsl_complex_float beta,
466 gsl_matrix_complex_float * C);
468 int gsl_blas_csymm (CBLAS_SIDE_t Side,
470 const gsl_complex_float alpha,
471 const gsl_matrix_complex_float * A,
472 const gsl_matrix_complex_float * B,
473 const gsl_complex_float beta,
474 gsl_matrix_complex_float * C);
476 int gsl_blas_csyrk (CBLAS_UPLO_t Uplo,
477 CBLAS_TRANSPOSE_t Trans,
478 const gsl_complex_float alpha,
479 const gsl_matrix_complex_float * A,
480 const gsl_complex_float beta,
481 gsl_matrix_complex_float * C);
483 int gsl_blas_csyr2k (CBLAS_UPLO_t Uplo,
484 CBLAS_TRANSPOSE_t Trans,
485 const gsl_complex_float alpha,
486 const gsl_matrix_complex_float * A,
487 const gsl_matrix_complex_float * B,
488 const gsl_complex_float beta,
489 gsl_matrix_complex_float * C);
491 int gsl_blas_ctrmm (CBLAS_SIDE_t Side,
492 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
494 const gsl_complex_float alpha,
495 const gsl_matrix_complex_float * A,
496 gsl_matrix_complex_float * B);
498 int gsl_blas_ctrsm (CBLAS_SIDE_t Side,
499 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
501 const gsl_complex_float alpha,
502 const gsl_matrix_complex_float * A,
503 gsl_matrix_complex_float * B);
505 int gsl_blas_zgemm (CBLAS_TRANSPOSE_t TransA,
506 CBLAS_TRANSPOSE_t TransB,
507 const gsl_complex alpha,
508 const gsl_matrix_complex * A,
509 const gsl_matrix_complex * B,
510 const gsl_complex beta,
511 gsl_matrix_complex * C);
513 int gsl_blas_zsymm (CBLAS_SIDE_t Side,
515 const gsl_complex alpha,
516 const gsl_matrix_complex * A,
517 const gsl_matrix_complex * B,
518 const gsl_complex beta,
519 gsl_matrix_complex * C);
521 int gsl_blas_zsyrk (CBLAS_UPLO_t Uplo,
522 CBLAS_TRANSPOSE_t Trans,
523 const gsl_complex alpha,
524 const gsl_matrix_complex * A,
525 const gsl_complex beta,
526 gsl_matrix_complex * C);
528 int gsl_blas_zsyr2k (CBLAS_UPLO_t Uplo,
529 CBLAS_TRANSPOSE_t Trans,
530 const gsl_complex alpha,
531 const gsl_matrix_complex * A,
532 const gsl_matrix_complex * B,
533 const gsl_complex beta,
534 gsl_matrix_complex *C);
536 int gsl_blas_ztrmm (CBLAS_SIDE_t Side,
537 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
539 const gsl_complex alpha,
540 const gsl_matrix_complex * A,
541 gsl_matrix_complex * B);
543 int gsl_blas_ztrsm (CBLAS_SIDE_t Side,
544 CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA,
546 const gsl_complex alpha,
547 const gsl_matrix_complex * A,
548 gsl_matrix_complex * B);
551 * Routines with prefixes C and Z only
553 int gsl_blas_chemm (CBLAS_SIDE_t Side,
555 const gsl_complex_float alpha,
556 const gsl_matrix_complex_float * A,
557 const gsl_matrix_complex_float * B,
558 const gsl_complex_float beta,
559 gsl_matrix_complex_float * C);
561 int gsl_blas_cherk (CBLAS_UPLO_t Uplo,
562 CBLAS_TRANSPOSE_t Trans,
564 const gsl_matrix_complex_float * A,
566 gsl_matrix_complex_float * C);
568 int gsl_blas_cher2k (CBLAS_UPLO_t Uplo,
569 CBLAS_TRANSPOSE_t Trans,
570 const gsl_complex_float alpha,
571 const gsl_matrix_complex_float * A,
572 const gsl_matrix_complex_float * B,
574 gsl_matrix_complex_float * C);
576 int gsl_blas_zhemm (CBLAS_SIDE_t Side,
578 const gsl_complex alpha,
579 const gsl_matrix_complex * A,
580 const gsl_matrix_complex * B,
581 const gsl_complex beta,
582 gsl_matrix_complex * C);
584 int gsl_blas_zherk (CBLAS_UPLO_t Uplo,
585 CBLAS_TRANSPOSE_t Trans,
587 const gsl_matrix_complex * A,
589 gsl_matrix_complex * C);
591 int gsl_blas_zher2k (CBLAS_UPLO_t Uplo,
592 CBLAS_TRANSPOSE_t Trans,
593 const gsl_complex alpha,
594 const gsl_matrix_complex * A,
595 const gsl_matrix_complex * B,
597 gsl_matrix_complex * C);
602 #endif /* __GSL_BLAS_H__ */