The OpenD Programming Language

1 /++
2 $(H2 GLAS API)
3 
4 Copyright: Copyright © 2016-, Ilya Yaroshenko.
5 License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
6 Authors: Ilya Yaroshenko
7 
8 $(H4 Transposition)
9 GLAS does not require transposition parameters.
10 Use $(LINK2 http://dlang.org/phobos/std_experimental_ndslice_iteration.html#transposed, transposed)
11 to perform zero cost ndslice transposition.
12 
13 Note: $(LINK2 , ndslice) uses is row major representation.
14     $(BR)
15 +/
16 module glas.ndslice;
17 
18 version(D_Ddoc)
19 {
20     enum SliceKind
21     {
22         universal,
23         canonical,
24         contiguous,
25     }
26     struct Structure(size_t N) {}
27     struct Slice(SliceKind kind, size_t[] packs, Iterator) {}
28 }
29 else
30 {
31     import mir.ndslice.slice: Slice, SliceKind, Structure;
32 }
33 
34 extern(C) nothrow @nogc @system:
35 
36 /++
37 Specifies if the matrix `asl` stores conjugated elements.
38 +/
39 enum ulong ConjA = 0x1;
40 /++
41 Specifies if the matrix `bsl` stores conjugated elements.
42 +/
43 enum ulong ConjB = 0x2;
44 /++
45 Specifies if the lower  triangular
46 part of the symmetric matrix A is to be referenced.
47 
48 The lower triangular part of the matrix `asl`
49 must contain the lower triangular part of the symmetric / hermitian
50 matrix A and the strictly upper triangular part of `asl` is not
51 referenced.
52 
53 Note: Lower is default flag.
54 +/
55 enum ulong Lower = 0x0;
56 /++
57 Specifies if the upper  triangular
58 part of the symmetric matrix A is to be referenced.
59 
60 The upper triangular
61 part of the matrix `asl`  must contain the upper triangular part
62 of the symmetric / hermitian matrix A and the strictly lower triangular
63 part of `asl` is not referenced.
64 +/
65 enum ulong Upper = 0x0100;
66 /++
67 Specifies if the symmetric/hermitian matrix A
68     appears on the left in the  operation.
69 
70 Note: Left is default flag.
71 +/
72 enum ulong Left = 0x0;
73 /++
74 Specifies if the symmetric/hermitian matrix A
75     appears on the left in the  operation.
76 +/
77 enum ulong Right = 0x0200;
78 
79 /++
80 Params:
81     error_code = Error code
82 Returns:
83     error message
84 +/
85 string glas_error(int error_code);
86 
87 /++
88 Validates input data for GEMM operations.
89 Params:
90     as = structure for matrix A
91     bs = structure for matrix B
92     cs = structure for matrix C
93     settings = Operation settings. Allowed flags are
94             $(LREF ConjA), $(LREF ConjB).
95 Returns: 0 on success and error code otherwise.
96 +/
97 int glas_validate_gemm(Structure!2 as, Structure!2 bs, Structure!2 cs, ulong settings = 0);
98 /// ditto
99 alias validate_gemm = glas_validate_gemm;
100 
101 /++
102 Validates input data for SYMM operations.
103 Params:
104     as = structure for matrix A
105     bs = structure for matrix B
106     cs = structure for matrix C
107     settings = Operation settings. Allowed flags are
108             $(LREF Left), $(LREF Right),
109             $(LREF Lower), $(LREF Upper),
110             $(LREF ConjA), $(LREF ConjB).
111             $(LREF ConjA) flag specifies if the matrix A is hermitian.
112 Returns: 0 on success and error code otherwise.
113 +/
114 int glas_validate_symm(Structure!2 as, Structure!2 bs, Structure!2 cs, ulong settings = 0);
115 /// ditto
116 alias validate_symm = glas_validate_symm;
117 
118 /++
119 Performs general matrix-matrix multiplication.
120 
121 Pseudo_code: `C := alpha A × B + beta C`.
122 
123 Params:
124     alpha = scalar
125     asl = `m ⨉ k` matrix
126     bsl = `k ⨉ n` matrix
127     beta = scalar. When  `beta`  is supplied as zero then the matrix `csl` need not be set on input.
128     csl = `m ⨉ n` matrix with one stride equal to `±1`.
129     settings = Operation settings. Allowed flags are $(LREF ConjA) and $(LREF ConjB).
130 
131 Unified_alias: `gemm`
132 
133 BLAS: SGEMM, DGEMM, CGEMM, ZGEMM
134 +/
135 void glas_sgemm(float alpha, Slice!(SliceKind.universal, [2], const(float)*) asl, Slice!(SliceKind.universal, [2], const(float)*) bsl, float beta, Slice!(SliceKind.universal, [2], float*) csl, ulong settings = 0);
136 /// ditto
137 void glas_dgemm(double alpha, Slice!(SliceKind.universal, [2], const(double)*) asl, Slice!(SliceKind.universal, [2], const(double)*) bsl, double beta, Slice!(SliceKind.universal, [2], double*) csl, ulong settings = 0);
138 /// ditto
139 void glas_cgemm(cfloat alpha, Slice!(SliceKind.universal, [2], const(cfloat)*) asl, Slice!(SliceKind.universal, [2], const(cfloat)*) bsl, cfloat beta, Slice!(SliceKind.universal, [2], cfloat*) csl, ulong settings = 0);
140 /// ditto
141 void glas_zgemm(cdouble alpha, Slice!(SliceKind.universal, [2], const(cdouble)*) asl, Slice!(SliceKind.universal, [2], const(cdouble)*) bsl, cdouble beta, Slice!(SliceKind.universal, [2], cdouble*) csl, ulong settings = 0);
142 
143 /// ditto
144 alias gemm = glas_sgemm;
145 /// ditto
146 alias gemm = glas_dgemm;
147 /// ditto
148 alias gemm = glas_cgemm;
149 /// ditto
150 alias gemm = glas_zgemm;
151 
152 /++
153 Performs symmetric or hermitian matrix-matrix multiplication.
154 
155 Pseudo_code: `C := alpha A × B + beta C` or `C := alpha B × A + beta C`,
156     where  `alpha` and `beta` are scalars, `A` is a symmetric or hermitian matrix and `B` and
157     `C` are `m × n` matrices.
158 
159 Params:
160     alpha = scalar
161     asl = `k ⨉ k` matrix, where `k` is `n`  when $(LREF Right) flag is set
162            and is `m` otherwise.
163     bsl = `m ⨉ n` matrix
164     beta = scalar. When  `beta`  is supplied as zero then the matrix `csl` need not be set on input.
165     csl = `m ⨉ n` matrix with one stride equals to `±1`.
166     settings = Operation settings.
167         Allowed flags are
168             $(LREF Left), $(LREF Right),
169             $(LREF Lower), $(LREF Upper),
170             $(LREF ConjA), $(LREF ConjB).
171             $(LREF ConjA) flag specifies if the matrix A is hermitian.
172 
173 Unified_alias: `symm`
174 
175 If your matrix is not SliceKind.universal, you can use `mir.ndslice.topology.universal` 
176 to convert it before passing it.
177 
178 BLAS: SSYMM, DSYMM, CSYMM, ZSYMM, SHEMM, DHEMM, CHEMM, ZHEMM
179 +/
180 void glas_ssymm(float alpha, Slice!(SliceKind.universal, [2], const(float)*) asl, Slice!(SliceKind.universal, [2], const(float)*) bsl, float beta, Slice!(SliceKind.universal, [2], float*) csl, ulong settings = 0);
181 /// ditto
182 void glas_dsymm(double alpha, Slice!(SliceKind.universal, [2], const(double)*) asl, Slice!(SliceKind.universal, [2], const(double)*) bsl, double beta, Slice!(SliceKind.universal, [2], double*) csl, ulong settings = 0);
183 /// ditto
184 void glas_csymm(cfloat alpha, Slice!(SliceKind.universal, [2], const(cfloat)*) asl, Slice!(SliceKind.universal, [2], const(cfloat)*) bsl, cfloat beta, Slice!(SliceKind.universal, [2], cfloat*) csl, ulong settings = 0);
185 /// ditto
186 void glas_zsymm(cdouble alpha, Slice!(SliceKind.universal, [2], const(cdouble)*) asl, Slice!(SliceKind.universal, [2], const(cdouble)*) bsl, cdouble beta, Slice!(SliceKind.universal, [2], cdouble*) csl, ulong settings = 0);
187 
188 /// ditto
189 alias symm = glas_ssymm;
190 /// ditto
191 alias symm = glas_dsymm;
192 /// ditto
193 alias symm = glas_csymm;
194 /// ditto
195 alias symm = glas_zsymm;
196 
197 pure:
198 
199 /++
200 `copy` copies a vector, `x`, to a vector, `y`.
201 
202 Pseudo_code: `y := x`.
203 
204 Unified_alias: `copy`
205 
206 BLAS: SCOPY, DCOPY, CCOPY, ZCOPY
207 +/
208 void glas_scopy(Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);
209 /// ditto
210 void glas_dcopy(Slice!(SliceKind.universal, [1], const(double)*) xsl, Slice!(SliceKind.universal, [1], double*) ysl);
211 /// ditto
212 void glas_ccopy(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);
213 /// ditto
214 void glas_zcopy(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl);
215 
216 /// ditto
217 void _glas_scopy(size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, float* y);
218 /// ditto
219 void _glas_dcopy(size_t n, ptrdiff_t incx, const(double)* x, ptrdiff_t incy, double* y);
220 /// ditto
221 void _glas_ccopy(size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, cfloat* y);
222 /// ditto
223 void _glas_zcopy(size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, cdouble* y);
224 
225 /// ditto
226 alias copy = glas_scopy;
227 /// ditto
228 alias copy = glas_dcopy;
229 /// ditto
230 alias copy = glas_ccopy;
231 /// ditto
232 alias copy = glas_zcopy;
233 
234 /// ditto
235 alias copy = _glas_scopy;
236 /// ditto
237 alias copy = _glas_dcopy;
238 /// ditto
239 alias copy = _glas_ccopy;
240 /// ditto
241 alias copy = _glas_zcopy;
242 
243 /++
244 `swap` interchanges two vectors.
245 
246 Pseudo_code: `x <-> y`.
247 
248 Unified_alias: `swap`
249 
250 BLAS: SSWAP, DSWAP, CSWAP, ZSWAP
251 +/
252 void glas_sswap(Slice!(SliceKind.universal, [1], float*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);
253 /// ditto
254 void glas_dswap(Slice!(SliceKind.universal, [1], double*) xsl, Slice!(SliceKind.universal, [1], double*) ysl);
255 /// ditto
256 void glas_cswap(Slice!(SliceKind.universal, [1], cfloat*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);
257 /// ditto
258 void glas_zswap(Slice!(SliceKind.universal, [1], cdouble*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl);
259 
260 /// ditto
261 void _glas_sswap(size_t n, ptrdiff_t incx, float* x, ptrdiff_t incy, float* y);
262 /// ditto
263 void _glas_dswap(size_t n, ptrdiff_t incx, double* x, ptrdiff_t incy, double* y);
264 /// ditto
265 void _glas_cswap(size_t n, ptrdiff_t incx, cfloat* x, ptrdiff_t incy, cfloat* y);
266 /// ditto
267 void _glas_zswap(size_t n, ptrdiff_t incx, cdouble* x, ptrdiff_t incy, cdouble* y);
268 
269 /// ditto
270 alias swap = glas_sswap;
271 /// ditto
272 alias swap = glas_dswap;
273 /// ditto
274 alias swap = glas_cswap;
275 /// ditto
276 alias swap = glas_zswap;
277 
278 /// ditto
279 alias swap = _glas_sswap;
280 /// ditto
281 alias swap = _glas_dswap;
282 /// ditto
283 alias swap = _glas_cswap;
284 /// ditto
285 alias swap = _glas_zswap;
286 
287 /++
288 Constant times a vector plus a vector.
289 
290 Pseudo_code: `y += a * x`.
291 
292 Unified_alias: `axpy`
293 
294 BLAS: SAXPY, DAXPY, CAXPY, ZAXPY
295 +/
296 void glas_saxpy(float a, Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);
297 /// ditto
298 void glas_daxpy(double a, Slice!(SliceKind.universal, [1], const(double)*) xsl, Slice!(SliceKind.universal, [1], double*) ysl);
299 /// ditto
300 void glas_caxpy(cfloat a, Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], float*) ysl);
301 /// ditto
302 void glas_zaxpy(cdouble a, Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl);
303 
304 /// ditto
305 void _glas_saxpy(float a, size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, float* y);
306 /// ditto
307 void _glas_daxpy(double a, size_t n, ptrdiff_t incx, const(double)* x, ptrdiff_t incy, double* y);
308 /// ditto
309 void _glas_caxpy(cfloat a, size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, cfloat* y);
310 /// ditto
311 void _glas_zaxpy(cdouble a, size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, cdouble* y);
312 
313 /// ditto
314 alias axpy = glas_saxpy;
315 /// ditto
316 alias axpy = glas_daxpy;
317 /// ditto
318 alias axpy = glas_caxpy;
319 /// ditto
320 alias axpy = glas_zaxpy;
321 
322 /// ditto
323 alias axpy = _glas_saxpy;
324 /// ditto
325 alias axpy = _glas_daxpy;
326 /// ditto
327 alias axpy = _glas_caxpy;
328 /// ditto
329 alias axpy = _glas_zaxpy;
330 
331 
332 /++
333 Applies a  plane rotation.
334 
335 Unified_alias: `rot`
336 
337 BLAS: SROT, DROT, CSROT, ZDROT
338 +/
339 void glas_srot(Slice!(SliceKind.universal, [1], float*) xsl, Slice!(SliceKind.universal, [1], float*) ysl, float c, float s);
340 /// ditto
341 void glas_drot(Slice!(SliceKind.universal, [1], double*) xsl, Slice!(SliceKind.universal, [1], double*) ysl, double c, double s);
342 /// ditto
343 void glas_csrot(Slice!(SliceKind.universal, [1], cfloat*) xsl, Slice!(SliceKind.universal, [1], float*) ysl, float c, float s);
344 /// ditto
345 void glas_zdrot(Slice!(SliceKind.universal, [1], cdouble*) xsl, Slice!(SliceKind.universal, [1], cdouble*) ysl, double c, double s);
346 
347 /// ditto
348 void _glas_srot(size_t n, ptrdiff_t incx, float* x, ptrdiff_t incy, float* y, float c, float s);
349 /// ditto
350 void _glas_drot(size_t n, ptrdiff_t incx, double* x, ptrdiff_t incy, double* y, double c, double s);
351 /// ditto
352 void _glas_csrot(size_t n, ptrdiff_t incx, cfloat* x, ptrdiff_t incy, cfloat* y, float c, float s);
353 /// ditto
354 void _glas_zdrot(size_t n, ptrdiff_t incx, cdouble* x, ptrdiff_t incy, cdouble* y, double c, double s);
355 
356 /// ditto
357 alias rot = glas_srot;
358 /// ditto
359 alias rot = glas_drot;
360 /// ditto
361 alias rot = glas_csrot;
362 /// ditto
363 alias rot = glas_zdrot;
364 
365 /// ditto
366 alias rot = _glas_srot;
367 /// ditto
368 alias rot = _glas_drot;
369 /// ditto
370 alias rot = _glas_csrot;
371 /// ditto
372 alias rot = _glas_zdrot;
373 
374 
375 /++
376 Applies a modified plane rotation.
377 
378 Unified_alias: `rotn`
379 
380 BLAS: SROTM, DROTM
381 +/
382 void glas_srotm(Slice!(SliceKind.universal, [1], float*) xsl, Slice!(SliceKind.universal, [1], float*) ysl, ref const float[5] sparam);
383 /// ditto
384 void glas_drotm(Slice!(SliceKind.universal, [1], double*) xsl, Slice!(SliceKind.universal, [1], double*) ysl, ref const double[5] sparam);
385 
386 /// ditto
387 void _glas_srotm(size_t n, ptrdiff_t incx, float* x, ptrdiff_t incy, float* y, ref const float[5] sparam);
388 /// ditto
389 void _glas_drotm(size_t n, ptrdiff_t incx, double* x, ptrdiff_t incy, double* y, ref const double[5] sparam);
390 
391 /// ditto
392 alias rotm = glas_srotm;
393 /// ditto
394 alias rotm = glas_drotm;
395 
396 /// ditto
397 alias rotm = _glas_srotm;
398 /// ditto
399 alias rotm = _glas_drotm;
400 
401 /++
402 Forms the dot product of two vectors.
403 Uses unrolled loops for increments equal to one.
404 
405 Unified_alias: `dot`
406 
407 Pseudo_code: `X^T * Y`
408 
409 BLAS: SDOT, DDOT
410 +/
411 float glas_sdot(Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], const(float)*) ysl);
412 /// ditto
413 double glas_ddot(Slice!(SliceKind.universal, [1], const(double)*) xsl, Slice!(SliceKind.universal, [1], const(double)*) ysl);
414 
415 /// ditto
416 float _glas_sdot(size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, const(float)* y);
417 /// ditto
418 double _glas_ddot(size_t n, ptrdiff_t incx, const(double)* x, ptrdiff_t incy, const(double)* y);
419 
420 /// ditto
421 alias dot = glas_sdot;
422 /// ditto
423 alias dot = glas_ddot;
424 
425 /// ditto
426 alias dot = _glas_sdot;
427 /// ditto
428 alias dot = _glas_ddot;
429 
430 /++
431 Compute the inner product of two vectors with extended
432 precision accumulation and result.
433 Uses unrolled loops for increments equal to one.
434 
435 Unified_alias: `dot`
436 
437 Pseudo_code: `X^T * Y`
438 
439 BLAS: DSDOT
440 +/
441 double glas_dsdot(Slice!(SliceKind.universal, [1], const(float)*) xsl, Slice!(SliceKind.universal, [1], const(float)*) ysl);
442 
443 /// ditto
444 double _glas_dsdot(size_t n, ptrdiff_t incx, const(float)* x, ptrdiff_t incy, const(float)* y);
445 
446 /// ditto
447 alias dsdot = glas_dsdot;
448 
449 /// ditto
450 alias dsdot = _glas_dsdot;
451 
452 /++
453 Forms the dot product of two complex vectors.
454 Uses unrolled loops for increments equal to one.
455 
456 Unified_alias: `dotu`
457 
458 Pseudo_code: `X^T * Y`
459 
460 BLAS: CDOTU, ZDOTU
461 +/
462 cfloat glas_cdotu(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], const(cfloat)*) ysl);
463 /// ditto
464 cdouble glas_zdotu(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], const(cdouble)*) ysl);
465 
466 /// ditto
467 cfloat _glas_cdotu(size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, const(cfloat)* y);
468 /// ditto
469 cdouble _glas_zdotu(size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, const(cdouble)* y);
470 
471 /// ditto
472 alias dotu = glas_cdotu;
473 /// ditto
474 alias dotu = glas_zdotu;
475 
476 /// ditto
477 alias dotu = _glas_cdotu;
478 /// ditto
479 alias dotu = _glas_zdotu;
480 
481 
482 /++
483 Forms the dot product of two complex vectors.
484 Uses unrolled loops for increments equal to one.
485 
486 Unified_alias: `dotc`
487 
488 Pseudo_code: `X^H * Y`
489 
490 BLAS: CDOTC, ZDOTC
491 +/
492 cfloat glas_cdotc(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl, Slice!(SliceKind.universal, [1], const(cfloat)*) ysl);
493 /// ditto
494 cdouble glas_zdotc(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl, Slice!(SliceKind.universal, [1], const(cdouble)*) ysl);
495 
496 /// ditto
497 cfloat _glas_cdotc(size_t n, ptrdiff_t incx, const(cfloat)* x, ptrdiff_t incy, const(cfloat)* y);
498 /// ditto
499 cdouble _glas_zdotc(size_t n, ptrdiff_t incx, const(cdouble)* x, ptrdiff_t incy, const(cdouble)* y);
500 
501 /// ditto
502 alias dotc = glas_cdotc;
503 /// ditto
504 alias dotc = glas_zdotc;
505 
506 /// ditto
507 alias dotc = _glas_cdotc;
508 /// ditto
509 alias dotc = _glas_zdotc;
510 
511 
512 /++
513 Returns the euclidean norm of a vector via the function.
514 
515 Pseudo_code: `sqrt( x'*x )`.
516 
517 Unified_alias: `nrm2`
518 
519 BLAS: SNRM2, DNRM2, SCNRM2, DZNRM2
520 +/
521 float glas_snrm2(Slice!(SliceKind.universal, [1], const(float)*) xsl);
522 /// ditto
523 double glas_dnrm2(Slice!(SliceKind.universal, [1], const(double)*) xsl);
524 /// ditto
525 float glas_scnrm2(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl);
526 /// ditto
527 double glas_dznrm2(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl);
528 
529 /// ditto
530 float _glas_snrm2(size_t n, ptrdiff_t incx, const(float)* x);
531 /// ditto
532 double _glas_dnrm2(size_t n, ptrdiff_t incx, const(double)* x);
533 /// ditto
534 float _glas_scnrm2(size_t n, ptrdiff_t incx, const(cfloat)* x);
535 /// ditto
536 double _glas_dznrm2(size_t n, ptrdiff_t incx, const(cdouble)* x);
537 
538 /// ditto
539 alias nrm2 = glas_snrm2;
540 /// ditto
541 alias nrm2 = glas_dnrm2;
542 /// ditto
543 alias nrm2 = glas_scnrm2;
544 /// ditto
545 alias nrm2 = glas_dznrm2;
546 
547 /// ditto
548 alias nrm2 = _glas_snrm2;
549 /// ditto
550 alias nrm2 = _glas_dnrm2;
551 /// ditto
552 alias nrm2 = _glas_scnrm2;
553 /// ditto
554 alias nrm2 = _glas_dznrm2;
555 
556 /++
557 Takes the sum of the absolute values.
558 
559 Unified_alias: `asum`
560 
561 BLAS: SASUM, DASUM, SCASUM, DZASUM
562 +/
563 float glas_sasum(Slice!(SliceKind.universal, [1], const(float)*) xsl);
564 /// ditto
565 double glas_dasum(Slice!(SliceKind.universal, [1], const(double)*) xsl);
566 /// ditto
567 float glas_scasum(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl);
568 /// ditto
569 double glas_dzasum(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl);
570 
571 /// ditto
572 float _glas_sasum(size_t n, ptrdiff_t incx, const(float)* x);
573 /// ditto
574 double _glas_dasum(size_t n, ptrdiff_t incx, const(double)* x);
575 /// ditto
576 float _glas_scasum(size_t n, ptrdiff_t incx, const(cfloat)* x);
577 /// ditto
578 double _glas_dzasum(size_t n, ptrdiff_t incx, const(cdouble)* x);
579 
580 /// ditto
581 alias asum = glas_sasum;
582 /// ditto
583 alias asum = glas_dasum;
584 /// ditto
585 alias asum = glas_scasum;
586 /// ditto
587 alias asum = glas_dzasum;
588 
589 /// ditto
590 alias asum = _glas_sasum;
591 /// ditto
592 alias asum = _glas_dasum;
593 /// ditto
594 alias asum = _glas_scasum;
595 /// ditto
596 alias asum = _glas_dzasum;
597 
598 /++
599 Finds the index of the first element having maximum `|Re(.)| + |Im(.)|`.
600 
601 Unified_alias: `amax`
602 
603 BLAS: ISAMAX, IDAMAX, ICAMAX, IZAMAX
604 +/
605 ptrdiff_t glas_isamax(Slice!(SliceKind.universal, [1], const(float)*) xsl);
606 /// ditto
607 ptrdiff_t glas_idamax(Slice!(SliceKind.universal, [1], const(double)*) xsl);
608 /// ditto
609 ptrdiff_t glas_icamax(Slice!(SliceKind.universal, [1], const(cfloat)*) xsl);
610 /// ditto
611 ptrdiff_t glas_izamax(Slice!(SliceKind.universal, [1], const(cdouble)*) xsl);
612 
613 /// ditto
614 ptrdiff_t _glas_isamax(size_t n, ptrdiff_t incx, const(float)* x);
615 /// ditto
616 ptrdiff_t _glas_idamax(size_t n, ptrdiff_t incx, const(double)* x);
617 /// ditto
618 ptrdiff_t _glas_icamax(size_t n, ptrdiff_t incx, const(cfloat)* x);
619 /// ditto
620 ptrdiff_t _glas_izamax(size_t n, ptrdiff_t incx, const(cdouble)* x);
621 
622 /// ditto
623 alias iamax = glas_isamax;
624 /// ditto
625 alias iamax = glas_idamax;
626 /// ditto
627 alias iamax = glas_icamax;
628 /// ditto
629 alias iamax = glas_izamax;
630 
631 /// ditto
632 alias iamax = _glas_isamax;
633 /// ditto
634 alias iamax = _glas_idamax;
635 /// ditto
636 alias iamax = _glas_icamax;
637 /// ditto
638 alias iamax = _glas_izamax;
639 
640 /++
641 `scal` scales a vector by a constant.
642 
643 Pseudo_code: `x := a x`.
644 
645 Unified_alias: `scal`
646 
647 BLAS: SSSCAL, DSSCAL, CSSCAL, ZSSCAL, CSCAL, ZSCAL
648 +/
649 void glas_sscal(float a, Slice!(SliceKind.universal, [1], float*) xsl);
650 /// ditto
651 void glas_dscal(double a, Slice!(SliceKind.universal, [1], double*) xsl);
652 /// ditto
653 void glas_csscal(float a, Slice!(SliceKind.universal, [1], cfloat*) xsl);
654 /// ditto
655 void glas_cscal(cfloat a, Slice!(SliceKind.universal, [1], cfloat*) xsl);
656 /// ditto
657 void glas_csIscal(ifloat a, Slice!(SliceKind.universal, [1], cfloat*) xsl);
658 /// ditto
659 void glas_zdscal(double a, Slice!(SliceKind.universal, [1], cdouble*) xsl);
660 /// ditto
661 void glas_zscal(cdouble a, Slice!(SliceKind.universal, [1], cdouble*) xsl);
662 /// ditto
663 void glas_zdIscal(idouble a, Slice!(SliceKind.universal, [1], cdouble*) xsl);
664 
665 /// ditto
666 void _glas_sscal(float a, size_t n, ptrdiff_t incx, float* x);
667 /// ditto
668 void _glas_dscal(double a, size_t n, ptrdiff_t incx, double* x);
669 /// ditto
670 void _glas_csscal(float a, size_t n, ptrdiff_t incx, cfloat* x);
671 /// ditto
672 void _glas_cscal(cfloat a, size_t n, ptrdiff_t incx, cfloat* x);
673 /// ditto
674 void _glas_csIscal(ifloat a, size_t n, ptrdiff_t incx, cfloat* x);
675 /// ditto
676 void _glas_zdscal(double a, size_t n, ptrdiff_t incx, cdouble* x);
677 /// ditto
678 void _glas_zscal(cdouble a, size_t n, ptrdiff_t incx, cdouble* x);
679 /// ditto
680 void _glas_zdIscal(idouble a, size_t n, ptrdiff_t incx, cdouble* x);
681 
682 /// ditto
683 alias scal = glas_sscal;
684 /// ditto
685 alias scal = glas_dscal;
686 /// ditto
687 alias scal = glas_csscal;
688 /// ditto
689 alias scal = glas_cscal;
690 /// ditto
691 alias scal = glas_csIscal;
692 /// ditto
693 alias scal = glas_zdscal;
694 /// ditto
695 alias scal = glas_zscal;
696 /// ditto
697 alias scal = glas_zdIscal;
698 
699 /// ditto
700 alias scal = _glas_sscal;
701 /// ditto
702 alias scal = _glas_dscal;
703 /// ditto
704 alias scal = _glas_csscal;
705 /// ditto
706 alias scal = _glas_cscal;
707 /// ditto
708 alias scal = _glas_csIscal;
709 /// ditto
710 alias scal = _glas_zdscal;
711 /// ditto
712 alias scal = _glas_zscal;
713 /// ditto
714 alias scal = _glas_zdIscal;