1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
//
// A rust binding for the GSL library by Guillaume Gomez (guillaume1.gomez@gmail.com)
//

#[derive(Clone, Copy)]
pub struct Index(pub u32);

/// Indicates whether a matrix is in Row Major or Column Major order.
/// Row major order is the native order for C programs, while Column major order is native for Fortran.
#[derive(PartialEq, PartialOrd, Debug, Clone, Copy)]
#[repr(C)]
pub enum Order {
    RowMajor = 101,
    ColMajoyr
}

/// Used to indicate the order of a matrix-matrix multiply.
#[derive(PartialEq, PartialOrd, Debug, Clone, Copy)]
#[repr(C)]
pub enum Side {
    /// Means __A__ __B__
    Left = 141,
    /// Means __B__ __A__
    Right
}

/// Used to represent transpose operations on a matrix.
#[derive(PartialEq, PartialOrd, Debug, Clone, Copy)]
#[repr(C)]
pub enum Transpose {
    /// Represents __X__
    NoTrans = 111,
    /// Represents __X^T__
    Trans,
    /// Represents __X^H__
    ConjTrans
}

/// Used to indicate which part of a symmetric matrix to use.
#[derive(PartialEq, PartialOrd, Debug, Clone, Copy)]
#[repr(C)]
pub enum Uplo {
    /// Means user the upper triagle of the matrix.
    Upper = 121,
    /// Means use the lower triange of the matrix.
    Lower
}

#[derive(PartialEq, PartialOrd, Debug, Clone, Copy)]
#[repr(C)]
pub enum Diag {
    NonUnit = 131,
    Unit
}

pub mod level1 {
    pub fn sdsdot(N: i32, alpha: f32, x: &[f32], incx: i32, y: &[f32], incy: i32) -> f32 {
        unsafe { ::ffi::cblas_sdsdot(N, alpha, x.as_ptr(), incx, y.as_ptr(), incy) }
    }

    pub fn dsdot(N: i32, x: &[f32], incx: i32, y: &[f32], incy: i32) -> f64 {
        unsafe { ::ffi::cblas_dsdot(N, x.as_ptr(), incx, y.as_ptr(), incy) }
    }

    pub fn sdot(N: i32, x: &[f32], incx: i32, y: &[f32], incy: i32) -> f32 {
        unsafe { ::ffi::cblas_sdot(N, x.as_ptr(), incx, y.as_ptr(), incy) }
    }

    pub fn ddot(N: i32, x: &[f32], incx: i32, y: &[f32], incy: i32) -> f64 {
        unsafe { ::ffi::cblas_ddot(N, x.as_ptr(), incx, y.as_ptr(), incy) }
    }

    pub fn cdotu_sub<T>(N: i32, x: &[T], incx: i32, y: &[T], incy: i32, dotu: &mut [T]) {
        unsafe { ::ffi::cblas_cdotu_sub(N, x.as_ptr() as *const ::libc::c_void, incx, y.as_ptr() as *const ::libc::c_void,
            incy, dotu.as_mut_ptr() as *mut ::libc::c_void) }
    }

    pub fn cdotc_sub<T>(N: i32, x: &[T], incx: i32, y: &[T], incy: i32, dotc: &mut [T]) {
        unsafe { ::ffi::cblas_cdotc_sub(N, x.as_ptr() as *const ::libc::c_void, incx, y.as_ptr() as *const ::libc::c_void,
            incy, dotc.as_mut_ptr() as *mut ::libc::c_void) }
    }

    pub fn zdotu_sub<T>(N: i32, x: &[T], incx: i32, y: &[T], incy: i32, dotu: &mut [T]) {
        unsafe { ::ffi::cblas_zdotu_sub(N, x.as_ptr() as *const ::libc::c_void, incx, y.as_ptr() as *const ::libc::c_void,
            incy, dotu.as_mut_ptr() as *mut ::libc::c_void) }
    }

    pub fn zdotc_sub<T>(N: i32, x: &[T], incx: i32, y: &[T], incy: i32, dotc: &mut [T]) {
        unsafe { ::ffi::cblas_zdotc_sub(N, x.as_ptr() as *const ::libc::c_void, incx, y.as_ptr() as *const ::libc::c_void,
            incy, dotc.as_mut_ptr() as *mut ::libc::c_void) }
    }

    pub fn snrm2(N: i32, x: &[f32], incx: i32) -> f32 {
        unsafe { ::ffi::cblas_snrm2(N, x.as_ptr(), incx) }
    }

    pub fn sasum(N: i32, x: &[f32], incx: i32) -> f32 {
        unsafe { ::ffi::cblas_sasum(N, x.as_ptr(), incx) }
    }

    pub fn dnrm2(N: i32, x: &[f64], incx: i32) -> f64 {
        unsafe { ::ffi::cblas_dnrm2(N, x.as_ptr(), incx) }
    }

    pub fn dasum(N: i32, x: &[f64], incx: i32) -> f64 {
        unsafe { ::ffi::cblas_dasum(N, x.as_ptr(), incx) }
    }

    pub fn scnrm2<T>(N: i32, x: &[T], incx: i32) -> f32 {
        unsafe { ::ffi::cblas_scnrm2(N, x.as_ptr() as *const ::libc::c_void, incx) }
    }

    pub fn scasum<T>(N: i32, x: &[T], incx: i32) -> f32 {
        unsafe { ::ffi::cblas_scasum(N, x.as_ptr() as *const ::libc::c_void, incx) }
    }

    pub fn dznrm2<T>(N: i32, x: &[T], incx: i32) -> f64 {
        unsafe { ::ffi::cblas_dznrm2(N, x.as_ptr() as *const ::libc::c_void, incx) }
    }

    pub fn dzasum<T>(N: i32, x: &[T], incx: i32) -> f64 {
        unsafe { ::ffi::cblas_dzasum(N, x.as_ptr() as *const ::libc::c_void, incx) }
    }

    pub fn isamax(N: i32, x: &[f32], incx: i32) -> ::cblas::Index {
        ::cblas::Index(unsafe { ::ffi::cblas_isamax(N, x.as_ptr(), incx) })
    }

    pub fn idamax(N: i32, x: &[f64], incx: i32) -> ::cblas::Index {
        ::cblas::Index(unsafe { ::ffi::cblas_idamax(N, x.as_ptr(), incx) })
    }

    pub fn icamax<T>(N: i32, x: &[T], incx: i32) -> ::cblas::Index {
        ::cblas::Index(unsafe { ::ffi::cblas_icamax(N, x.as_ptr() as *const ::libc::c_void, incx) })
    }

    pub fn izamax<T>(N: i32, x: &[T], incx: i32) -> ::cblas::Index {
        ::cblas::Index(unsafe { ::ffi::cblas_izamax(N, x.as_ptr() as *const ::libc::c_void, incx) })
    }

    pub fn sswap(N: i32, x: &mut [f32], incx: i32, y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_sswap(N, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy) }
    }

    pub fn scopy(N: i32, x: &[f32], incx: i32, y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_scopy(N, x.as_ptr(), incx, y.as_mut_ptr(), incy) }
    }

    pub fn saxpy(N: i32, alpha: f32, x: &[f32], incx: i32, y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_saxpy(N, alpha, x.as_ptr(), incx, y.as_mut_ptr(), incy) }
    }

    pub fn dswap(N: i32, x: &mut [f64], incx: i32, y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_dswap(N, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy) }
    }

    pub fn dcopy(N: i32, x: &[f64], incx: i32, y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_dcopy(N, x.as_ptr(), incx, y.as_mut_ptr(), incy) }
    }

    pub fn daxpy(N: i32, alpha: f64, x: &[f64], incx: i32, y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_daxpy(N, alpha, x.as_ptr(), incx, y.as_mut_ptr(), incy) }
    }

    pub fn cswap<T>(N: i32, x: &mut [T], incx: i32, y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_cswap(N, x.as_mut_ptr() as *mut ::libc::c_void, incx, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn ccopy<T>(N: i32, x: &[T], incx: i32, y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_ccopy(N, x.as_ptr() as *const ::libc::c_void, incx, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn caxpy<T>(N: i32, alpha: &[T], x: &[T], incx: i32, y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_caxpy(N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void,
            incx, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn zswap<T>(N: i32, x: &mut [T], incx: i32, y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zswap(N, x.as_mut_ptr() as *mut ::libc::c_void, incx, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn zcopy<T>(N: i32, x: &[T], incx: i32, y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zcopy(N, x.as_ptr() as *const ::libc::c_void, incx, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn zaxpy<T>(N: i32, alpha: &[T], x: &[T], incx: i32, y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zaxpy(N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void,
            incx, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn srotg(a: &mut [f32], b: &mut [f32], c: &mut [f32], s: &mut [f32]) {
        unsafe { ::ffi::cblas_srotg(a.as_mut_ptr(), b.as_mut_ptr(), c.as_mut_ptr(), s.as_mut_ptr()) }
    }

    pub fn srotmg(d1: &mut [f32], d2: &mut [f32], b1: &mut [f32], b2: &[f32], P: &mut [f32]) {
        unsafe { ::ffi::cblas_srotmg(d1.as_mut_ptr(), d2.as_mut_ptr(), b1.as_mut_ptr(), b2.as_ptr(), P.as_mut_ptr()) }
    }

    pub fn srot(N: i32, x: &mut [f32], incx: i32, y: &mut [f32], incy: i32, c: f32, s: f32) {
        unsafe { ::ffi::cblas_srot(N, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, c, s) }
    }

    pub fn srotm(N: i32, x: &mut [f32], incx: i32, y: &mut [f32], incy: i32, p: &[f32]) {
        unsafe { ::ffi::cblas_srotm(N, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, p.as_ptr()) }
    }

    pub fn drotg(a: &mut [f64], b: &mut [f64], c: &mut [f64], s: &mut [f64]) {
        unsafe { ::ffi::cblas_drotg(a.as_mut_ptr(), b.as_mut_ptr(), c.as_mut_ptr(), s.as_mut_ptr()) }
    }

    pub fn drotmg(d1: &mut [f64], d2: &mut [f64], b1: &mut [f64], b2: &[f64], P: &mut [f64]) {
        unsafe { ::ffi::cblas_drotmg(d1.as_mut_ptr(), d2.as_mut_ptr(), b1.as_mut_ptr(), b2.as_ptr(), P.as_mut_ptr()) }
    }

    pub fn drot(N: i32, x: &mut [f64], incx: i32, y: &mut [f64], incy: i32, c: f64, s: f64) {
        unsafe { ::ffi::cblas_drot(N, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, c, s) }
    }

    pub fn drotm(N: i32, x: &mut [f64], incx: i32, y: &mut [f64], incy: i32, p: &[f64]) {
        unsafe { ::ffi::cblas_drotm(N, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, p.as_ptr()) }
    }

    /// Multiple each element of a matrix/vector by a constant.
    ///
    /// __Postcondition__: Every incX'th element of X has been multiplied by a factor of alpha
    ///
    /// __Parameters__:
    ///
    /// * N : number of elements in x to scale
    /// * alpha : factor to scale by
    /// * X : pointer to the vector/matrix data
    /// * incx : Amount to increment counter after each scaling, ie incX=2 mean to scale elements {1,3,...}
    ///
    /// Note that the allocated length of X must be incX*N-1 as N indicates the number of scaling operations to perform.
    pub fn sscal(N: i32, alpha: f32, x: &mut [f32], incx: i32) {
        unsafe { ::ffi::cblas_sscal(N, alpha, x.as_mut_ptr(), incx) }
    }

    /// Multiple each element of a matrix/vector by a constant.
    pub fn dscal(N: i32, alpha: f64, x: &mut [f64], incx: i32) {
        unsafe { ::ffi::cblas_dscal(N, alpha, x.as_mut_ptr(), incx) }
    }

    /// Multiple each element of a matrix/vector by a constant.
    pub fn cscal<T>(N: i32, alpha: &[T], x: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_cscal(N, alpha.as_ptr() as *const ::libc::c_void, x.as_mut_ptr() as *mut ::libc::c_void, incx) }
    }

    /// Multiple each element of a matrix/vector by a constant. 
    pub fn zscal<T>(N: i32, alpha: &[T], x: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_zscal(N, alpha.as_ptr() as *const ::libc::c_void, x.as_mut_ptr() as *mut ::libc::c_void, incx) }
    }

    /// Multiple each element of a matrix/vector by a constant.
    pub fn csscal<T>(N: i32, alpha: f32, x: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_csscal(N, alpha, x.as_mut_ptr() as *mut ::libc::c_void, incx) }
    }

    /// Multiple each element of a matrix/vector by a constant.
    pub fn zdscal<T>(N: i32, alpha: f64, x: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_zdscal(N, alpha, x.as_mut_ptr() as *mut ::libc::c_void, incx) }
    }
}

pub mod level2 {
    /// Multiplies a matrix and a vector.
    ///
    /// * order : Whether matrices are row major order (C-Style) for column major order (Fortran-style). One of enum CblasRowMajor or CblasColMajor
    /// * transA :  Whether to transpose matrix A. One of enum CblasNoTrans, CBlasTrans.
    /// * M : Rows in matrix A
    /// * N : Columns in matrix A
    /// * alpha : scalar factor for (sigma * op(A) * x)
    /// * A : matrix A
    /// * lda : The size of the first dimension of matrix A
    /// * X : vector X
    /// * incx : use every incX'th element of X
    /// * beta : scalar factor y
    /// * Y : vector Y
    /// * incy : use every incY'th element of Y
    ///
    /// For parameter lda, if you are passing a matrix A[m][n], the value of parameter lda should be m.
    pub fn sgemv(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, alpha: f32, A: &[f32],
        lda: i32, X: &[f32], incx: i32, beta: f32, Y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_sgemv(order, transA, M, N, alpha, A.as_ptr(), lda, X.as_ptr(), incx, beta, Y.as_mut_ptr(), incy) }
    }

    pub fn sgbmv(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, KL: i32, KU: i32,
        alpha: f32, A: &[f32], lda: i32, X: &[f32], incx: i32, beta: f32, Y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_sgbmv(order, transA, M, N, KL, KU, alpha, A.as_ptr(), lda, X.as_ptr(), incx, beta, Y.as_mut_ptr(), incy) }
    }

    pub fn strmv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[f32], lda: i32, X: &mut [f32], incx: i32) {
        unsafe { ::ffi::cblas_strmv(order, uplo, transA, diag, N, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn stbmv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[f32], lda: i32, X: &mut [f32], incx: i32) {
        unsafe { ::ffi::cblas_stbmv(order, uplo, transA, diag, N, K, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn stpmv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[f32], X: &mut [f32], incx: i32) {
        unsafe { ::ffi::cblas_stpmv(order, uplo, transA, diag, N, Ap.as_ptr(), X.as_mut_ptr(), incx) }
    }

    pub fn strsv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[f32], lda: i32, X: &mut [f32], incx: i32) {
        unsafe { ::ffi::cblas_strsv(order, uplo, transA, diag, N, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn stbsv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[f32], lda: i32, X: &mut [f32], incx: i32) {
        unsafe { ::ffi::cblas_stbsv(order, uplo, transA, diag, N, K, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn stpsv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[f32], X: &mut [f32], incx: i32) {
        unsafe { ::ffi::cblas_stpsv(order, uplo, transA, diag, N, Ap.as_ptr(), X.as_mut_ptr(), incx) }
    }

    pub fn dgemv(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, alpha: f64, A: &[f64],
        lda: i32, X: &[f64], incx: i32, beta: f64, Y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_dgemv(order, transA, M, N, alpha, A.as_ptr(), lda, X.as_ptr(), incx, beta, Y.as_mut_ptr(), incy) }
    }

    pub fn dgbmv(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, KL: i32, KU: i32,
        alpha: f64, A: &[f64], lda: i32, X: &[f64], incx: i32, beta: f64, Y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_dgbmv(order, transA, M, N, KL, KU, alpha, A.as_ptr(), lda, X.as_ptr(), incx, beta, Y.as_mut_ptr(), incy) }
    }

    pub fn dtrmv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[f64], lda: i32, X: &mut [f64], incx: i32) {
        unsafe { ::ffi::cblas_dtrmv(order, uplo, transA, diag, N, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn dtbmv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[f64], lda: i32, X: &mut [f64], incx: i32) {
        unsafe { ::ffi::cblas_dtbmv(order, uplo, transA, diag, N, K, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn dtpmv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[f64], X: &mut [f64], incx: i32) {
        unsafe { ::ffi::cblas_dtpmv(order, uplo, transA, diag, N, Ap.as_ptr(), X.as_mut_ptr(), incx) }
    }

    pub fn dtrsv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[f64], lda: i32, X: &mut [f64], incx: i32) {
        unsafe { ::ffi::cblas_dtrsv(order, uplo, transA, diag, N, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn dtbsv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[f64], lda: i32, X: &mut [f64], incx: i32) {
        unsafe { ::ffi::cblas_dtbsv(order, uplo, transA, diag, N, K, A.as_ptr(), lda, X.as_mut_ptr(), incx) }
    }

    pub fn dtpsv(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[f64], X: &mut [f64], incx: i32) {
        unsafe { ::ffi::cblas_dtpsv(order, uplo, transA, diag, N, Ap.as_ptr(), X.as_mut_ptr(), incx) }
    }

    pub fn cgemv<T>(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, alpha: &[T], A: &[T],
        lda: i32, X: &[T], incx: i32, beta: &[T], Y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_cgemv(order, transA, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            X.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, Y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn cgbmv<T>(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, KL: i32, KU: i32,
        alpha: &[T], A: &[T], lda: i32, X: &[T], incx: i32, beta: &[T], Y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_cgbmv(order, transA, M, N, KL, KU, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, X.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, Y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn ctrmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ctrmv(order, uplo, transA, diag, N, A.as_ptr() as *const ::libc::c_void, lda, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ctbmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ctbmv(order, uplo, transA, diag, N, K, A.as_ptr() as *const ::libc::c_void, lda, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ctpmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[T], X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ctpmv(order, uplo, transA, diag, N, Ap.as_ptr() as *const ::libc::c_void, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ctrsv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ctrsv(order, uplo, transA, diag, N, A.as_ptr() as *const ::libc::c_void, lda, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ctbsv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ctbsv(order, uplo, transA, diag, N, K, A.as_ptr() as *const ::libc::c_void, lda, X.as_mut_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ctpsv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[T], X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ctpsv(order, uplo, transA, diag, N, Ap.as_ptr() as *const ::libc::c_void, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn zgemv<T>(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, alpha: &[T], A: &[T],
        lda: i32, X: &[T], incx: i32, beta: &[T], Y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zgemv(order, transA, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            X.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, Y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn zgbmv<T>(order: ::cblas::Order, transA: ::cblas::Transpose, M: i32, N: i32, KL: i32, KU: i32,
        alpha: &[T], A: &[T], lda: i32, X: &[T], incx: i32, beta: &[T], Y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zgbmv(order, transA, M, N, KL, KU, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, X.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, Y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn ztrmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ztrmv(order, uplo, transA, diag, N, A.as_ptr() as *const ::libc::c_void, lda, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ztbmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ztbmv(order, uplo, transA, diag, N, K, A.as_ptr() as *const ::libc::c_void, lda, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ztpmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[T], X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ztpmv(order, uplo, transA, diag, N, Ap.as_ptr() as *const ::libc::c_void, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ztrsv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ztrsv(order, uplo, transA, diag, N, A.as_ptr() as *const ::libc::c_void, lda, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ztbsv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, K: i32, A: &[T], lda: i32, X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ztbsv(order, uplo, transA, diag, N, K, A.as_ptr() as *const ::libc::c_void, lda, X.as_mut_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ztpsv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, N: i32, Ap: &[T], X: &mut [T], incx: i32) {
        unsafe { ::ffi::cblas_ztpsv(order, uplo, transA, diag, N, Ap.as_ptr() as *const ::libc::c_void, X.as_ptr() as *mut ::libc::c_void, incx) }
    }

    pub fn ssymv(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f32, A: &[f32], lda: i32, x: &[f32],
        incx: i32, beta: f32, y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_ssymv(order, uplo, N, alpha, A.as_ptr(), lda, x.as_ptr(), incx, beta, y.as_mut_ptr(), incy) }
    }
    
    pub fn ssbmv(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, K: i32, alpha: f32, A: &[f32], lda: i32,
        x: &[f32], incx: i32, beta: f32, y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_ssbmv(order, uplo, N, K, alpha, A.as_ptr(), lda, x.as_ptr(), incx, beta, y.as_mut_ptr(), incy) }
    }

    pub fn sspmv(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f32, Ap: &[f32], x: &[f32],
        incx: i32, beta: f32, y: &mut [f32], incy: i32) {
        unsafe { ::ffi::cblas_sspmv(order, uplo, N, alpha, Ap.as_ptr(), x.as_ptr(), incx, beta, y.as_mut_ptr(), incy) }
    }

    pub fn sger(order: ::cblas::Order, M: i32, N: i32, alpha: f32, x: &[f32],
        incx: i32, y: &[f32], incy: i32, A: &mut [f32], lda: i32) {
        unsafe { ::ffi::cblas_sger(order, M, N, alpha, x.as_ptr(), incx, y.as_ptr(), incy, A.as_mut_ptr(), lda) }
    }

    pub fn ssyr(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f32, x: &[f32],
        incx: i32, A: &mut [f32], lda: i32) {
        unsafe { ::ffi::cblas_ssyr(order, uplo, N, alpha, x.as_ptr(), incx, A.as_mut_ptr(), lda) }
    }

    pub fn sspr(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f32, x: &[f32],
        incx: i32, Ap: &mut [f32]) {
        unsafe { ::ffi::cblas_sspr(order, uplo, N, alpha, x.as_ptr(), incx, Ap.as_mut_ptr()) }
    }

    pub fn ssyr2(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f32, x: &[f32],
        incx: i32, y: &[f32], incy: i32, A: &mut [f32], lda: i32) {
        unsafe { ::ffi::cblas_ssyr2(order, uplo, N, alpha, x.as_ptr(), incx, y.as_ptr(), incy, A.as_mut_ptr(), lda) }
    }

    pub fn sspr2(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f32, x: &[f32],
        incx: i32, y: &[f32], incy: i32, A: &mut [f32]) {
        unsafe { ::ffi::cblas_sspr2(order, uplo, N, alpha, x.as_ptr(), incx, y.as_ptr(), incy, A.as_mut_ptr()) }
    }

    pub fn dsymv(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f64, A: &[f64], lda: i32, x: &[f64],
        incx: i32, beta: f64, y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_dsymv(order, uplo, N, alpha, A.as_ptr(), lda, x.as_ptr(), incx, beta, y.as_mut_ptr(), incy) }
    }
    
    pub fn dsbmv(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, K: i32, alpha: f64, A: &[f64], lda: i32,
        x: &[f64], incx: i32, beta: f64, y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_dsbmv(order, uplo, N, K, alpha, A.as_ptr(), lda, x.as_ptr(), incx, beta, y.as_mut_ptr(), incy) }
    }

    pub fn dspmv(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f64, Ap: &[f64], x: &[f64],
        incx: i32, beta: f64, y: &mut [f64], incy: i32) {
        unsafe { ::ffi::cblas_dspmv(order, uplo, N, alpha, Ap.as_ptr(), x.as_ptr(), incx, beta, y.as_mut_ptr(), incy) }
    }

    pub fn dger(order: ::cblas::Order, M: i32, N: i32, alpha: f64, x: &[f64],
        incx: i32, y: &[f64], incy: i32, A: &mut [f64], lda: i32) {
        unsafe { ::ffi::cblas_dger(order, M, N, alpha, x.as_ptr(), incx, y.as_ptr(), incy, A.as_mut_ptr(), lda) }
    }

    pub fn dsyr(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f64, x: &[f64],
        incx: i32, A: &mut [f64], lda: i32) {
        unsafe { ::ffi::cblas_dsyr(order, uplo, N, alpha, x.as_ptr(), incx, A.as_mut_ptr(), lda) }
    }

    pub fn dspr(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f64, x: &[f64],
        incx: i32, Ap: &mut [f64]) {
        unsafe { ::ffi::cblas_dspr(order, uplo, N, alpha, x.as_ptr(), incx, Ap.as_mut_ptr()) }
    }

    pub fn dsyr2(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f64, x: &[f64],
        incx: i32, y: &[f64], incy: i32, A: &mut [f64], lda: i32) {
        unsafe { ::ffi::cblas_dsyr2(order, uplo, N, alpha, x.as_ptr(), incx, y.as_ptr(), incy, A.as_mut_ptr(), lda) }
    }

    pub fn dspr2(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: f64, x: &[f64],
        incx: i32, y: &[f64], incy: i32, A: &mut [f64]) {
        unsafe { ::ffi::cblas_dspr2(order, uplo, N, alpha, x.as_ptr(), incx, y.as_ptr(), incy, A.as_mut_ptr()) }
    }

    pub fn csymv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], A: &[T], lda: i32, x: &[T],
        incx: i32, beta: &[T], y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_csymv(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, x.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }
    
    pub fn csbmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, K: i32, alpha: &[T], A: &[T], lda: i32,
        x: &[T], incx: i32, beta: &[T], y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_csbmv(order, uplo, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            x.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn cspmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], Ap: &[T], x: &[T],
        incx: i32, beta: &[T], y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_cspmv(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, Ap.as_ptr() as *const ::libc::c_void,
            x.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn cgeru<T>(order: ::cblas::Order, M: i32, N: i32, alpha: &[T], x: &[T], incx: i32, y: &[T],
        incy: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_cgeru(order, M, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn cgerc<T>(order: ::cblas::Order, M: i32, N: i32, alpha: &[T], x: &[T], incx: i32, y: &[T],
        incy: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_cgerc(order, M, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn cher<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_cher(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn chpr<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, Ap: &mut [T]) {
        unsafe { ::ffi::cblas_chpr(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            Ap.as_mut_ptr() as *mut ::libc::c_void) }
    }

    pub fn cher2<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, y: &[T], incy: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_cher2(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn chpr2<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, y: &[f64], incy: i32, Ap: &mut [f64]) {
        unsafe { ::ffi::cblas_chpr2(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, Ap.as_mut_ptr() as *mut ::libc::c_void) }
    }

    pub fn zsymv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], A: &[T], lda: i32, x: &[T],
        incx: i32, beta: &[T], y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zsymv(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, x.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }
    
    pub fn zsbmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, K: i32, alpha: &[T], A: &[T], lda: i32,
        x: &[T], incx: i32, beta: &[T], y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zsbmv(order, uplo, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            x.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn zspmv<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], Ap: &[T], x: &[T],
        incx: i32, beta: &[T], y: &mut [T], incy: i32) {
        unsafe { ::ffi::cblas_zspmv(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, Ap.as_ptr() as *const ::libc::c_void,
            x.as_ptr() as *const ::libc::c_void, incx, beta.as_ptr() as *const ::libc::c_void, y.as_mut_ptr() as *mut ::libc::c_void, incy) }
    }

    pub fn zgeru<T>(order: ::cblas::Order, M: i32, N: i32, alpha: &[T], x: &[T], incx: i32, y: &[T],
        incy: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_zgeru(order, M, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn zgerc<T>(order: ::cblas::Order, M: i32, N: i32, alpha: &[T], x: &[T], incx: i32, y: &[T],
        incy: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_zgerc(order, M, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn zher<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_zher(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn zhpr<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, Ap: &mut [T]) {
        unsafe { ::ffi::cblas_zhpr(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            Ap.as_mut_ptr() as *mut ::libc::c_void) }
    }

    pub fn zher2<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, y: &[T], incy: i32, A: &mut [T], lda: i32) {
        unsafe { ::ffi::cblas_zher2(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, A.as_mut_ptr() as *mut ::libc::c_void, lda) }
    }

    pub fn zhpr2<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, N: i32, alpha: &[T], x: &[T],
        incx: i32, y: &[f64], incy: i32, Ap: &mut [f64]) {
        unsafe { ::ffi::cblas_zhpr2(order, uplo, N, alpha.as_ptr() as *const ::libc::c_void, x.as_ptr() as *const ::libc::c_void, incx,
            y.as_ptr() as *const ::libc::c_void, incy, Ap.as_mut_ptr() as *mut ::libc::c_void) }
    }
}

pub mod level3 {
    /// General ::types::Matrix-MatrixF64 multiplication for single precision float.
    /// 
    /// __Parameters:__
    /// 
    /// * order : Whether matrices are row major order (C-Style) for column major order (Fortran-style). One of enum CblasRowMajor or CblasColMajor.
    /// * transA : Whether to transpose matrix A. One of enum CblasNoTrans, CBlasTrans, CBlasConjTrans.
    /// * transB : Whether to transpose matrix B. One of enum CblasNoTrans, CBlasTrans, CBlasConjTrans.
    /// * M : Rows in matrices A and C
    /// * N : Columns in Matrices B and C
    /// * K : Columns in matrix A and Rows in matrix B
    /// * alpha : scalar factor for op(A)op(B)
    /// * A : matrix A
    /// * lda : The size of the first dimension of matrix A
    /// * B : matrix B
    /// * ldb : The size of the first dimension of matrix B
    /// * beta : scalar factor for C
    /// * C : matrix C
    /// * ldc : The size of the first dimension of matrix C
    /// 
    /// For parameters lda, ldb, and ldc, if you are passing a matrix D[m][n], the value of parameter lda, ldb, or ldc should be m.
    pub fn sgemm(order: ::cblas::Order, transA: ::cblas::Transpose, transB: ::cblas::Transpose, M: i32, N: i32,
        K: i32, alpha: f32, A: &[f32], lda: i32, B: &[f32], ldb: i32, beta: f32, C: &mut [f32], ldc: i32) {
        unsafe { ::ffi::cblas_sgemm(order, transA, transB, M, N, K, alpha, A.as_ptr(), lda, B.as_ptr(), ldb, beta, C.as_mut_ptr(), ldc) }
    }
    
    /// Symmetric ::types::Matrix-MatrixF64 multiplication for single precision float.
    /// 
    /// __Parameters:__
    /// 
    /// * order : Whether matrices are row major order (C-Style) for column major order (Fortran-style). One of enum CblasRowMajor or CblasColMajor.
    /// * side : If CBlasSideLeft, perform (sigma(A)(B) + beta C). If CBlasSideRight, perform (sigma (B)(A) + beta C)
    /// * uplo : Indicates whether to use the upper (CBlasUpper) or lower (CBlasLower) triangle of matrix A
    /// * M : Rows in matrices A and C
    /// * N : Columns in Matrices B and C
    /// * alpha : scalar factor for op(A)op(B)
    /// * A : matrix A
    /// * lda : The size of the first dimension of matrix A
    /// * B : matrix B
    /// * ldb : The size of the first dimension of matrix B
    /// * beta : scalar factor for C
    /// * C : matrix C
    /// * ldc : The size of the first dimension of matrix C
    pub fn ssymm(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, M: i32, N: i32, alpha: f32,
        A: &[f32], lda: i32, B: &[f32], ldb: i32, beta: f32, C: &mut [f32], ldc: i32) {
        unsafe { ::ffi::cblas_ssymm(order, side, uplo, M, N, alpha, A.as_ptr(), lda, B.as_ptr(), ldb, beta, C.as_mut_ptr(), ldc) }
    }

    pub fn ssyrk(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: f32,
        A: &[f32], lda: i32, beta: f32, C: &mut [f32], ldc: i32) {
        unsafe { ::ffi::cblas_ssyrk(order, uplo, trans, N, K, alpha, A.as_ptr(), lda, beta, C.as_mut_ptr(), ldc) }
    }

    pub fn ssyr2k(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: f32,
        A: &[f32], lda: i32, B: &[f32], ldb: i32, beta: f32, C: &mut [f32], ldc: i32) {
        unsafe { ::ffi::cblas_ssyr2k(order, uplo, trans, N, K, alpha, A.as_ptr(), lda, B.as_ptr(), ldb, beta, C.as_mut_ptr(), ldc) }
    }
    
    pub fn strmm(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: f32, A: &[f32], lda: i32, B: &mut [f32], ldb: i32) {
        unsafe { ::ffi::cblas_strmm(order, side, uplo, transA, diag, M, N, alpha, A.as_ptr(), lda, B.as_mut_ptr(), ldb) }
    }
    
    pub fn strsm(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: f32, A: &[f32], lda: i32, B: &mut [f32], ldb: i32) {
        unsafe { ::ffi::cblas_strsm(order, side, uplo, transA, diag, M, N, alpha, A.as_ptr(), lda, B.as_mut_ptr(), ldb) }
    }

    pub fn dgemm(order: ::cblas::Order, transA: ::cblas::Transpose, transB: ::cblas::Transpose, M: i32, N: i32,
        K: i32, alpha: f64, A: &[f64], lda: i32, B: &[f64], ldb: i32, beta: f64, C: &mut [f64], ldc: i32) {
        unsafe { ::ffi::cblas_dgemm(order, transA, transB, M, N, K, alpha, A.as_ptr(), lda, B.as_ptr(), ldb, beta, C.as_mut_ptr(), ldc) }
    }

    pub fn dsymm(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, M: i32, N: i32, alpha: f64,
        A: &[f64], lda: i32, B: &[f64], ldb: i32, beta: f64, C: &mut [f64], ldc: i32) {
        unsafe { ::ffi::cblas_dsymm(order, side, uplo, M, N, alpha, A.as_ptr(), lda, B.as_ptr(), ldb, beta, C.as_mut_ptr(), ldc) }
    }

    pub fn dsyrk(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: f64,
        A: &[f64], lda: i32, beta: f64, C: &mut [f64], ldc: i32) {
        unsafe { ::ffi::cblas_dsyrk(order, uplo, trans, N, K, alpha, A.as_ptr(), lda, beta, C.as_mut_ptr(), ldc) }
    }

    pub fn dsyr2k(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: f64,
        A: &[f64], lda: i32, B: &[f64], ldb: i32, beta: f64, C: &mut [f64], ldc: i32) {
        unsafe { ::ffi::cblas_dsyr2k(order, uplo, trans, N, K, alpha, A.as_ptr(), lda, B.as_ptr(), ldb, beta, C.as_mut_ptr(), ldc) }
    }
    
    pub fn dtrmm(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: f64, A: &[f64], lda: i32, B: &mut [f64], ldb: i32) {
        unsafe { ::ffi::cblas_dtrmm(order, side, uplo, transA, diag, M, N, alpha, A.as_ptr(), lda, B.as_mut_ptr(), ldb) }
    }
    
    pub fn dtrsm(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: f64, A: &[f64], lda: i32, B: &mut [f64], ldb: i32) {
        unsafe { ::ffi::cblas_dtrsm(order, side, uplo, transA, diag, M, N, alpha, A.as_ptr(), lda, B.as_mut_ptr(), ldb) }
    }

    pub fn cgemm<T>(order: ::cblas::Order, transA: ::cblas::Transpose, transB: ::cblas::Transpose, M: i32, N: i32,
        K: i32, alpha: &[T], A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_cgemm(order, transA, transB, M, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn csymm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, M: i32, N: i32, alpha: &[T],
        A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_csymm(order, side, uplo, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn csyrk<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: &[T],
        A: &[T], lda: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_csyrk(order, uplo, trans, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn csyr2k<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: &[T],
        A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_csyr2k(order, uplo, trans, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }
    
    pub fn ctrmm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: &[T], A: &[T], lda: i32, B: &mut [T], ldb: i32) {
        unsafe { ::ffi::cblas_ctrmm(order, side, uplo, transA, diag, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_mut_ptr() as *mut ::libc::c_void, ldb) }
    }
    
    pub fn ctrsm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: &[T], A: &[T], lda: i32, B: &mut [T], ldb: i32) {
        unsafe { ::ffi::cblas_ctrsm(order, side, uplo, transA, diag, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_mut_ptr() as *mut ::libc::c_void, ldb) }
    }

    pub fn zgemm<T>(order: ::cblas::Order, transA: ::cblas::Transpose, transB: ::cblas::Transpose, M: i32, N: i32,
        K: i32, alpha: &[T], A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_zgemm(order, transA, transB, M, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn zsymm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, M: i32, N: i32, alpha: &[T],
        A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_zsymm(order, side, uplo, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn zsyrk<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: &[T],
        A: &[T], lda: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_zsyrk(order, uplo, trans, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn zsyr2k<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: &[T],
        A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_zsyr2k(order, uplo, trans, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn ztrmm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: &[T], A: &[T], lda: i32, B: &mut [T], ldb: i32) {
        unsafe { ::ffi::cblas_ztrmm(order, side, uplo, transA, diag, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_mut_ptr() as *mut ::libc::c_void, ldb) }
    }

    pub fn ztrsm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, transA: ::cblas::Transpose,
        diag: ::cblas::Diag, M: i32, N: i32, alpha: &[T], A: &[T], lda: i32, B: &mut [T], ldb: i32) {
        unsafe { ::ffi::cblas_ztrsm(order, side, uplo, transA, diag, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_mut_ptr() as *mut ::libc::c_void, ldb) }
    }

    pub fn chemm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, M: i32, N: i32, alpha: &[T],
        A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_chemm(order, side, uplo, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn cherk<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32,
        alpha: &[T],  A: &[T], lda: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_cherk(order, uplo,trans, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn cher2k<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32,
        alpha: &[T],  A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_cher2k(order, uplo,trans, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn zhemm<T>(order: ::cblas::Order, side: ::cblas::Side, uplo: ::cblas::Uplo, M: i32, N: i32, alpha: &[T],
        A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_zhemm(order, side, uplo, M, N, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void,
            lda, B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn zherk<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: f64,
        A: &[T], lda: i32, beta: f64, C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_zherk(order, uplo, trans, N, K, alpha, A.as_ptr() as *const ::libc::c_void, lda, beta,
            C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }

    pub fn zher2k<T>(order: ::cblas::Order, uplo: ::cblas::Uplo, trans: ::cblas::Transpose, N: i32, K: i32, alpha: &[T],
        A: &[T], lda: i32, B: &[T], ldb: i32, beta: &[T], C: &mut [T], ldc: i32) {
        unsafe { ::ffi::cblas_zher2k(order, uplo, trans, N, K, alpha.as_ptr() as *const ::libc::c_void, A.as_ptr() as *const ::libc::c_void, lda,
            B.as_ptr() as *const ::libc::c_void, ldb, beta.as_ptr() as *const ::libc::c_void, C.as_mut_ptr() as *mut ::libc::c_void, ldc) }
    }
}