1 /** D bindings for GSL.
2     Authors:    Chibisi Chima-Okereke
3     Copyright:  Copyright (c) 2016, Chibisi Chima-Okereke. All rights reserved.
4     License:    Boost License 1.0
5 */
6 
7 module gsl.blas;
8 import gsl.cblas;
9 import gsl.block;
10 import gsl.complex;
11 import gsl.vector;
12 import gsl.matrix;
13 import core.stdc.config : c_ulong;
14 
15 //import core.stdc.float;
16 //import core.stdc.complex;
17 
18 
19 
20 extern (C):
21 
22 alias c_ulong CBLAS_INDEX_t;
23 alias CBLAS_ORDER CBLAS_ORDER_t;
24 alias CBLAS_TRANSPOSE CBLAS_TRANSPOSE_t;
25 alias CBLAS_UPLO CBLAS_UPLO_t;
26 alias CBLAS_DIAG CBLAS_DIAG_t;
27 alias CBLAS_SIDE CBLAS_SIDE_t;
28 
29 int gsl_blas_sdsdot (float alpha, const(gsl_vector_float)* X, const(gsl_vector_float)* Y, float* result);
30 int gsl_blas_dsdot (const(gsl_vector_float)* X, const(gsl_vector_float)* Y, double* result);
31 int gsl_blas_sdot (const(gsl_vector_float)* X, const(gsl_vector_float)* Y, float* result);
32 int gsl_blas_ddot (const(gsl_vector)* X, const(gsl_vector)* Y, double* result);
33 int gsl_blas_cdotu (const(gsl_vector_complex_float)* X, const(gsl_vector_complex_float)* Y, gsl_complex_float* dotu);
34 int gsl_blas_cdotc (const(gsl_vector_complex_float)* X, const(gsl_vector_complex_float)* Y, gsl_complex_float* dotc);
35 int gsl_blas_zdotu (const(gsl_vector_complex)* X, const(gsl_vector_complex)* Y, gsl_complex* dotu);
36 int gsl_blas_zdotc (const(gsl_vector_complex)* X, const(gsl_vector_complex)* Y, gsl_complex* dotc);
37 float gsl_blas_snrm2 (const(gsl_vector_float)* X);
38 float gsl_blas_sasum (const(gsl_vector_float)* X);
39 double gsl_blas_dnrm2 (const(gsl_vector)* X);
40 double gsl_blas_dasum (const(gsl_vector)* X);
41 float gsl_blas_scnrm2 (const(gsl_vector_complex_float)* X);
42 float gsl_blas_scasum (const(gsl_vector_complex_float)* X);
43 double gsl_blas_dznrm2 (const(gsl_vector_complex)* X);
44 double gsl_blas_dzasum (const(gsl_vector_complex)* X);
45 CBLAS_INDEX_t gsl_blas_isamax (const(gsl_vector_float)* X);
46 CBLAS_INDEX_t gsl_blas_idamax (const(gsl_vector)* X);
47 CBLAS_INDEX_t gsl_blas_icamax (const(gsl_vector_complex_float)* X);
48 CBLAS_INDEX_t gsl_blas_izamax (const(gsl_vector_complex)* X);
49 int gsl_blas_sswap (gsl_vector_float* X, gsl_vector_float* Y);
50 int gsl_blas_scopy (const(gsl_vector_float)* X, gsl_vector_float* Y);
51 int gsl_blas_saxpy (float alpha, const(gsl_vector_float)* X, gsl_vector_float* Y);
52 int gsl_blas_dswap (gsl_vector* X, gsl_vector* Y);
53 int gsl_blas_dcopy (const(gsl_vector)* X, gsl_vector* Y);
54 int gsl_blas_daxpy (double alpha, const(gsl_vector)* X, gsl_vector* Y);
55 int gsl_blas_cswap (gsl_vector_complex_float* X, gsl_vector_complex_float* Y);
56 int gsl_blas_ccopy (const(gsl_vector_complex_float)* X, gsl_vector_complex_float* Y);
57 int gsl_blas_caxpy (const gsl_complex_float alpha, const(gsl_vector_complex_float)* X, gsl_vector_complex_float* Y);
58 int gsl_blas_zswap (gsl_vector_complex* X, gsl_vector_complex* Y);
59 int gsl_blas_zcopy (const(gsl_vector_complex)* X, gsl_vector_complex* Y);
60 int gsl_blas_zaxpy (const gsl_complex alpha, const(gsl_vector_complex)* X, gsl_vector_complex* Y);
61 int gsl_blas_srotg (float* a, float* b, float* c, float* s);
62 int gsl_blas_srotmg (float* d1, float* d2, float* b1, float b2, float* P);
63 int gsl_blas_srot (gsl_vector_float* X, gsl_vector_float* Y, float c, float s);
64 int gsl_blas_srotm (gsl_vector_float* X, gsl_vector_float* Y, const(float)* P);
65 int gsl_blas_drotg (double* a, double* b, double* c, double* s);
66 int gsl_blas_drotmg (double* d1, double* d2, double* b1, double b2, double* P);
67 int gsl_blas_drot (gsl_vector* X, gsl_vector* Y, const double c, const double s);
68 int gsl_blas_drotm (gsl_vector* X, gsl_vector* Y, const(double)* P);
69 void gsl_blas_sscal (float alpha, gsl_vector_float* X);
70 void gsl_blas_dscal (double alpha, gsl_vector* X);
71 void gsl_blas_cscal (const gsl_complex_float alpha, gsl_vector_complex_float* X);
72 void gsl_blas_zscal (const gsl_complex alpha, gsl_vector_complex* X);
73 void gsl_blas_csscal (float alpha, gsl_vector_complex_float* X);
74 void gsl_blas_zdscal (double alpha, gsl_vector_complex* X);
75 int gsl_blas_sgemv (CBLAS_TRANSPOSE_t TransA, float alpha, const(gsl_matrix_float)* A, const(gsl_vector_float)* X, float beta, gsl_vector_float* Y);
76 int gsl_blas_strmv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix_float)* A, gsl_vector_float* X);
77 int gsl_blas_strsv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix_float)* A, gsl_vector_float* X);
78 int gsl_blas_dgemv (CBLAS_TRANSPOSE_t TransA, double alpha, const(gsl_matrix)* A, const(gsl_vector)* X, double beta, gsl_vector* Y);
79 int gsl_blas_dtrmv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix)* A, gsl_vector* X);
80 int gsl_blas_dtrsv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix)* A, gsl_vector* X);
81 int gsl_blas_cgemv (CBLAS_TRANSPOSE_t TransA, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const(gsl_vector_complex_float)* X, const gsl_complex_float beta, gsl_vector_complex_float* Y);
82 int gsl_blas_ctrmv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix_complex_float)* A, gsl_vector_complex_float* X);
83 int gsl_blas_ctrsv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix_complex_float)* A, gsl_vector_complex_float* X);
84 int gsl_blas_zgemv (CBLAS_TRANSPOSE_t TransA, const gsl_complex alpha, const(gsl_matrix_complex)* A, const(gsl_vector_complex)* X, const gsl_complex beta, gsl_vector_complex* Y);
85 int gsl_blas_ztrmv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix_complex)* A, gsl_vector_complex* X);
86 int gsl_blas_ztrsv (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const(gsl_matrix_complex)* A, gsl_vector_complex* X);
87 int gsl_blas_ssymv (CBLAS_UPLO_t Uplo, float alpha, const(gsl_matrix_float)* A, const(gsl_vector_float)* X, float beta, gsl_vector_float* Y);
88 int gsl_blas_sger (float alpha, const(gsl_vector_float)* X, const(gsl_vector_float)* Y, gsl_matrix_float* A);
89 int gsl_blas_ssyr (CBLAS_UPLO_t Uplo, float alpha, const(gsl_vector_float)* X, gsl_matrix_float* A);
90 int gsl_blas_ssyr2 (CBLAS_UPLO_t Uplo, float alpha, const(gsl_vector_float)* X, const(gsl_vector_float)* Y, gsl_matrix_float* A);
91 int gsl_blas_dsymv (CBLAS_UPLO_t Uplo, double alpha, const(gsl_matrix)* A, const(gsl_vector)* X, double beta, gsl_vector* Y);
92 int gsl_blas_dger (double alpha, const(gsl_vector)* X, const(gsl_vector)* Y, gsl_matrix* A);
93 int gsl_blas_dsyr (CBLAS_UPLO_t Uplo, double alpha, const(gsl_vector)* X, gsl_matrix* A);
94 int gsl_blas_dsyr2 (CBLAS_UPLO_t Uplo, double alpha, const(gsl_vector)* X, const(gsl_vector)* Y, gsl_matrix* A);
95 int gsl_blas_chemv (CBLAS_UPLO_t Uplo, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const(gsl_vector_complex_float)* X, const gsl_complex_float beta, gsl_vector_complex_float* Y);
96 int gsl_blas_cgeru (const gsl_complex_float alpha, const(gsl_vector_complex_float)* X, const(gsl_vector_complex_float)* Y, gsl_matrix_complex_float* A);
97 int gsl_blas_cgerc (const gsl_complex_float alpha, const(gsl_vector_complex_float)* X, const(gsl_vector_complex_float)* Y, gsl_matrix_complex_float* A);
98 int gsl_blas_cher (CBLAS_UPLO_t Uplo, float alpha, const(gsl_vector_complex_float)* X, gsl_matrix_complex_float* A);
99 int gsl_blas_cher2 (CBLAS_UPLO_t Uplo, const gsl_complex_float alpha, const(gsl_vector_complex_float)* X, const(gsl_vector_complex_float)* Y, gsl_matrix_complex_float* A);
100 int gsl_blas_zhemv (CBLAS_UPLO_t Uplo, const gsl_complex alpha, const(gsl_matrix_complex)* A, const(gsl_vector_complex)* X, const gsl_complex beta, gsl_vector_complex* Y);
101 int gsl_blas_zgeru (const gsl_complex alpha, const(gsl_vector_complex)* X, const(gsl_vector_complex)* Y, gsl_matrix_complex* A);
102 int gsl_blas_zgerc (const gsl_complex alpha, const(gsl_vector_complex)* X, const(gsl_vector_complex)* Y, gsl_matrix_complex* A);
103 int gsl_blas_zher (CBLAS_UPLO_t Uplo, double alpha, const(gsl_vector_complex)* X, gsl_matrix_complex* A);
104 int gsl_blas_zher2 (CBLAS_UPLO_t Uplo, const gsl_complex alpha, const(gsl_vector_complex)* X, const(gsl_vector_complex)* Y, gsl_matrix_complex* A);
105 int gsl_blas_sgemm (CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, float alpha, const(gsl_matrix_float)* A, const(gsl_matrix_float)* B, float beta, gsl_matrix_float* C);
106 int gsl_blas_ssymm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, float alpha, const(gsl_matrix_float)* A, const(gsl_matrix_float)* B, float beta, gsl_matrix_float* C);
107 int gsl_blas_ssyrk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, float alpha, const(gsl_matrix_float)* A, float beta, gsl_matrix_float* C);
108 int gsl_blas_ssyr2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, float alpha, const(gsl_matrix_float)* A, const(gsl_matrix_float)* B, float beta, gsl_matrix_float* C);
109 int gsl_blas_strmm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, float alpha, const(gsl_matrix_float)* A, gsl_matrix_float* B);
110 int gsl_blas_strsm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, float alpha, const(gsl_matrix_float)* A, gsl_matrix_float* B);
111 int gsl_blas_dgemm (CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, double alpha, const(gsl_matrix)* A, const(gsl_matrix)* B, double beta, gsl_matrix* C);
112 int gsl_blas_dsymm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, double alpha, const(gsl_matrix)* A, const(gsl_matrix)* B, double beta, gsl_matrix* C);
113 int gsl_blas_dsyrk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, double alpha, const(gsl_matrix)* A, double beta, gsl_matrix* C);
114 int gsl_blas_dsyr2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, double alpha, const(gsl_matrix)* A, const(gsl_matrix)* B, double beta, gsl_matrix* C);
115 int gsl_blas_dtrmm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, double alpha, const(gsl_matrix)* A, gsl_matrix* B);
116 int gsl_blas_dtrsm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, double alpha, const(gsl_matrix)* A, gsl_matrix* B);
117 int gsl_blas_cgemm (CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const(gsl_matrix_complex_float)* B, const gsl_complex_float beta, gsl_matrix_complex_float* C);
118 int gsl_blas_csymm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const(gsl_matrix_complex_float)* B, const gsl_complex_float beta, gsl_matrix_complex_float* C);
119 int gsl_blas_csyrk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const gsl_complex_float beta, gsl_matrix_complex_float* C);
120 int gsl_blas_csyr2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const(gsl_matrix_complex_float)* B, const gsl_complex_float beta, gsl_matrix_complex_float* C);
121 int gsl_blas_ctrmm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, gsl_matrix_complex_float* B);
122 int gsl_blas_ctrsm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, gsl_matrix_complex_float* B);
123 int gsl_blas_zgemm (CBLAS_TRANSPOSE_t TransA, CBLAS_TRANSPOSE_t TransB, const gsl_complex alpha, const(gsl_matrix_complex)* A, const(gsl_matrix_complex)* B, const gsl_complex beta, gsl_matrix_complex* C);
124 int gsl_blas_zsymm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, const gsl_complex alpha, const(gsl_matrix_complex)* A, const(gsl_matrix_complex)* B, const gsl_complex beta, gsl_matrix_complex* C);
125 int gsl_blas_zsyrk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, const gsl_complex alpha, const(gsl_matrix_complex)* A, const gsl_complex beta, gsl_matrix_complex* C);
126 int gsl_blas_zsyr2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, const gsl_complex alpha, const(gsl_matrix_complex)* A, const(gsl_matrix_complex)* B, const gsl_complex beta, gsl_matrix_complex* C);
127 int gsl_blas_ztrmm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const gsl_complex alpha, const(gsl_matrix_complex)* A, gsl_matrix_complex* B);
128 int gsl_blas_ztrsm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t TransA, CBLAS_DIAG_t Diag, const gsl_complex alpha, const(gsl_matrix_complex)* A, gsl_matrix_complex* B);
129 int gsl_blas_chemm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const(gsl_matrix_complex_float)* B, const gsl_complex_float beta, gsl_matrix_complex_float* C);
130 int gsl_blas_cherk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, float alpha, const(gsl_matrix_complex_float)* A, float beta, gsl_matrix_complex_float* C);
131 int gsl_blas_cher2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, const gsl_complex_float alpha, const(gsl_matrix_complex_float)* A, const(gsl_matrix_complex_float)* B, float beta, gsl_matrix_complex_float* C);
132 int gsl_blas_zhemm (CBLAS_SIDE_t Side, CBLAS_UPLO_t Uplo, const gsl_complex alpha, const(gsl_matrix_complex)* A, const(gsl_matrix_complex)* B, const gsl_complex beta, gsl_matrix_complex* C);
133 int gsl_blas_zherk (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, double alpha, const(gsl_matrix_complex)* A, double beta, gsl_matrix_complex* C);
134 int gsl_blas_zher2k (CBLAS_UPLO_t Uplo, CBLAS_TRANSPOSE_t Trans, const gsl_complex alpha, const(gsl_matrix_complex)* A, const(gsl_matrix_complex)* B, double beta, gsl_matrix_complex* C);