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
// Copyright 2014 Michael Yang. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

//! Bindings for matrix functions.

pub mod cblas_s {
    use libc::{c_float, c_int};
    use attribute::{
        Order,
        Transpose,
        Symmetry,
        Diagonal,
        Side,
    };

    pub use self::cblas_sgemm as gemm;
    pub use self::cblas_ssymm as symm;
    pub use self::cblas_strmm as trmm;
    pub use self::cblas_strsm as strsm;
    pub use self::cblas_ssyrk as syrk;
    pub use self::cblas_ssyr2k as syr2k;

    extern {
        pub fn cblas_sgemm(order: Order, trans_a: Transpose, trans_b: Transpose, m: c_int, n: c_int, k: c_int, alpha: c_float,       a: *const c_float,  lda: c_int, b: *const c_float,  ldb: c_int, beta: c_float,       c: *mut c_float,  ldc: c_int);
        pub fn cblas_ssymm(order: Order, side: Side, sym: Symmetry, m: c_int, n: c_int, alpha: c_float,       a: *const c_float,  lda: c_int, b: *const c_float,  ldb: c_int, beta: c_float,       c: *mut c_float,  ldc: c_int);
        pub fn cblas_strmm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: c_float,       a: *const c_float,  lda: c_int, b: *mut c_float,  ldb: c_int);
        pub fn cblas_strsm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: c_float,       a: *const c_float,  lda: c_int, b: *mut c_float,  ldb: c_int);
        pub fn cblas_ssyrk(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: c_float,       a: *const c_float,  lda: c_int, beta: c_float,       c: *mut c_float,  ldc: c_int);
        pub fn cblas_ssyr2k(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: c_float,       a: *const c_float,  lda: c_int, b: *const c_float,  ldb: c_int, beta: c_float,       c: *mut c_float,  ldc: c_int);
    }
}

pub mod cblas_d {
    use libc::{c_double, c_int};
    use attribute::{
        Order,
        Transpose,
        Symmetry,
        Diagonal,
        Side,
    };

    pub use self::cblas_dgemm as gemm;
    pub use self::cblas_dsymm as symm;
    pub use self::cblas_dtrmm as trmm;
    pub use self::cblas_dtrsm as strsm;
    pub use self::cblas_dsyrk as syrk;
    pub use self::cblas_dsyr2k as syr2k;

    extern {
        pub fn cblas_dgemm(order: Order, trans_a: Transpose, trans_b: Transpose, m: c_int, n: c_int, k: c_int, alpha: c_double,       a: *const c_double,  lda: c_int, b: *const c_double,  ldb: c_int, beta: c_double,       c: *mut c_double,  ldc: c_int);
        pub fn cblas_dsymm(order: Order, side: Side, sym: Symmetry, m: c_int, n: c_int, alpha: c_double,       a: *const c_double,  lda: c_int, b: *const c_double,  ldb: c_int, beta: c_double,       c: *mut c_double,  ldc: c_int);
        pub fn cblas_dtrmm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: c_double,       a: *const c_double,  lda: c_int, b: *mut c_double,  ldb: c_int);
        pub fn cblas_dtrsm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: c_double,       a: *const c_double,  lda: c_int, b: *mut c_double,  ldb: c_int);
        pub fn cblas_dsyrk(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: c_double,       a: *const c_double,  lda: c_int, beta: c_double,       c: *mut c_double,  ldc: c_int);
        pub fn cblas_dsyr2k(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: c_double,       a: *const c_double,  lda: c_int, b: *const c_double,  ldb: c_int, beta: c_double,       c: *mut c_double,  ldc: c_int);
    }
}

pub mod cblas_c {
    use libc::{c_float, c_int, c_void};
    use attribute::{
        Order,
        Transpose,
        Symmetry,
        Diagonal,
        Side,
    };

    pub use self::cblas_cgemm as gemm;
    pub use self::cblas_csymm as symm;
    pub use self::cblas_chemm as hemm;
    pub use self::cblas_ctrmm as trmm;
    pub use self::cblas_ctrsm as trsm;
    pub use self::cblas_cherk as herk;
    pub use self::cblas_cher2k as her2k;
    pub use self::cblas_csyrk as syrk;
    pub use self::cblas_csyr2k as syr2k;

    extern {
        pub fn cblas_cgemm(order: Order, trans_a: Transpose, trans_b: Transpose, m: c_int, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_csymm(order: Order, side: Side, sym: Symmetry, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_chemm(order: Order, side: Side, sym: Symmetry, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_ctrmm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *mut c_void,   ldb: c_int);
        pub fn cblas_ctrsm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *mut c_void,   ldb: c_int);
        pub fn cblas_cherk(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: c_float,  a: *const c_void, lda: c_int, beta: c_float,  c: *mut c_void, ldc: c_int);
        pub fn cblas_cher2k(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void, lda: c_int, b: *const c_void, ldb: c_int, beta: c_float,  c: *mut c_void, ldc: c_int);
        pub fn cblas_csyrk(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_csyr2k(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
    }
}

pub mod cblas_z {
    use libc::{c_double, c_int, c_void};
    use attribute::{
        Order,
        Transpose,
        Symmetry,
        Diagonal,
        Side,
    };

    pub use self::cblas_zgemm as gemm;
    pub use self::cblas_zsymm as symm;
    pub use self::cblas_zhemm as hemm;
    pub use self::cblas_ztrmm as trmm;
    pub use self::cblas_ztrsm as trsm;
    pub use self::cblas_zherk as herk;
    pub use self::cblas_zher2k as her2k;
    pub use self::cblas_zsyrk as syrk;
    pub use self::cblas_zsyr2k as syr2k;

    extern {
        pub fn cblas_zgemm(order: Order, trans_a: Transpose, trans_b: Transpose, m: c_int, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_zsymm(order: Order, side: Side, sym: Symmetry, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_zhemm(order: Order, side: Side, sym: Symmetry, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_ztrmm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *mut c_void,   ldb: c_int);
        pub fn cblas_ztrsm(order: Order, side: Side, sym: Symmetry, trans: Transpose, diag: Diagonal, m: c_int, n: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *mut c_void,   ldb: c_int);
        pub fn cblas_zherk(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: c_double, a: *const c_void, lda: c_int, beta: c_double, c: *mut c_void, ldc: c_int);
        pub fn cblas_zher2k(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void, lda: c_int, b: *const c_void, ldb: c_int, beta: c_double, c: *mut c_void, ldc: c_int);
        pub fn cblas_zsyrk(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
        pub fn cblas_zsyr2k(order: Order, sym: Symmetry, Trans: Transpose, n: c_int, k: c_int, alpha: *const c_void, a: *const c_void,   lda: c_int, b: *const c_void,   ldb: c_int, beta: *const c_void, c: *mut c_void,   ldc: c_int);
    }
}