├── .gitignore ├── Cargo.toml ├── .github └── workflows │ └── build.yml ├── README.md ├── bin ├── function.py ├── documentation.py └── generate.py ├── LICENSE.md └── src └── lib.rs /.gitignore: -------------------------------------------------------------------------------- 1 | Cargo.lock 2 | target 3 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "cblas" 3 | version = "0.5.0" 4 | edition = "2021" 5 | license = "Apache-2.0 OR MIT" 6 | authors = [ 7 | "Ivan Ukhov ", 8 | "Toshiki Teramura ", 9 | ] 10 | description = "The package provides wrappers for CBLAS (C)." 11 | documentation = "https://docs.rs/cblas" 12 | homepage = "https://github.com/blas-lapack-rs/cblas" 13 | repository = "https://github.com/blas-lapack-rs/cblas" 14 | readme = "README.md" 15 | categories = ["api-bindings", "science"] 16 | keywords = ["linear-algebra"] 17 | 18 | [dependencies] 19 | cblas-sys = "0.2" 20 | libc = "0.2" 21 | num-complex = { version = "0.4", default-features = false } 22 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: build 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | pull_request: 8 | branches: 9 | - main 10 | workflow_dispatch: 11 | 12 | concurrency: 13 | group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} 14 | cancel-in-progress: true 15 | 16 | jobs: 17 | check: 18 | runs-on: ubuntu-latest 19 | steps: 20 | - uses: actions/checkout@v4 21 | - run: rustup toolchain install stable --profile=minimal --component clippy --component rustfmt 22 | - run: cargo clippy -- -D warnings 23 | - run: cargo fmt --all -- --check 24 | 25 | test: 26 | runs-on: ubuntu-latest 27 | steps: 28 | - uses: actions/checkout@v4 29 | - run: rustup toolchain install stable --profile=minimal 30 | - run: cargo test 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CBLAS [![Package][package-img]][package-url] [![Documentation][documentation-img]][documentation-url] [![Build][build-img]][build-url] 2 | 3 | The package provides wrappers for [CBLAS] (C). 4 | 5 | ## [Architecture] 6 | 7 | ## Example 8 | 9 | ```rust 10 | use cblas::*; 11 | 12 | let (m, n, k) = (2, 4, 3); 13 | let a = vec![ 14 | 1.0, 4.0, 15 | 2.0, 5.0, 16 | 3.0, 6.0, 17 | ]; 18 | let b = vec![ 19 | 1.0, 5.0, 9.0, 20 | 2.0, 6.0, 10.0, 21 | 3.0, 7.0, 11.0, 22 | 4.0, 8.0, 12.0, 23 | ]; 24 | let mut c = vec![ 25 | 2.0, 7.0, 26 | 6.0, 2.0, 27 | 0.0, 7.0, 28 | 4.0, 2.0, 29 | ]; 30 | 31 | unsafe { 32 | dgemm(Layout::ColumnMajor, Transpose::None, Transpose::None, 33 | m, n, k, 1.0, &a, m, &b, k, 1.0, &mut c, m); 34 | } 35 | 36 | assert!( 37 | c == vec![ 38 | 40.0, 90.0, 39 | 50.0, 100.0, 40 | 50.0, 120.0, 41 | 60.0, 130.0, 42 | ] 43 | ); 44 | ``` 45 | 46 | ## Contribution 47 | 48 | Your contribution is highly appreciated. Do not hesitate to open an issue or a 49 | pull request. Note that any contribution submitted for inclusion in the project 50 | will be licensed according to the terms given in [LICENSE.md](LICENSE.md). 51 | 52 | [architecture]: https://blas-lapack-rs.github.io/architecture 53 | [cblas]: https://en.wikipedia.org/wiki/BLAS 54 | 55 | [build-img]: https://github.com/blas-lapack-rs/cblas/actions/workflows/build.yml/badge.svg 56 | [build-url]: https://github.com/blas-lapack-rs/cblas/actions/workflows/build.yml 57 | [documentation-img]: https://docs.rs/cblas/badge.svg 58 | [documentation-url]: https://docs.rs/cblas 59 | [package-img]: https://img.shields.io/crates/v/cblas.svg 60 | [package-url]: https://crates.io/crates/cblas 61 | -------------------------------------------------------------------------------- /bin/function.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | argument_re = re.compile("\s*(\w+): ([^,\)]+)([,\)\s]*)") 4 | name_re = re.compile("\s*pub fn (?:cblas_)?(\w+[a-z0-9])(_?)") 5 | return_re = re.compile("(?:\s*->\s*([^;]+))?") 6 | 7 | class Function(object): 8 | def __init__(self, level, name, args, ret): 9 | self.level = level 10 | self.name = name 11 | self.args = args 12 | self.ret = ret 13 | 14 | @staticmethod 15 | def parse(level, line): 16 | name, line = pull_name(line) 17 | if name is None: 18 | return None 19 | 20 | assert(line[0] == '(') 21 | line = line[1:] 22 | args = [] 23 | while True: 24 | arg, aty, line = pull_argument(line) 25 | if arg is None: 26 | break 27 | args.append((arg, aty)) 28 | line = line.strip() 29 | 30 | ret, line = pull_return(line) 31 | 32 | return Function(level, name, args, ret) 33 | 34 | def pull_argument(s): 35 | match = argument_re.match(s) 36 | if match is None: 37 | return None, None, s 38 | return match.group(1), match.group(2), s[match.end(3):] 39 | 40 | def pull_name(s): 41 | match = name_re.match(s) 42 | assert(match is not None) 43 | return match.group(1), s[match.end(2):] 44 | 45 | def pull_return(s): 46 | match = return_re.match(s) 47 | if match is None: 48 | return None, s 49 | return match.group(1), s[match.end(1):] 50 | 51 | def read_functions(path): 52 | sections = [] 53 | lines = [] 54 | with open(path) as file: 55 | append = False 56 | for line in file: 57 | if line == 'extern "C" {\n': 58 | append = True 59 | elif line == '}\n' and append: 60 | append = False 61 | sections.append(''.join(lines)) 62 | lines = [] 63 | elif append: 64 | lines.append(line) 65 | return sections 66 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | # License 2 | 3 | The project is dual licensed under the terms of the Apache License, Version 2.0, 4 | and the MIT License. You may obtain copies of the two licenses at 5 | 6 | * https://www.apache.org/licenses/LICENSE-2.0 and 7 | * https://opensource.org/licenses/MIT, respectively. 8 | 9 | The following two notices apply to every file of the project. 10 | 11 | ## The Apache License 12 | 13 | ``` 14 | Copyright 2017–2025 The cblas Developers 15 | 16 | Licensed under the Apache License, Version 2.0 (the “License”); you may not use 17 | this file except in compliance with the License. You may obtain a copy of the 18 | License at 19 | 20 | http://www.apache.org/licenses/LICENSE-2.0 21 | 22 | Unless required by applicable law or agreed to in writing, software distributed 23 | under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR 24 | CONDITIONS OF ANY KIND, either express or implied. See the License for the 25 | specific language governing permissions and limitations under the License. 26 | ``` 27 | 28 | ## The MIT License 29 | 30 | ``` 31 | Copyright 2017–2025 The cblas Developers 32 | 33 | Permission is hereby granted, free of charge, to any person obtaining a copy of 34 | this software and associated documentation files (the “Software”), to deal in 35 | the Software without restriction, including without limitation the rights to 36 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 37 | the Software, and to permit persons to whom the Software is furnished to do so, 38 | subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all 41 | copies or substantial portions of the Software. 42 | 43 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 44 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 45 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 46 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 47 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 48 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 49 | ``` 50 | -------------------------------------------------------------------------------- /bin/documentation.py: -------------------------------------------------------------------------------- 1 | import os, re, sys 2 | 3 | class Blob: 4 | def append(self, *_): 5 | pass 6 | 7 | def finish(self, *_): 8 | pass 9 | 10 | class Formula(Blob): 11 | def __init__(self): 12 | self.lines = [] 13 | 14 | def append(self, line): 15 | self.lines.append(line) 16 | 17 | def finish(self, *_): 18 | for i, line in enumerate(self.lines): 19 | assert(len(line[:3].strip()) == 0) 20 | line = re.sub(r"\s+", " ", line[3:]) 21 | line = re.sub(r"\(\s+", "(", line) 22 | line = re.sub(r"\s+\)", ")", line) 23 | self.lines[i] = line 24 | 25 | def format(self, output): 26 | output.write("/// ```text\n") 27 | for line in self.lines: 28 | output.write("/// {}\n".format(line)) 29 | output.write("/// ```\n") 30 | 31 | class Space(Blob): 32 | def format(self, output): 33 | output.write("///\n") 34 | 35 | class Text(Blob): 36 | def __init__(self): 37 | self.lines = [] 38 | 39 | def append(self, line): 40 | self.lines.append(line) 41 | 42 | def finish(self, index, total, f): 43 | lines = self.lines 44 | 45 | if index == 0: 46 | first = re.sub(r"(?i)\s*{}\s+".format(f.name), "", lines[0]) 47 | lines[0] = first 48 | 49 | line = " ".join(lines) 50 | line = re.sub(r"\s+", " ", line) 51 | line = re.sub(r"\(\s+", "(", line) 52 | line = re.sub(r"\s+\)", ")", line) 53 | 54 | if index == total - 1 and line[-1] != ".": 55 | line = "{}.".format(line) 56 | 57 | lines = line.split(". ") 58 | lowercase = ["alpha", "or", "where"] 59 | for i, line in enumerate(lines): 60 | if all([not line.startswith(word) for word in lowercase]): 61 | lines[i] = "{}{}".format(line[0].upper(), line[1:]) 62 | line = ". ".join(lines) 63 | 64 | substitutes = { 65 | "Compute": "Computes", 66 | "equal to 1": "equal to one", 67 | } 68 | for key, value in substitutes.items(): 69 | line = re.sub(r"\b{}\b".format(key), value, line) 70 | 71 | chunks = line.split(" ") 72 | lines = [] 73 | count = 0 74 | while len(chunks) > 0: 75 | current = " ".join(chunks[:count]) 76 | if count == len(chunks) or 4 + len(current) + len(chunks[count]) >= 80: 77 | lines.append(current) 78 | chunks = chunks[count:] 79 | count = 0 80 | else: 81 | count += 1 82 | 83 | self.lines = lines 84 | 85 | def format(self, output): 86 | for line in self.lines: 87 | output.write("/// {}\n".format(line)) 88 | 89 | def clean(lines): 90 | lines = [re.sub(r"^\*> ?", "", line.rstrip()) for line in lines] 91 | 92 | while len(lines) > 0 and lines[0].strip() == "": 93 | lines = lines[1:] 94 | 95 | while len(lines) > 0 and lines[-1].strip() == "": 96 | lines = lines[:-1] 97 | 98 | margin = 42 99 | for line in lines: 100 | if len(line.strip()) > 0: 101 | margin = min(margin, len(line) - len(line.strip())) 102 | for i, line in enumerate(lines): 103 | if len(line.strip()) > 0: 104 | lines[i] = lines[i][margin:] 105 | 106 | return lines 107 | 108 | def extract(filename): 109 | SEARCHING = 0 110 | IN_PURPOSE = 1 111 | IN_DESCRIPTION = 2 112 | 113 | lines = [] 114 | state = SEARCHING 115 | with open(filename) as file: 116 | for line in file: 117 | if state == SEARCHING: 118 | if "par Purpose" in line: 119 | state = IN_PURPOSE 120 | elif state == IN_PURPOSE: 121 | if "\\verbatim" in line: 122 | state = IN_DESCRIPTION 123 | elif state == IN_DESCRIPTION: 124 | if "\\endverbatim" in line: 125 | break 126 | lines.append(line.replace("\n", "")) 127 | 128 | return lines 129 | 130 | def partition(lines): 131 | paragraphs = [] 132 | current = None 133 | 134 | for line in lines: 135 | if line.startswith(" "): 136 | klass = Formula 137 | elif len(line) == 0: 138 | klass = Space 139 | else: 140 | klass = Text 141 | if not isinstance(current, klass): 142 | if current is not None: 143 | paragraphs.append(current) 144 | current = klass() 145 | current.append(line) 146 | 147 | if current is not None: 148 | paragraphs.append(current) 149 | 150 | return paragraphs 151 | 152 | def print_documentation(f, reference): 153 | filename = os.path.join(reference, "BLAS", "SRC", "{}.f".format(f.name)) 154 | if not os.path.exists(filename): 155 | return 156 | paragraphs = partition(clean(extract(filename))) 157 | for i, paragraph in enumerate(paragraphs): 158 | paragraph.finish(i, len(paragraphs), f) 159 | paragraph.format(sys.stdout) 160 | -------------------------------------------------------------------------------- /bin/generate.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from documentation import print_documentation 4 | from function import Function, read_functions 5 | import argparse 6 | import os 7 | import re 8 | 9 | level_scalars = { 10 | 1: ["alpha", "a", "b", "c", "z"], 11 | 2: ["alpha", "beta"], 12 | 3: ["alpha", "beta"], 13 | } 14 | 15 | def translate_argument(name, cty, f): 16 | if cty == "c_int": 17 | return "i32" 18 | 19 | elif cty == "CBLAS_DIAG": 20 | return "Diagonal" 21 | elif cty == "CBLAS_LAYOUT": 22 | return "Layout" 23 | elif cty == "CBLAS_SIDE": 24 | return "Side" 25 | elif cty == "CBLAS_TRANSPOSE": 26 | return "Transpose" 27 | elif cty == "CBLAS_UPLO": 28 | return "Part" 29 | 30 | base = translate_type_base(cty) 31 | 32 | if "*const" in cty: 33 | if is_scalar(name, cty, f): 34 | return base 35 | else: 36 | return "&[{}]".format(base) 37 | elif "*mut" in cty: 38 | if is_scalar(name, cty, f): 39 | return "&mut {}".format(base) 40 | else: 41 | return "&mut [{}]".format(base) 42 | 43 | return base 44 | 45 | def is_scalar(name, cty, f): 46 | return name in level_scalars[f.level] 47 | 48 | def translate_type_base(cty): 49 | if "c_double_complex" in cty: 50 | return "c64" 51 | elif "c_float_complex" in cty: 52 | return "c32" 53 | elif "double" in cty: 54 | return "f64" 55 | elif "float" in cty: 56 | return "f32" 57 | 58 | assert False, "cannot translate `{}`".format(cty) 59 | 60 | def translate_body_argument(name, rty): 61 | if rty == "i32": 62 | return name 63 | 64 | elif rty in ["Diagonal", "Layout", "Part", "Side", "Transpose"]: 65 | return "{}.into()".format(name) 66 | 67 | elif rty.startswith("f"): 68 | return name 69 | elif rty.startswith("&mut f"): 70 | return name 71 | elif rty.startswith("&[f"): 72 | return "{}.as_ptr()".format(name) 73 | elif rty.startswith("&mut [f"): 74 | return "{}.as_mut_ptr()".format(name) 75 | 76 | elif rty.startswith("c"): 77 | return "&{} as *const _ as *const _".format(name) 78 | elif rty.startswith("&mut c"): 79 | return "{} as *mut _ as *mut _".format(name) 80 | elif rty.startswith("&[c"): 81 | return "{}.as_ptr() as *const _".format(name) 82 | elif rty.startswith("&mut [c"): 83 | return "{}.as_mut_ptr() as *mut _".format(name) 84 | 85 | assert False, "cannot translate `{}: {}`".format(name, rty) 86 | 87 | def translate_return_type(cty): 88 | if cty == "c_int": 89 | return "i32" 90 | elif cty == "c_float": 91 | return "f32" 92 | elif cty == "c_double": 93 | return "f64" 94 | 95 | if cty == "CBLAS_INDEX": 96 | return "i32" 97 | 98 | assert False, "cannot translate `{}`".format(cty) 99 | 100 | def format_header(f): 101 | args = format_header_arguments(f) 102 | if f.ret is None: 103 | return "pub unsafe fn {}({})".format(f.name, args) 104 | else: 105 | return "pub unsafe fn {}({}) -> {}".format(f.name, args, translate_return_type(f.ret)) 106 | 107 | def format_body(f): 108 | args = format_body_arguments(f) 109 | ret = format_body_return(f) 110 | if ret is None: 111 | return "ffi::cblas_{}({})".format(f.name, args) 112 | else: 113 | return "ffi::cblas_{}({}) as {}".format(f.name, args, ret) 114 | 115 | def format_header_arguments(f): 116 | s = [] 117 | for arg in f.args: 118 | s.append("{}: {}".format(arg[0], translate_argument(*arg, f=f))) 119 | return ", ".join(s) 120 | 121 | def format_body_arguments(f): 122 | s = [] 123 | for arg in f.args: 124 | rty = translate_argument(*arg, f=f) 125 | s.append(translate_body_argument(arg[0], rty)) 126 | return ", ".join(s) 127 | 128 | def format_body_return(f): 129 | if f.ret is None: 130 | return None 131 | 132 | rty = translate_return_type(f.ret) 133 | if rty.startswith("f"): 134 | return None 135 | 136 | return rty 137 | 138 | def prepare(level, code): 139 | lines = filter(lambda line: not re.match(r'^\s*//.*', line), code.split('\n')) 140 | lines = re.sub(r'\s+', ' ', "".join(lines)).strip().split(';') 141 | lines = filter(lambda line: not re.match(r'^\s*$', line), lines) 142 | return [Function.parse(level, line) for line in lines] 143 | 144 | def do(functions, reference): 145 | for f in functions: 146 | if reference is not None: 147 | print_documentation(f, reference) 148 | print("\n#[inline]") 149 | print(format_header(f) + " {") 150 | print(" " + format_body(f) + "\n}") 151 | 152 | if __name__ == '__main__': 153 | parser = argparse.ArgumentParser() 154 | parser.add_argument('--sys', required=True) 155 | parser.add_argument('--doc') 156 | arguments = parser.parse_args() 157 | sections = read_functions(os.path.join(arguments.sys, 'src', 'lib.rs')) 158 | assert(len(sections) == 5) 159 | do(prepare(1, sections[0]), arguments.doc) 160 | do(prepare(1, sections[1]), arguments.doc) 161 | do(prepare(2, sections[2]), arguments.doc) 162 | do(prepare(3, sections[3]), arguments.doc) 163 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | //! Wrappers for [CBLAS] \(C). 2 | //! 3 | //! ## [Architecture] 4 | //! 5 | //! ## Example 6 | //! 7 | //! ```no_run 8 | //! use cblas::*; 9 | //! 10 | //! let (m, n, k) = (2, 4, 3); 11 | //! let a = vec![ 12 | //! 1.0, 4.0, 13 | //! 2.0, 5.0, 14 | //! 3.0, 6.0, 15 | //! ]; 16 | //! let b = vec![ 17 | //! 1.0, 5.0, 9.0, 18 | //! 2.0, 6.0, 10.0, 19 | //! 3.0, 7.0, 11.0, 20 | //! 4.0, 8.0, 12.0, 21 | //! ]; 22 | //! let mut c = vec![ 23 | //! 2.0, 7.0, 24 | //! 6.0, 2.0, 25 | //! 0.0, 7.0, 26 | //! 4.0, 2.0, 27 | //! ]; 28 | //! 29 | //! unsafe { 30 | //! dgemm(Layout::ColumnMajor, Transpose::None, Transpose::None, 31 | //! m, n, k, 1.0, &a, m, &b, k, 1.0, &mut c, m); 32 | //! } 33 | //! 34 | //! assert!( 35 | //! c == vec![ 36 | //! 40.0, 90.0, 37 | //! 50.0, 100.0, 38 | //! 50.0, 120.0, 39 | //! 60.0, 130.0, 40 | //! ] 41 | //! ); 42 | //! ``` 43 | //! 44 | //! [architecture]: https://blas-lapack-rs.github.io/architecture 45 | //! [cblas]: https://en.wikipedia.org/wiki/BLAS 46 | 47 | #![allow(clippy::missing_safety_doc, clippy::too_many_arguments)] 48 | 49 | extern crate cblas_sys as ffi; 50 | extern crate num_complex as num; 51 | 52 | /// A complex number with 32-bit parts. 53 | #[allow(non_camel_case_types)] 54 | pub type c32 = num::Complex; 55 | 56 | /// A complex number with 64-bit parts. 57 | #[allow(non_camel_case_types)] 58 | pub type c64 = num::Complex; 59 | 60 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] 61 | #[repr(C)] 62 | pub enum Diagonal { 63 | Generic = 131, 64 | Unit = 132, 65 | } 66 | 67 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] 68 | #[repr(C)] 69 | pub enum Layout { 70 | RowMajor = 101, 71 | ColumnMajor = 102, 72 | } 73 | 74 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] 75 | #[repr(C)] 76 | pub enum Part { 77 | Upper = 121, 78 | Lower = 122, 79 | } 80 | 81 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] 82 | #[repr(C)] 83 | pub enum Side { 84 | Left = 141, 85 | Right = 142, 86 | } 87 | 88 | #[derive(Clone, Copy, Debug, Eq, PartialEq)] 89 | #[repr(C)] 90 | pub enum Transpose { 91 | None = 111, 92 | Ordinary = 112, 93 | Conjugate = 113, 94 | } 95 | 96 | macro_rules! convert { 97 | ($($from:ident => $into:ident,)*) => ( 98 | $(impl From<$from> for ffi::$into { 99 | #[inline(always)] 100 | fn from(value: $from) -> ffi::$into { 101 | unsafe { ::std::mem::transmute(value) } 102 | } 103 | })* 104 | ); 105 | } 106 | 107 | convert! { 108 | Diagonal => CBLAS_DIAG, 109 | Layout => CBLAS_LAYOUT, 110 | Part => CBLAS_UPLO, 111 | Side => CBLAS_SIDE, 112 | Transpose => CBLAS_TRANSPOSE, 113 | } 114 | 115 | #[inline] 116 | pub unsafe fn dcabs1(z: c64) -> f64 { 117 | ffi::cblas_dcabs1(&z as *const _ as *const _) 118 | } 119 | 120 | #[inline] 121 | pub unsafe fn scabs1(c: c32) -> f32 { 122 | ffi::cblas_scabs1(&c as *const _ as *const _) 123 | } 124 | 125 | #[inline] 126 | pub unsafe fn sdsdot(n: i32, alpha: f32, x: &[f32], incx: i32, y: &[f32], incy: i32) -> f32 { 127 | ffi::cblas_sdsdot(n, alpha, x.as_ptr(), incx, y.as_ptr(), incy) 128 | } 129 | 130 | #[inline] 131 | pub unsafe fn dsdot(n: i32, x: &[f32], incx: i32, y: &[f32], incy: i32) -> f64 { 132 | ffi::cblas_dsdot(n, x.as_ptr(), incx, y.as_ptr(), incy) 133 | } 134 | 135 | #[inline] 136 | pub unsafe fn sdot(n: i32, x: &[f32], incx: i32, y: &[f32], incy: i32) -> f32 { 137 | ffi::cblas_sdot(n, x.as_ptr(), incx, y.as_ptr(), incy) 138 | } 139 | 140 | #[inline] 141 | pub unsafe fn ddot(n: i32, x: &[f64], incx: i32, y: &[f64], incy: i32) -> f64 { 142 | ffi::cblas_ddot(n, x.as_ptr(), incx, y.as_ptr(), incy) 143 | } 144 | 145 | #[inline] 146 | pub unsafe fn cdotu_sub(n: i32, x: &[c32], incx: i32, y: &[c32], incy: i32, dotu: &mut [c32]) { 147 | ffi::cblas_cdotu_sub( 148 | n, 149 | x.as_ptr() as *const _, 150 | incx, 151 | y.as_ptr() as *const _, 152 | incy, 153 | dotu.as_mut_ptr() as *mut _, 154 | ) 155 | } 156 | 157 | #[inline] 158 | pub unsafe fn cdotc_sub(n: i32, x: &[c32], incx: i32, y: &[c32], incy: i32, dotc: &mut [c32]) { 159 | ffi::cblas_cdotc_sub( 160 | n, 161 | x.as_ptr() as *const _, 162 | incx, 163 | y.as_ptr() as *const _, 164 | incy, 165 | dotc.as_mut_ptr() as *mut _, 166 | ) 167 | } 168 | 169 | #[inline] 170 | pub unsafe fn zdotu_sub(n: i32, x: &[c64], incx: i32, y: &[c64], incy: i32, dotu: &mut [c64]) { 171 | ffi::cblas_zdotu_sub( 172 | n, 173 | x.as_ptr() as *const _, 174 | incx, 175 | y.as_ptr() as *const _, 176 | incy, 177 | dotu.as_mut_ptr() as *mut _, 178 | ) 179 | } 180 | 181 | #[inline] 182 | pub unsafe fn zdotc_sub(n: i32, x: &[c64], incx: i32, y: &[c64], incy: i32, dotc: &mut [c64]) { 183 | ffi::cblas_zdotc_sub( 184 | n, 185 | x.as_ptr() as *const _, 186 | incx, 187 | y.as_ptr() as *const _, 188 | incy, 189 | dotc.as_mut_ptr() as *mut _, 190 | ) 191 | } 192 | 193 | #[inline] 194 | pub unsafe fn snrm2(n: i32, x: &[f32], incx: i32) -> f32 { 195 | ffi::cblas_snrm2(n, x.as_ptr(), incx) 196 | } 197 | 198 | #[inline] 199 | pub unsafe fn sasum(n: i32, x: &[f32], incx: i32) -> f32 { 200 | ffi::cblas_sasum(n, x.as_ptr(), incx) 201 | } 202 | 203 | #[inline] 204 | pub unsafe fn dnrm2(n: i32, x: &[f64], incx: i32) -> f64 { 205 | ffi::cblas_dnrm2(n, x.as_ptr(), incx) 206 | } 207 | 208 | #[inline] 209 | pub unsafe fn dasum(n: i32, x: &[f64], incx: i32) -> f64 { 210 | ffi::cblas_dasum(n, x.as_ptr(), incx) 211 | } 212 | 213 | #[inline] 214 | pub unsafe fn scnrm2(n: i32, x: &[c32], incx: i32) -> f32 { 215 | ffi::cblas_scnrm2(n, x.as_ptr() as *const _, incx) 216 | } 217 | 218 | #[inline] 219 | pub unsafe fn scasum(n: i32, x: &[c32], incx: i32) -> f32 { 220 | ffi::cblas_scasum(n, x.as_ptr() as *const _, incx) 221 | } 222 | 223 | #[inline] 224 | pub unsafe fn dznrm2(n: i32, x: &[c64], incx: i32) -> f64 { 225 | ffi::cblas_dznrm2(n, x.as_ptr() as *const _, incx) 226 | } 227 | 228 | #[inline] 229 | pub unsafe fn dzasum(n: i32, x: &[c64], incx: i32) -> f64 { 230 | ffi::cblas_dzasum(n, x.as_ptr() as *const _, incx) 231 | } 232 | 233 | #[inline] 234 | pub unsafe fn isamax(n: i32, x: &[f32], incx: i32) -> i32 { 235 | ffi::cblas_isamax(n, x.as_ptr(), incx) as i32 236 | } 237 | 238 | #[inline] 239 | pub unsafe fn idamax(n: i32, x: &[f64], incx: i32) -> i32 { 240 | ffi::cblas_idamax(n, x.as_ptr(), incx) as i32 241 | } 242 | 243 | #[inline] 244 | pub unsafe fn icamax(n: i32, x: &[c32], incx: i32) -> i32 { 245 | ffi::cblas_icamax(n, x.as_ptr() as *const _, incx) as i32 246 | } 247 | 248 | #[inline] 249 | pub unsafe fn izamax(n: i32, x: &[c64], incx: i32) -> i32 { 250 | ffi::cblas_izamax(n, x.as_ptr() as *const _, incx) as i32 251 | } 252 | 253 | #[inline] 254 | pub unsafe fn sswap(n: i32, x: &mut [f32], incx: i32, y: &mut [f32], incy: i32) { 255 | ffi::cblas_sswap(n, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy) 256 | } 257 | 258 | #[inline] 259 | pub unsafe fn scopy(n: i32, x: &[f32], incx: i32, y: &mut [f32], incy: i32) { 260 | ffi::cblas_scopy(n, x.as_ptr(), incx, y.as_mut_ptr(), incy) 261 | } 262 | 263 | #[inline] 264 | pub unsafe fn saxpy(n: i32, alpha: f32, x: &[f32], incx: i32, y: &mut [f32], incy: i32) { 265 | ffi::cblas_saxpy(n, alpha, x.as_ptr(), incx, y.as_mut_ptr(), incy) 266 | } 267 | 268 | #[inline] 269 | pub unsafe fn dswap(n: i32, x: &mut [f64], incx: i32, y: &mut [f64], incy: i32) { 270 | ffi::cblas_dswap(n, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy) 271 | } 272 | 273 | #[inline] 274 | pub unsafe fn dcopy(n: i32, x: &[f64], incx: i32, y: &mut [f64], incy: i32) { 275 | ffi::cblas_dcopy(n, x.as_ptr(), incx, y.as_mut_ptr(), incy) 276 | } 277 | 278 | #[inline] 279 | pub unsafe fn daxpy(n: i32, alpha: f64, x: &[f64], incx: i32, y: &mut [f64], incy: i32) { 280 | ffi::cblas_daxpy(n, alpha, x.as_ptr(), incx, y.as_mut_ptr(), incy) 281 | } 282 | 283 | #[inline] 284 | pub unsafe fn cswap(n: i32, x: &mut [c32], incx: i32, y: &mut [c32], incy: i32) { 285 | ffi::cblas_cswap( 286 | n, 287 | x.as_mut_ptr() as *mut _, 288 | incx, 289 | y.as_mut_ptr() as *mut _, 290 | incy, 291 | ) 292 | } 293 | 294 | #[inline] 295 | pub unsafe fn ccopy(n: i32, x: &[c32], incx: i32, y: &mut [c32], incy: i32) { 296 | ffi::cblas_ccopy( 297 | n, 298 | x.as_ptr() as *const _, 299 | incx, 300 | y.as_mut_ptr() as *mut _, 301 | incy, 302 | ) 303 | } 304 | 305 | #[inline] 306 | pub unsafe fn caxpy(n: i32, alpha: c32, x: &[c32], incx: i32, y: &mut [c32], incy: i32) { 307 | ffi::cblas_caxpy( 308 | n, 309 | &alpha as *const _ as *const _, 310 | x.as_ptr() as *const _, 311 | incx, 312 | y.as_mut_ptr() as *mut _, 313 | incy, 314 | ) 315 | } 316 | 317 | #[inline] 318 | pub unsafe fn zswap(n: i32, x: &mut [c64], incx: i32, y: &mut [c64], incy: i32) { 319 | ffi::cblas_zswap( 320 | n, 321 | x.as_mut_ptr() as *mut _, 322 | incx, 323 | y.as_mut_ptr() as *mut _, 324 | incy, 325 | ) 326 | } 327 | 328 | #[inline] 329 | pub unsafe fn zcopy(n: i32, x: &[c64], incx: i32, y: &mut [c64], incy: i32) { 330 | ffi::cblas_zcopy( 331 | n, 332 | x.as_ptr() as *const _, 333 | incx, 334 | y.as_mut_ptr() as *mut _, 335 | incy, 336 | ) 337 | } 338 | 339 | #[inline] 340 | pub unsafe fn zaxpy(n: i32, alpha: c64, x: &[c64], incx: i32, y: &mut [c64], incy: i32) { 341 | ffi::cblas_zaxpy( 342 | n, 343 | &alpha as *const _ as *const _, 344 | x.as_ptr() as *const _, 345 | incx, 346 | y.as_mut_ptr() as *mut _, 347 | incy, 348 | ) 349 | } 350 | 351 | #[inline] 352 | pub unsafe fn srotg(a: &mut f32, b: &mut f32, c: &mut f32, s: &mut [f32]) { 353 | ffi::cblas_srotg(a, b, c, s.as_mut_ptr()) 354 | } 355 | 356 | #[inline] 357 | pub unsafe fn srotmg(d1: &mut [f32], d2: &mut [f32], b1: &mut [f32], b2: f32, p: &mut [f32]) { 358 | ffi::cblas_srotmg( 359 | d1.as_mut_ptr(), 360 | d2.as_mut_ptr(), 361 | b1.as_mut_ptr(), 362 | b2, 363 | p.as_mut_ptr(), 364 | ) 365 | } 366 | 367 | #[inline] 368 | pub unsafe fn srot(n: i32, x: &mut [f32], incx: i32, y: &mut [f32], incy: i32, c: f32, s: f32) { 369 | ffi::cblas_srot(n, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, c, s) 370 | } 371 | 372 | #[inline] 373 | pub unsafe fn srotm(n: i32, x: &mut [f32], incx: i32, y: &mut [f32], incy: i32, p: &[f32]) { 374 | ffi::cblas_srotm(n, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, p.as_ptr()) 375 | } 376 | 377 | #[inline] 378 | pub unsafe fn drotg(a: &mut f64, b: &mut f64, c: &mut f64, s: &mut [f64]) { 379 | ffi::cblas_drotg(a, b, c, s.as_mut_ptr()) 380 | } 381 | 382 | #[inline] 383 | pub unsafe fn drotmg(d1: &mut [f64], d2: &mut [f64], b1: &mut [f64], b2: f64, p: &mut [f64]) { 384 | ffi::cblas_drotmg( 385 | d1.as_mut_ptr(), 386 | d2.as_mut_ptr(), 387 | b1.as_mut_ptr(), 388 | b2, 389 | p.as_mut_ptr(), 390 | ) 391 | } 392 | 393 | #[inline] 394 | pub unsafe fn drot(n: i32, x: &mut [f64], incx: i32, y: &mut [f64], incy: i32, c: f64, s: f64) { 395 | ffi::cblas_drot(n, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, c, s) 396 | } 397 | 398 | #[inline] 399 | pub unsafe fn drotm(n: i32, x: &mut [f64], incx: i32, y: &mut [f64], incy: i32, p: &[f64]) { 400 | ffi::cblas_drotm(n, x.as_mut_ptr(), incx, y.as_mut_ptr(), incy, p.as_ptr()) 401 | } 402 | 403 | #[inline] 404 | pub unsafe fn sscal(n: i32, alpha: f32, x: &mut [f32], incx: i32) { 405 | ffi::cblas_sscal(n, alpha, x.as_mut_ptr(), incx) 406 | } 407 | 408 | #[inline] 409 | pub unsafe fn dscal(n: i32, alpha: f64, x: &mut [f64], incx: i32) { 410 | ffi::cblas_dscal(n, alpha, x.as_mut_ptr(), incx) 411 | } 412 | 413 | #[inline] 414 | pub unsafe fn cscal(n: i32, alpha: c32, x: &mut [c32], incx: i32) { 415 | ffi::cblas_cscal( 416 | n, 417 | &alpha as *const _ as *const _, 418 | x.as_mut_ptr() as *mut _, 419 | incx, 420 | ) 421 | } 422 | 423 | #[inline] 424 | pub unsafe fn zscal(n: i32, alpha: c64, x: &mut [c64], incx: i32) { 425 | ffi::cblas_zscal( 426 | n, 427 | &alpha as *const _ as *const _, 428 | x.as_mut_ptr() as *mut _, 429 | incx, 430 | ) 431 | } 432 | 433 | #[inline] 434 | pub unsafe fn csscal(n: i32, alpha: f32, x: &mut [c32], incx: i32) { 435 | ffi::cblas_csscal(n, alpha, x.as_mut_ptr() as *mut _, incx) 436 | } 437 | 438 | #[inline] 439 | pub unsafe fn zdscal(n: i32, alpha: f64, x: &mut [c64], incx: i32) { 440 | ffi::cblas_zdscal(n, alpha, x.as_mut_ptr() as *mut _, incx) 441 | } 442 | 443 | #[inline] 444 | pub unsafe fn sgemv( 445 | layout: Layout, 446 | transa: Transpose, 447 | m: i32, 448 | n: i32, 449 | alpha: f32, 450 | a: &[f32], 451 | lda: i32, 452 | x: &[f32], 453 | incx: i32, 454 | beta: f32, 455 | y: &mut [f32], 456 | incy: i32, 457 | ) { 458 | ffi::cblas_sgemv( 459 | layout.into(), 460 | transa.into(), 461 | m, 462 | n, 463 | alpha, 464 | a.as_ptr(), 465 | lda, 466 | x.as_ptr(), 467 | incx, 468 | beta, 469 | y.as_mut_ptr(), 470 | incy, 471 | ) 472 | } 473 | 474 | #[inline] 475 | pub unsafe fn sgbmv( 476 | layout: Layout, 477 | transa: Transpose, 478 | m: i32, 479 | n: i32, 480 | kl: i32, 481 | ku: i32, 482 | alpha: f32, 483 | a: &[f32], 484 | lda: i32, 485 | x: &[f32], 486 | incx: i32, 487 | beta: f32, 488 | y: &mut [f32], 489 | incy: i32, 490 | ) { 491 | ffi::cblas_sgbmv( 492 | layout.into(), 493 | transa.into(), 494 | m, 495 | n, 496 | kl, 497 | ku, 498 | alpha, 499 | a.as_ptr(), 500 | lda, 501 | x.as_ptr(), 502 | incx, 503 | beta, 504 | y.as_mut_ptr(), 505 | incy, 506 | ) 507 | } 508 | 509 | #[inline] 510 | pub unsafe fn strmv( 511 | layout: Layout, 512 | uplo: Part, 513 | transa: Transpose, 514 | diag: Diagonal, 515 | n: i32, 516 | a: &[f32], 517 | lda: i32, 518 | x: &mut [f32], 519 | incx: i32, 520 | ) { 521 | ffi::cblas_strmv( 522 | layout.into(), 523 | uplo.into(), 524 | transa.into(), 525 | diag.into(), 526 | n, 527 | a.as_ptr(), 528 | lda, 529 | x.as_mut_ptr(), 530 | incx, 531 | ) 532 | } 533 | 534 | #[inline] 535 | pub unsafe fn stbmv( 536 | layout: Layout, 537 | uplo: Part, 538 | transa: Transpose, 539 | diag: Diagonal, 540 | n: i32, 541 | k: i32, 542 | a: &[f32], 543 | lda: i32, 544 | x: &mut [f32], 545 | incx: i32, 546 | ) { 547 | ffi::cblas_stbmv( 548 | layout.into(), 549 | uplo.into(), 550 | transa.into(), 551 | diag.into(), 552 | n, 553 | k, 554 | a.as_ptr(), 555 | lda, 556 | x.as_mut_ptr(), 557 | incx, 558 | ) 559 | } 560 | 561 | #[inline] 562 | pub unsafe fn stpmv( 563 | layout: Layout, 564 | uplo: Part, 565 | transa: Transpose, 566 | diag: Diagonal, 567 | n: i32, 568 | ap: &[f32], 569 | x: &mut [f32], 570 | incx: i32, 571 | ) { 572 | ffi::cblas_stpmv( 573 | layout.into(), 574 | uplo.into(), 575 | transa.into(), 576 | diag.into(), 577 | n, 578 | ap.as_ptr(), 579 | x.as_mut_ptr(), 580 | incx, 581 | ) 582 | } 583 | 584 | #[inline] 585 | pub unsafe fn strsv( 586 | layout: Layout, 587 | uplo: Part, 588 | transa: Transpose, 589 | diag: Diagonal, 590 | n: i32, 591 | a: &[f32], 592 | lda: i32, 593 | x: &mut [f32], 594 | incx: i32, 595 | ) { 596 | ffi::cblas_strsv( 597 | layout.into(), 598 | uplo.into(), 599 | transa.into(), 600 | diag.into(), 601 | n, 602 | a.as_ptr(), 603 | lda, 604 | x.as_mut_ptr(), 605 | incx, 606 | ) 607 | } 608 | 609 | #[inline] 610 | pub unsafe fn stbsv( 611 | layout: Layout, 612 | uplo: Part, 613 | transa: Transpose, 614 | diag: Diagonal, 615 | n: i32, 616 | k: i32, 617 | a: &[f32], 618 | lda: i32, 619 | x: &mut [f32], 620 | incx: i32, 621 | ) { 622 | ffi::cblas_stbsv( 623 | layout.into(), 624 | uplo.into(), 625 | transa.into(), 626 | diag.into(), 627 | n, 628 | k, 629 | a.as_ptr(), 630 | lda, 631 | x.as_mut_ptr(), 632 | incx, 633 | ) 634 | } 635 | 636 | #[inline] 637 | pub unsafe fn stpsv( 638 | layout: Layout, 639 | uplo: Part, 640 | transa: Transpose, 641 | diag: Diagonal, 642 | n: i32, 643 | ap: &[f32], 644 | x: &mut [f32], 645 | incx: i32, 646 | ) { 647 | ffi::cblas_stpsv( 648 | layout.into(), 649 | uplo.into(), 650 | transa.into(), 651 | diag.into(), 652 | n, 653 | ap.as_ptr(), 654 | x.as_mut_ptr(), 655 | incx, 656 | ) 657 | } 658 | 659 | #[inline] 660 | pub unsafe fn dgemv( 661 | layout: Layout, 662 | transa: Transpose, 663 | m: i32, 664 | n: i32, 665 | alpha: f64, 666 | a: &[f64], 667 | lda: i32, 668 | x: &[f64], 669 | incx: i32, 670 | beta: f64, 671 | y: &mut [f64], 672 | incy: i32, 673 | ) { 674 | ffi::cblas_dgemv( 675 | layout.into(), 676 | transa.into(), 677 | m, 678 | n, 679 | alpha, 680 | a.as_ptr(), 681 | lda, 682 | x.as_ptr(), 683 | incx, 684 | beta, 685 | y.as_mut_ptr(), 686 | incy, 687 | ) 688 | } 689 | 690 | #[inline] 691 | pub unsafe fn dgbmv( 692 | layout: Layout, 693 | transa: Transpose, 694 | m: i32, 695 | n: i32, 696 | kl: i32, 697 | ku: i32, 698 | alpha: f64, 699 | a: &[f64], 700 | lda: i32, 701 | x: &[f64], 702 | incx: i32, 703 | beta: f64, 704 | y: &mut [f64], 705 | incy: i32, 706 | ) { 707 | ffi::cblas_dgbmv( 708 | layout.into(), 709 | transa.into(), 710 | m, 711 | n, 712 | kl, 713 | ku, 714 | alpha, 715 | a.as_ptr(), 716 | lda, 717 | x.as_ptr(), 718 | incx, 719 | beta, 720 | y.as_mut_ptr(), 721 | incy, 722 | ) 723 | } 724 | 725 | #[inline] 726 | pub unsafe fn dtrmv( 727 | layout: Layout, 728 | uplo: Part, 729 | transa: Transpose, 730 | diag: Diagonal, 731 | n: i32, 732 | a: &[f64], 733 | lda: i32, 734 | x: &mut [f64], 735 | incx: i32, 736 | ) { 737 | ffi::cblas_dtrmv( 738 | layout.into(), 739 | uplo.into(), 740 | transa.into(), 741 | diag.into(), 742 | n, 743 | a.as_ptr(), 744 | lda, 745 | x.as_mut_ptr(), 746 | incx, 747 | ) 748 | } 749 | 750 | #[inline] 751 | pub unsafe fn dtbmv( 752 | layout: Layout, 753 | uplo: Part, 754 | transa: Transpose, 755 | diag: Diagonal, 756 | n: i32, 757 | k: i32, 758 | a: &[f64], 759 | lda: i32, 760 | x: &mut [f64], 761 | incx: i32, 762 | ) { 763 | ffi::cblas_dtbmv( 764 | layout.into(), 765 | uplo.into(), 766 | transa.into(), 767 | diag.into(), 768 | n, 769 | k, 770 | a.as_ptr(), 771 | lda, 772 | x.as_mut_ptr(), 773 | incx, 774 | ) 775 | } 776 | 777 | #[inline] 778 | pub unsafe fn dtpmv( 779 | layout: Layout, 780 | uplo: Part, 781 | transa: Transpose, 782 | diag: Diagonal, 783 | n: i32, 784 | ap: &[f64], 785 | x: &mut [f64], 786 | incx: i32, 787 | ) { 788 | ffi::cblas_dtpmv( 789 | layout.into(), 790 | uplo.into(), 791 | transa.into(), 792 | diag.into(), 793 | n, 794 | ap.as_ptr(), 795 | x.as_mut_ptr(), 796 | incx, 797 | ) 798 | } 799 | 800 | #[inline] 801 | pub unsafe fn dtrsv( 802 | layout: Layout, 803 | uplo: Part, 804 | transa: Transpose, 805 | diag: Diagonal, 806 | n: i32, 807 | a: &[f64], 808 | lda: i32, 809 | x: &mut [f64], 810 | incx: i32, 811 | ) { 812 | ffi::cblas_dtrsv( 813 | layout.into(), 814 | uplo.into(), 815 | transa.into(), 816 | diag.into(), 817 | n, 818 | a.as_ptr(), 819 | lda, 820 | x.as_mut_ptr(), 821 | incx, 822 | ) 823 | } 824 | 825 | #[inline] 826 | pub unsafe fn dtbsv( 827 | layout: Layout, 828 | uplo: Part, 829 | transa: Transpose, 830 | diag: Diagonal, 831 | n: i32, 832 | k: i32, 833 | a: &[f64], 834 | lda: i32, 835 | x: &mut [f64], 836 | incx: i32, 837 | ) { 838 | ffi::cblas_dtbsv( 839 | layout.into(), 840 | uplo.into(), 841 | transa.into(), 842 | diag.into(), 843 | n, 844 | k, 845 | a.as_ptr(), 846 | lda, 847 | x.as_mut_ptr(), 848 | incx, 849 | ) 850 | } 851 | 852 | #[inline] 853 | pub unsafe fn dtpsv( 854 | layout: Layout, 855 | uplo: Part, 856 | transa: Transpose, 857 | diag: Diagonal, 858 | n: i32, 859 | ap: &[f64], 860 | x: &mut [f64], 861 | incx: i32, 862 | ) { 863 | ffi::cblas_dtpsv( 864 | layout.into(), 865 | uplo.into(), 866 | transa.into(), 867 | diag.into(), 868 | n, 869 | ap.as_ptr(), 870 | x.as_mut_ptr(), 871 | incx, 872 | ) 873 | } 874 | 875 | #[inline] 876 | pub unsafe fn cgemv( 877 | layout: Layout, 878 | transa: Transpose, 879 | m: i32, 880 | n: i32, 881 | alpha: c32, 882 | a: &[c32], 883 | lda: i32, 884 | x: &[c32], 885 | incx: i32, 886 | beta: c32, 887 | y: &mut [c32], 888 | incy: i32, 889 | ) { 890 | ffi::cblas_cgemv( 891 | layout.into(), 892 | transa.into(), 893 | m, 894 | n, 895 | &alpha as *const _ as *const _, 896 | a.as_ptr() as *const _, 897 | lda, 898 | x.as_ptr() as *const _, 899 | incx, 900 | &beta as *const _ as *const _, 901 | y.as_mut_ptr() as *mut _, 902 | incy, 903 | ) 904 | } 905 | 906 | #[inline] 907 | pub unsafe fn cgbmv( 908 | layout: Layout, 909 | transa: Transpose, 910 | m: i32, 911 | n: i32, 912 | kl: i32, 913 | ku: i32, 914 | alpha: c32, 915 | a: &[c32], 916 | lda: i32, 917 | x: &[c32], 918 | incx: i32, 919 | beta: c32, 920 | y: &mut [c32], 921 | incy: i32, 922 | ) { 923 | ffi::cblas_cgbmv( 924 | layout.into(), 925 | transa.into(), 926 | m, 927 | n, 928 | kl, 929 | ku, 930 | &alpha as *const _ as *const _, 931 | a.as_ptr() as *const _, 932 | lda, 933 | x.as_ptr() as *const _, 934 | incx, 935 | &beta as *const _ as *const _, 936 | y.as_mut_ptr() as *mut _, 937 | incy, 938 | ) 939 | } 940 | 941 | #[inline] 942 | pub unsafe fn ctrmv( 943 | layout: Layout, 944 | uplo: Part, 945 | transa: Transpose, 946 | diag: Diagonal, 947 | n: i32, 948 | a: &[c32], 949 | lda: i32, 950 | x: &mut [c32], 951 | incx: i32, 952 | ) { 953 | ffi::cblas_ctrmv( 954 | layout.into(), 955 | uplo.into(), 956 | transa.into(), 957 | diag.into(), 958 | n, 959 | a.as_ptr() as *const _, 960 | lda, 961 | x.as_mut_ptr() as *mut _, 962 | incx, 963 | ) 964 | } 965 | 966 | #[inline] 967 | pub unsafe fn ctbmv( 968 | layout: Layout, 969 | uplo: Part, 970 | transa: Transpose, 971 | diag: Diagonal, 972 | n: i32, 973 | k: i32, 974 | a: &[c32], 975 | lda: i32, 976 | x: &mut [c32], 977 | incx: i32, 978 | ) { 979 | ffi::cblas_ctbmv( 980 | layout.into(), 981 | uplo.into(), 982 | transa.into(), 983 | diag.into(), 984 | n, 985 | k, 986 | a.as_ptr() as *const _, 987 | lda, 988 | x.as_mut_ptr() as *mut _, 989 | incx, 990 | ) 991 | } 992 | 993 | #[inline] 994 | pub unsafe fn ctpmv( 995 | layout: Layout, 996 | uplo: Part, 997 | transa: Transpose, 998 | diag: Diagonal, 999 | n: i32, 1000 | ap: &[c32], 1001 | x: &mut [c32], 1002 | incx: i32, 1003 | ) { 1004 | ffi::cblas_ctpmv( 1005 | layout.into(), 1006 | uplo.into(), 1007 | transa.into(), 1008 | diag.into(), 1009 | n, 1010 | ap.as_ptr() as *const _, 1011 | x.as_mut_ptr() as *mut _, 1012 | incx, 1013 | ) 1014 | } 1015 | 1016 | #[inline] 1017 | pub unsafe fn ctrsv( 1018 | layout: Layout, 1019 | uplo: Part, 1020 | transa: Transpose, 1021 | diag: Diagonal, 1022 | n: i32, 1023 | a: &[c32], 1024 | lda: i32, 1025 | x: &mut [c32], 1026 | incx: i32, 1027 | ) { 1028 | ffi::cblas_ctrsv( 1029 | layout.into(), 1030 | uplo.into(), 1031 | transa.into(), 1032 | diag.into(), 1033 | n, 1034 | a.as_ptr() as *const _, 1035 | lda, 1036 | x.as_mut_ptr() as *mut _, 1037 | incx, 1038 | ) 1039 | } 1040 | 1041 | #[inline] 1042 | pub unsafe fn ctbsv( 1043 | layout: Layout, 1044 | uplo: Part, 1045 | transa: Transpose, 1046 | diag: Diagonal, 1047 | n: i32, 1048 | k: i32, 1049 | a: &[c32], 1050 | lda: i32, 1051 | x: &mut [c32], 1052 | incx: i32, 1053 | ) { 1054 | ffi::cblas_ctbsv( 1055 | layout.into(), 1056 | uplo.into(), 1057 | transa.into(), 1058 | diag.into(), 1059 | n, 1060 | k, 1061 | a.as_ptr() as *const _, 1062 | lda, 1063 | x.as_mut_ptr() as *mut _, 1064 | incx, 1065 | ) 1066 | } 1067 | 1068 | #[inline] 1069 | pub unsafe fn ctpsv( 1070 | layout: Layout, 1071 | uplo: Part, 1072 | transa: Transpose, 1073 | diag: Diagonal, 1074 | n: i32, 1075 | ap: &[c32], 1076 | x: &mut [c32], 1077 | incx: i32, 1078 | ) { 1079 | ffi::cblas_ctpsv( 1080 | layout.into(), 1081 | uplo.into(), 1082 | transa.into(), 1083 | diag.into(), 1084 | n, 1085 | ap.as_ptr() as *const _, 1086 | x.as_mut_ptr() as *mut _, 1087 | incx, 1088 | ) 1089 | } 1090 | 1091 | #[inline] 1092 | pub unsafe fn zgemv( 1093 | layout: Layout, 1094 | transa: Transpose, 1095 | m: i32, 1096 | n: i32, 1097 | alpha: c64, 1098 | a: &[c64], 1099 | lda: i32, 1100 | x: &[c64], 1101 | incx: i32, 1102 | beta: c64, 1103 | y: &mut [c64], 1104 | incy: i32, 1105 | ) { 1106 | ffi::cblas_zgemv( 1107 | layout.into(), 1108 | transa.into(), 1109 | m, 1110 | n, 1111 | &alpha as *const _ as *const _, 1112 | a.as_ptr() as *const _, 1113 | lda, 1114 | x.as_ptr() as *const _, 1115 | incx, 1116 | &beta as *const _ as *const _, 1117 | y.as_mut_ptr() as *mut _, 1118 | incy, 1119 | ) 1120 | } 1121 | 1122 | #[inline] 1123 | pub unsafe fn zgbmv( 1124 | layout: Layout, 1125 | transa: Transpose, 1126 | m: i32, 1127 | n: i32, 1128 | kl: i32, 1129 | ku: i32, 1130 | alpha: c64, 1131 | a: &[c64], 1132 | lda: i32, 1133 | x: &[c64], 1134 | incx: i32, 1135 | beta: c64, 1136 | y: &mut [c64], 1137 | incy: i32, 1138 | ) { 1139 | ffi::cblas_zgbmv( 1140 | layout.into(), 1141 | transa.into(), 1142 | m, 1143 | n, 1144 | kl, 1145 | ku, 1146 | &alpha as *const _ as *const _, 1147 | a.as_ptr() as *const _, 1148 | lda, 1149 | x.as_ptr() as *const _, 1150 | incx, 1151 | &beta as *const _ as *const _, 1152 | y.as_mut_ptr() as *mut _, 1153 | incy, 1154 | ) 1155 | } 1156 | 1157 | #[inline] 1158 | pub unsafe fn ztrmv( 1159 | layout: Layout, 1160 | uplo: Part, 1161 | transa: Transpose, 1162 | diag: Diagonal, 1163 | n: i32, 1164 | a: &[c64], 1165 | lda: i32, 1166 | x: &mut [c64], 1167 | incx: i32, 1168 | ) { 1169 | ffi::cblas_ztrmv( 1170 | layout.into(), 1171 | uplo.into(), 1172 | transa.into(), 1173 | diag.into(), 1174 | n, 1175 | a.as_ptr() as *const _, 1176 | lda, 1177 | x.as_mut_ptr() as *mut _, 1178 | incx, 1179 | ) 1180 | } 1181 | 1182 | #[inline] 1183 | pub unsafe fn ztbmv( 1184 | layout: Layout, 1185 | uplo: Part, 1186 | transa: Transpose, 1187 | diag: Diagonal, 1188 | n: i32, 1189 | k: i32, 1190 | a: &[c64], 1191 | lda: i32, 1192 | x: &mut [c64], 1193 | incx: i32, 1194 | ) { 1195 | ffi::cblas_ztbmv( 1196 | layout.into(), 1197 | uplo.into(), 1198 | transa.into(), 1199 | diag.into(), 1200 | n, 1201 | k, 1202 | a.as_ptr() as *const _, 1203 | lda, 1204 | x.as_mut_ptr() as *mut _, 1205 | incx, 1206 | ) 1207 | } 1208 | 1209 | #[inline] 1210 | pub unsafe fn ztpmv( 1211 | layout: Layout, 1212 | uplo: Part, 1213 | transa: Transpose, 1214 | diag: Diagonal, 1215 | n: i32, 1216 | ap: &[c64], 1217 | x: &mut [c64], 1218 | incx: i32, 1219 | ) { 1220 | ffi::cblas_ztpmv( 1221 | layout.into(), 1222 | uplo.into(), 1223 | transa.into(), 1224 | diag.into(), 1225 | n, 1226 | ap.as_ptr() as *const _, 1227 | x.as_mut_ptr() as *mut _, 1228 | incx, 1229 | ) 1230 | } 1231 | 1232 | #[inline] 1233 | pub unsafe fn ztrsv( 1234 | layout: Layout, 1235 | uplo: Part, 1236 | transa: Transpose, 1237 | diag: Diagonal, 1238 | n: i32, 1239 | a: &[c64], 1240 | lda: i32, 1241 | x: &mut [c64], 1242 | incx: i32, 1243 | ) { 1244 | ffi::cblas_ztrsv( 1245 | layout.into(), 1246 | uplo.into(), 1247 | transa.into(), 1248 | diag.into(), 1249 | n, 1250 | a.as_ptr() as *const _, 1251 | lda, 1252 | x.as_mut_ptr() as *mut _, 1253 | incx, 1254 | ) 1255 | } 1256 | 1257 | #[inline] 1258 | pub unsafe fn ztbsv( 1259 | layout: Layout, 1260 | uplo: Part, 1261 | transa: Transpose, 1262 | diag: Diagonal, 1263 | n: i32, 1264 | k: i32, 1265 | a: &[c64], 1266 | lda: i32, 1267 | x: &mut [c64], 1268 | incx: i32, 1269 | ) { 1270 | ffi::cblas_ztbsv( 1271 | layout.into(), 1272 | uplo.into(), 1273 | transa.into(), 1274 | diag.into(), 1275 | n, 1276 | k, 1277 | a.as_ptr() as *const _, 1278 | lda, 1279 | x.as_mut_ptr() as *mut _, 1280 | incx, 1281 | ) 1282 | } 1283 | 1284 | #[inline] 1285 | pub unsafe fn ztpsv( 1286 | layout: Layout, 1287 | uplo: Part, 1288 | transa: Transpose, 1289 | diag: Diagonal, 1290 | n: i32, 1291 | ap: &[c64], 1292 | x: &mut [c64], 1293 | incx: i32, 1294 | ) { 1295 | ffi::cblas_ztpsv( 1296 | layout.into(), 1297 | uplo.into(), 1298 | transa.into(), 1299 | diag.into(), 1300 | n, 1301 | ap.as_ptr() as *const _, 1302 | x.as_mut_ptr() as *mut _, 1303 | incx, 1304 | ) 1305 | } 1306 | 1307 | #[inline] 1308 | pub unsafe fn ssymv( 1309 | layout: Layout, 1310 | uplo: Part, 1311 | n: i32, 1312 | alpha: f32, 1313 | a: &[f32], 1314 | lda: i32, 1315 | x: &[f32], 1316 | incx: i32, 1317 | beta: f32, 1318 | y: &mut [f32], 1319 | incy: i32, 1320 | ) { 1321 | ffi::cblas_ssymv( 1322 | layout.into(), 1323 | uplo.into(), 1324 | n, 1325 | alpha, 1326 | a.as_ptr(), 1327 | lda, 1328 | x.as_ptr(), 1329 | incx, 1330 | beta, 1331 | y.as_mut_ptr(), 1332 | incy, 1333 | ) 1334 | } 1335 | 1336 | #[inline] 1337 | pub unsafe fn ssbmv( 1338 | layout: Layout, 1339 | uplo: Part, 1340 | n: i32, 1341 | k: i32, 1342 | alpha: f32, 1343 | a: &[f32], 1344 | lda: i32, 1345 | x: &[f32], 1346 | incx: i32, 1347 | beta: f32, 1348 | y: &mut [f32], 1349 | incy: i32, 1350 | ) { 1351 | ffi::cblas_ssbmv( 1352 | layout.into(), 1353 | uplo.into(), 1354 | n, 1355 | k, 1356 | alpha, 1357 | a.as_ptr(), 1358 | lda, 1359 | x.as_ptr(), 1360 | incx, 1361 | beta, 1362 | y.as_mut_ptr(), 1363 | incy, 1364 | ) 1365 | } 1366 | 1367 | #[inline] 1368 | pub unsafe fn sspmv( 1369 | layout: Layout, 1370 | uplo: Part, 1371 | n: i32, 1372 | alpha: f32, 1373 | ap: &[f32], 1374 | x: &[f32], 1375 | incx: i32, 1376 | beta: f32, 1377 | y: &mut [f32], 1378 | incy: i32, 1379 | ) { 1380 | ffi::cblas_sspmv( 1381 | layout.into(), 1382 | uplo.into(), 1383 | n, 1384 | alpha, 1385 | ap.as_ptr(), 1386 | x.as_ptr(), 1387 | incx, 1388 | beta, 1389 | y.as_mut_ptr(), 1390 | incy, 1391 | ) 1392 | } 1393 | 1394 | #[inline] 1395 | pub unsafe fn sger( 1396 | layout: Layout, 1397 | m: i32, 1398 | n: i32, 1399 | alpha: f32, 1400 | x: &[f32], 1401 | incx: i32, 1402 | y: &[f32], 1403 | incy: i32, 1404 | a: &mut [f32], 1405 | lda: i32, 1406 | ) { 1407 | ffi::cblas_sger( 1408 | layout.into(), 1409 | m, 1410 | n, 1411 | alpha, 1412 | x.as_ptr(), 1413 | incx, 1414 | y.as_ptr(), 1415 | incy, 1416 | a.as_mut_ptr(), 1417 | lda, 1418 | ) 1419 | } 1420 | 1421 | #[inline] 1422 | pub unsafe fn ssyr( 1423 | layout: Layout, 1424 | uplo: Part, 1425 | n: i32, 1426 | alpha: f32, 1427 | x: &[f32], 1428 | incx: i32, 1429 | a: &mut [f32], 1430 | lda: i32, 1431 | ) { 1432 | ffi::cblas_ssyr( 1433 | layout.into(), 1434 | uplo.into(), 1435 | n, 1436 | alpha, 1437 | x.as_ptr(), 1438 | incx, 1439 | a.as_mut_ptr(), 1440 | lda, 1441 | ) 1442 | } 1443 | 1444 | #[inline] 1445 | pub unsafe fn sspr( 1446 | layout: Layout, 1447 | uplo: Part, 1448 | n: i32, 1449 | alpha: f32, 1450 | x: &[f32], 1451 | incx: i32, 1452 | ap: &mut [f32], 1453 | ) { 1454 | ffi::cblas_sspr( 1455 | layout.into(), 1456 | uplo.into(), 1457 | n, 1458 | alpha, 1459 | x.as_ptr(), 1460 | incx, 1461 | ap.as_mut_ptr(), 1462 | ) 1463 | } 1464 | 1465 | #[inline] 1466 | pub unsafe fn ssyr2( 1467 | layout: Layout, 1468 | uplo: Part, 1469 | n: i32, 1470 | alpha: f32, 1471 | x: &[f32], 1472 | incx: i32, 1473 | y: &[f32], 1474 | incy: i32, 1475 | a: &mut [f32], 1476 | lda: i32, 1477 | ) { 1478 | ffi::cblas_ssyr2( 1479 | layout.into(), 1480 | uplo.into(), 1481 | n, 1482 | alpha, 1483 | x.as_ptr(), 1484 | incx, 1485 | y.as_ptr(), 1486 | incy, 1487 | a.as_mut_ptr(), 1488 | lda, 1489 | ) 1490 | } 1491 | 1492 | #[inline] 1493 | pub unsafe fn sspr2( 1494 | layout: Layout, 1495 | uplo: Part, 1496 | n: i32, 1497 | alpha: f32, 1498 | x: &[f32], 1499 | incx: i32, 1500 | y: &[f32], 1501 | incy: i32, 1502 | a: &mut [f32], 1503 | ) { 1504 | ffi::cblas_sspr2( 1505 | layout.into(), 1506 | uplo.into(), 1507 | n, 1508 | alpha, 1509 | x.as_ptr(), 1510 | incx, 1511 | y.as_ptr(), 1512 | incy, 1513 | a.as_mut_ptr(), 1514 | ) 1515 | } 1516 | 1517 | #[inline] 1518 | pub unsafe fn dsymv( 1519 | layout: Layout, 1520 | uplo: Part, 1521 | n: i32, 1522 | alpha: f64, 1523 | a: &[f64], 1524 | lda: i32, 1525 | x: &[f64], 1526 | incx: i32, 1527 | beta: f64, 1528 | y: &mut [f64], 1529 | incy: i32, 1530 | ) { 1531 | ffi::cblas_dsymv( 1532 | layout.into(), 1533 | uplo.into(), 1534 | n, 1535 | alpha, 1536 | a.as_ptr(), 1537 | lda, 1538 | x.as_ptr(), 1539 | incx, 1540 | beta, 1541 | y.as_mut_ptr(), 1542 | incy, 1543 | ) 1544 | } 1545 | 1546 | #[inline] 1547 | pub unsafe fn dsbmv( 1548 | layout: Layout, 1549 | uplo: Part, 1550 | n: i32, 1551 | k: i32, 1552 | alpha: f64, 1553 | a: &[f64], 1554 | lda: i32, 1555 | x: &[f64], 1556 | incx: i32, 1557 | beta: f64, 1558 | y: &mut [f64], 1559 | incy: i32, 1560 | ) { 1561 | ffi::cblas_dsbmv( 1562 | layout.into(), 1563 | uplo.into(), 1564 | n, 1565 | k, 1566 | alpha, 1567 | a.as_ptr(), 1568 | lda, 1569 | x.as_ptr(), 1570 | incx, 1571 | beta, 1572 | y.as_mut_ptr(), 1573 | incy, 1574 | ) 1575 | } 1576 | 1577 | #[inline] 1578 | pub unsafe fn dspmv( 1579 | layout: Layout, 1580 | uplo: Part, 1581 | n: i32, 1582 | alpha: f64, 1583 | ap: &[f64], 1584 | x: &[f64], 1585 | incx: i32, 1586 | beta: f64, 1587 | y: &mut [f64], 1588 | incy: i32, 1589 | ) { 1590 | ffi::cblas_dspmv( 1591 | layout.into(), 1592 | uplo.into(), 1593 | n, 1594 | alpha, 1595 | ap.as_ptr(), 1596 | x.as_ptr(), 1597 | incx, 1598 | beta, 1599 | y.as_mut_ptr(), 1600 | incy, 1601 | ) 1602 | } 1603 | 1604 | #[inline] 1605 | pub unsafe fn dger( 1606 | layout: Layout, 1607 | m: i32, 1608 | n: i32, 1609 | alpha: f64, 1610 | x: &[f64], 1611 | incx: i32, 1612 | y: &[f64], 1613 | incy: i32, 1614 | a: &mut [f64], 1615 | lda: i32, 1616 | ) { 1617 | ffi::cblas_dger( 1618 | layout.into(), 1619 | m, 1620 | n, 1621 | alpha, 1622 | x.as_ptr(), 1623 | incx, 1624 | y.as_ptr(), 1625 | incy, 1626 | a.as_mut_ptr(), 1627 | lda, 1628 | ) 1629 | } 1630 | 1631 | #[inline] 1632 | pub unsafe fn dsyr( 1633 | layout: Layout, 1634 | uplo: Part, 1635 | n: i32, 1636 | alpha: f64, 1637 | x: &[f64], 1638 | incx: i32, 1639 | a: &mut [f64], 1640 | lda: i32, 1641 | ) { 1642 | ffi::cblas_dsyr( 1643 | layout.into(), 1644 | uplo.into(), 1645 | n, 1646 | alpha, 1647 | x.as_ptr(), 1648 | incx, 1649 | a.as_mut_ptr(), 1650 | lda, 1651 | ) 1652 | } 1653 | 1654 | #[inline] 1655 | pub unsafe fn dspr( 1656 | layout: Layout, 1657 | uplo: Part, 1658 | n: i32, 1659 | alpha: f64, 1660 | x: &[f64], 1661 | incx: i32, 1662 | ap: &mut [f64], 1663 | ) { 1664 | ffi::cblas_dspr( 1665 | layout.into(), 1666 | uplo.into(), 1667 | n, 1668 | alpha, 1669 | x.as_ptr(), 1670 | incx, 1671 | ap.as_mut_ptr(), 1672 | ) 1673 | } 1674 | 1675 | #[inline] 1676 | pub unsafe fn dsyr2( 1677 | layout: Layout, 1678 | uplo: Part, 1679 | n: i32, 1680 | alpha: f64, 1681 | x: &[f64], 1682 | incx: i32, 1683 | y: &[f64], 1684 | incy: i32, 1685 | a: &mut [f64], 1686 | lda: i32, 1687 | ) { 1688 | ffi::cblas_dsyr2( 1689 | layout.into(), 1690 | uplo.into(), 1691 | n, 1692 | alpha, 1693 | x.as_ptr(), 1694 | incx, 1695 | y.as_ptr(), 1696 | incy, 1697 | a.as_mut_ptr(), 1698 | lda, 1699 | ) 1700 | } 1701 | 1702 | #[inline] 1703 | pub unsafe fn dspr2( 1704 | layout: Layout, 1705 | uplo: Part, 1706 | n: i32, 1707 | alpha: f64, 1708 | x: &[f64], 1709 | incx: i32, 1710 | y: &[f64], 1711 | incy: i32, 1712 | a: &mut [f64], 1713 | ) { 1714 | ffi::cblas_dspr2( 1715 | layout.into(), 1716 | uplo.into(), 1717 | n, 1718 | alpha, 1719 | x.as_ptr(), 1720 | incx, 1721 | y.as_ptr(), 1722 | incy, 1723 | a.as_mut_ptr(), 1724 | ) 1725 | } 1726 | 1727 | #[inline] 1728 | pub unsafe fn chemv( 1729 | layout: Layout, 1730 | uplo: Part, 1731 | n: i32, 1732 | alpha: c32, 1733 | a: &[c32], 1734 | lda: i32, 1735 | x: &[c32], 1736 | incx: i32, 1737 | beta: c32, 1738 | y: &mut [c32], 1739 | incy: i32, 1740 | ) { 1741 | ffi::cblas_chemv( 1742 | layout.into(), 1743 | uplo.into(), 1744 | n, 1745 | &alpha as *const _ as *const _, 1746 | a.as_ptr() as *const _, 1747 | lda, 1748 | x.as_ptr() as *const _, 1749 | incx, 1750 | &beta as *const _ as *const _, 1751 | y.as_mut_ptr() as *mut _, 1752 | incy, 1753 | ) 1754 | } 1755 | 1756 | #[inline] 1757 | pub unsafe fn chbmv( 1758 | layout: Layout, 1759 | uplo: Part, 1760 | n: i32, 1761 | k: i32, 1762 | alpha: c32, 1763 | a: &[c32], 1764 | lda: i32, 1765 | x: &[c32], 1766 | incx: i32, 1767 | beta: c32, 1768 | y: &mut [c32], 1769 | incy: i32, 1770 | ) { 1771 | ffi::cblas_chbmv( 1772 | layout.into(), 1773 | uplo.into(), 1774 | n, 1775 | k, 1776 | &alpha as *const _ as *const _, 1777 | a.as_ptr() as *const _, 1778 | lda, 1779 | x.as_ptr() as *const _, 1780 | incx, 1781 | &beta as *const _ as *const _, 1782 | y.as_mut_ptr() as *mut _, 1783 | incy, 1784 | ) 1785 | } 1786 | 1787 | #[inline] 1788 | pub unsafe fn chpmv( 1789 | layout: Layout, 1790 | uplo: Part, 1791 | n: i32, 1792 | alpha: c32, 1793 | ap: &[c32], 1794 | x: &[c32], 1795 | incx: i32, 1796 | beta: c32, 1797 | y: &mut [c32], 1798 | incy: i32, 1799 | ) { 1800 | ffi::cblas_chpmv( 1801 | layout.into(), 1802 | uplo.into(), 1803 | n, 1804 | &alpha as *const _ as *const _, 1805 | ap.as_ptr() as *const _, 1806 | x.as_ptr() as *const _, 1807 | incx, 1808 | &beta as *const _ as *const _, 1809 | y.as_mut_ptr() as *mut _, 1810 | incy, 1811 | ) 1812 | } 1813 | 1814 | #[inline] 1815 | pub unsafe fn cgeru( 1816 | layout: Layout, 1817 | m: i32, 1818 | n: i32, 1819 | alpha: c32, 1820 | x: &[c32], 1821 | incx: i32, 1822 | y: &[c32], 1823 | incy: i32, 1824 | a: &mut [c32], 1825 | lda: i32, 1826 | ) { 1827 | ffi::cblas_cgeru( 1828 | layout.into(), 1829 | m, 1830 | n, 1831 | &alpha as *const _ as *const _, 1832 | x.as_ptr() as *const _, 1833 | incx, 1834 | y.as_ptr() as *const _, 1835 | incy, 1836 | a.as_mut_ptr() as *mut _, 1837 | lda, 1838 | ) 1839 | } 1840 | 1841 | #[inline] 1842 | pub unsafe fn cgerc( 1843 | layout: Layout, 1844 | m: i32, 1845 | n: i32, 1846 | alpha: c32, 1847 | x: &[c32], 1848 | incx: i32, 1849 | y: &[c32], 1850 | incy: i32, 1851 | a: &mut [c32], 1852 | lda: i32, 1853 | ) { 1854 | ffi::cblas_cgerc( 1855 | layout.into(), 1856 | m, 1857 | n, 1858 | &alpha as *const _ as *const _, 1859 | x.as_ptr() as *const _, 1860 | incx, 1861 | y.as_ptr() as *const _, 1862 | incy, 1863 | a.as_mut_ptr() as *mut _, 1864 | lda, 1865 | ) 1866 | } 1867 | 1868 | #[inline] 1869 | pub unsafe fn cher( 1870 | layout: Layout, 1871 | uplo: Part, 1872 | n: i32, 1873 | alpha: f32, 1874 | x: &[c32], 1875 | incx: i32, 1876 | a: &mut [c32], 1877 | lda: i32, 1878 | ) { 1879 | ffi::cblas_cher( 1880 | layout.into(), 1881 | uplo.into(), 1882 | n, 1883 | alpha, 1884 | x.as_ptr() as *const _, 1885 | incx, 1886 | a.as_mut_ptr() as *mut _, 1887 | lda, 1888 | ) 1889 | } 1890 | 1891 | #[inline] 1892 | pub unsafe fn chpr( 1893 | layout: Layout, 1894 | uplo: Part, 1895 | n: i32, 1896 | alpha: f32, 1897 | x: &[c32], 1898 | incx: i32, 1899 | a: &mut [c32], 1900 | ) { 1901 | ffi::cblas_chpr( 1902 | layout.into(), 1903 | uplo.into(), 1904 | n, 1905 | alpha, 1906 | x.as_ptr() as *const _, 1907 | incx, 1908 | a.as_mut_ptr() as *mut _, 1909 | ) 1910 | } 1911 | 1912 | #[inline] 1913 | pub unsafe fn cher2( 1914 | layout: Layout, 1915 | uplo: Part, 1916 | n: i32, 1917 | alpha: c32, 1918 | x: &[c32], 1919 | incx: i32, 1920 | y: &[c32], 1921 | incy: i32, 1922 | a: &mut [c32], 1923 | lda: i32, 1924 | ) { 1925 | ffi::cblas_cher2( 1926 | layout.into(), 1927 | uplo.into(), 1928 | n, 1929 | &alpha as *const _ as *const _, 1930 | x.as_ptr() as *const _, 1931 | incx, 1932 | y.as_ptr() as *const _, 1933 | incy, 1934 | a.as_mut_ptr() as *mut _, 1935 | lda, 1936 | ) 1937 | } 1938 | 1939 | #[inline] 1940 | pub unsafe fn chpr2( 1941 | layout: Layout, 1942 | uplo: Part, 1943 | n: i32, 1944 | alpha: c32, 1945 | x: &[c32], 1946 | incx: i32, 1947 | y: &[c32], 1948 | incy: i32, 1949 | ap: &mut [c32], 1950 | ) { 1951 | ffi::cblas_chpr2( 1952 | layout.into(), 1953 | uplo.into(), 1954 | n, 1955 | &alpha as *const _ as *const _, 1956 | x.as_ptr() as *const _, 1957 | incx, 1958 | y.as_ptr() as *const _, 1959 | incy, 1960 | ap.as_mut_ptr() as *mut _, 1961 | ) 1962 | } 1963 | 1964 | #[inline] 1965 | pub unsafe fn zhemv( 1966 | layout: Layout, 1967 | uplo: Part, 1968 | n: i32, 1969 | alpha: c64, 1970 | a: &[c64], 1971 | lda: i32, 1972 | x: &[c64], 1973 | incx: i32, 1974 | beta: c64, 1975 | y: &mut [c64], 1976 | incy: i32, 1977 | ) { 1978 | ffi::cblas_zhemv( 1979 | layout.into(), 1980 | uplo.into(), 1981 | n, 1982 | &alpha as *const _ as *const _, 1983 | a.as_ptr() as *const _, 1984 | lda, 1985 | x.as_ptr() as *const _, 1986 | incx, 1987 | &beta as *const _ as *const _, 1988 | y.as_mut_ptr() as *mut _, 1989 | incy, 1990 | ) 1991 | } 1992 | 1993 | #[inline] 1994 | pub unsafe fn zhbmv( 1995 | layout: Layout, 1996 | uplo: Part, 1997 | n: i32, 1998 | k: i32, 1999 | alpha: c64, 2000 | a: &[c64], 2001 | lda: i32, 2002 | x: &[c64], 2003 | incx: i32, 2004 | beta: c64, 2005 | y: &mut [c64], 2006 | incy: i32, 2007 | ) { 2008 | ffi::cblas_zhbmv( 2009 | layout.into(), 2010 | uplo.into(), 2011 | n, 2012 | k, 2013 | &alpha as *const _ as *const _, 2014 | a.as_ptr() as *const _, 2015 | lda, 2016 | x.as_ptr() as *const _, 2017 | incx, 2018 | &beta as *const _ as *const _, 2019 | y.as_mut_ptr() as *mut _, 2020 | incy, 2021 | ) 2022 | } 2023 | 2024 | #[inline] 2025 | pub unsafe fn zhpmv( 2026 | layout: Layout, 2027 | uplo: Part, 2028 | n: i32, 2029 | alpha: c64, 2030 | ap: &[c64], 2031 | x: &[c64], 2032 | incx: i32, 2033 | beta: c64, 2034 | y: &mut [c64], 2035 | incy: i32, 2036 | ) { 2037 | ffi::cblas_zhpmv( 2038 | layout.into(), 2039 | uplo.into(), 2040 | n, 2041 | &alpha as *const _ as *const _, 2042 | ap.as_ptr() as *const _, 2043 | x.as_ptr() as *const _, 2044 | incx, 2045 | &beta as *const _ as *const _, 2046 | y.as_mut_ptr() as *mut _, 2047 | incy, 2048 | ) 2049 | } 2050 | 2051 | #[inline] 2052 | pub unsafe fn zgeru( 2053 | layout: Layout, 2054 | m: i32, 2055 | n: i32, 2056 | alpha: c64, 2057 | x: &[c64], 2058 | incx: i32, 2059 | y: &[c64], 2060 | incy: i32, 2061 | a: &mut [c64], 2062 | lda: i32, 2063 | ) { 2064 | ffi::cblas_zgeru( 2065 | layout.into(), 2066 | m, 2067 | n, 2068 | &alpha as *const _ as *const _, 2069 | x.as_ptr() as *const _, 2070 | incx, 2071 | y.as_ptr() as *const _, 2072 | incy, 2073 | a.as_mut_ptr() as *mut _, 2074 | lda, 2075 | ) 2076 | } 2077 | 2078 | #[inline] 2079 | pub unsafe fn zgerc( 2080 | layout: Layout, 2081 | m: i32, 2082 | n: i32, 2083 | alpha: c64, 2084 | x: &[c64], 2085 | incx: i32, 2086 | y: &[c64], 2087 | incy: i32, 2088 | a: &mut [c64], 2089 | lda: i32, 2090 | ) { 2091 | ffi::cblas_zgerc( 2092 | layout.into(), 2093 | m, 2094 | n, 2095 | &alpha as *const _ as *const _, 2096 | x.as_ptr() as *const _, 2097 | incx, 2098 | y.as_ptr() as *const _, 2099 | incy, 2100 | a.as_mut_ptr() as *mut _, 2101 | lda, 2102 | ) 2103 | } 2104 | 2105 | #[inline] 2106 | pub unsafe fn zher( 2107 | layout: Layout, 2108 | uplo: Part, 2109 | n: i32, 2110 | alpha: f64, 2111 | x: &[c64], 2112 | incx: i32, 2113 | a: &mut [c64], 2114 | lda: i32, 2115 | ) { 2116 | ffi::cblas_zher( 2117 | layout.into(), 2118 | uplo.into(), 2119 | n, 2120 | alpha, 2121 | x.as_ptr() as *const _, 2122 | incx, 2123 | a.as_mut_ptr() as *mut _, 2124 | lda, 2125 | ) 2126 | } 2127 | 2128 | #[inline] 2129 | pub unsafe fn zhpr( 2130 | layout: Layout, 2131 | uplo: Part, 2132 | n: i32, 2133 | alpha: f64, 2134 | x: &[c64], 2135 | incx: i32, 2136 | a: &mut [c64], 2137 | ) { 2138 | ffi::cblas_zhpr( 2139 | layout.into(), 2140 | uplo.into(), 2141 | n, 2142 | alpha, 2143 | x.as_ptr() as *const _, 2144 | incx, 2145 | a.as_mut_ptr() as *mut _, 2146 | ) 2147 | } 2148 | 2149 | #[inline] 2150 | pub unsafe fn zher2( 2151 | layout: Layout, 2152 | uplo: Part, 2153 | n: i32, 2154 | alpha: c64, 2155 | x: &[c64], 2156 | incx: i32, 2157 | y: &[c64], 2158 | incy: i32, 2159 | a: &mut [c64], 2160 | lda: i32, 2161 | ) { 2162 | ffi::cblas_zher2( 2163 | layout.into(), 2164 | uplo.into(), 2165 | n, 2166 | &alpha as *const _ as *const _, 2167 | x.as_ptr() as *const _, 2168 | incx, 2169 | y.as_ptr() as *const _, 2170 | incy, 2171 | a.as_mut_ptr() as *mut _, 2172 | lda, 2173 | ) 2174 | } 2175 | 2176 | #[inline] 2177 | pub unsafe fn zhpr2( 2178 | layout: Layout, 2179 | uplo: Part, 2180 | n: i32, 2181 | alpha: c64, 2182 | x: &[c64], 2183 | incx: i32, 2184 | y: &[c64], 2185 | incy: i32, 2186 | ap: &mut [c64], 2187 | ) { 2188 | ffi::cblas_zhpr2( 2189 | layout.into(), 2190 | uplo.into(), 2191 | n, 2192 | &alpha as *const _ as *const _, 2193 | x.as_ptr() as *const _, 2194 | incx, 2195 | y.as_ptr() as *const _, 2196 | incy, 2197 | ap.as_mut_ptr() as *mut _, 2198 | ) 2199 | } 2200 | 2201 | #[inline] 2202 | pub unsafe fn sgemm( 2203 | layout: Layout, 2204 | transa: Transpose, 2205 | transb: Transpose, 2206 | m: i32, 2207 | n: i32, 2208 | k: i32, 2209 | alpha: f32, 2210 | a: &[f32], 2211 | lda: i32, 2212 | b: &[f32], 2213 | ldb: i32, 2214 | beta: f32, 2215 | c: &mut [f32], 2216 | ldc: i32, 2217 | ) { 2218 | ffi::cblas_sgemm( 2219 | layout.into(), 2220 | transa.into(), 2221 | transb.into(), 2222 | m, 2223 | n, 2224 | k, 2225 | alpha, 2226 | a.as_ptr(), 2227 | lda, 2228 | b.as_ptr(), 2229 | ldb, 2230 | beta, 2231 | c.as_mut_ptr(), 2232 | ldc, 2233 | ) 2234 | } 2235 | 2236 | #[inline] 2237 | pub unsafe fn ssymm( 2238 | layout: Layout, 2239 | side: Side, 2240 | uplo: Part, 2241 | m: i32, 2242 | n: i32, 2243 | alpha: f32, 2244 | a: &[f32], 2245 | lda: i32, 2246 | b: &[f32], 2247 | ldb: i32, 2248 | beta: f32, 2249 | c: &mut [f32], 2250 | ldc: i32, 2251 | ) { 2252 | ffi::cblas_ssymm( 2253 | layout.into(), 2254 | side.into(), 2255 | uplo.into(), 2256 | m, 2257 | n, 2258 | alpha, 2259 | a.as_ptr(), 2260 | lda, 2261 | b.as_ptr(), 2262 | ldb, 2263 | beta, 2264 | c.as_mut_ptr(), 2265 | ldc, 2266 | ) 2267 | } 2268 | 2269 | #[inline] 2270 | pub unsafe fn ssyrk( 2271 | layout: Layout, 2272 | uplo: Part, 2273 | trans: Transpose, 2274 | n: i32, 2275 | k: i32, 2276 | alpha: f32, 2277 | a: &[f32], 2278 | lda: i32, 2279 | beta: f32, 2280 | c: &mut [f32], 2281 | ldc: i32, 2282 | ) { 2283 | ffi::cblas_ssyrk( 2284 | layout.into(), 2285 | uplo.into(), 2286 | trans.into(), 2287 | n, 2288 | k, 2289 | alpha, 2290 | a.as_ptr(), 2291 | lda, 2292 | beta, 2293 | c.as_mut_ptr(), 2294 | ldc, 2295 | ) 2296 | } 2297 | 2298 | #[inline] 2299 | pub unsafe fn ssyr2k( 2300 | layout: Layout, 2301 | uplo: Part, 2302 | trans: Transpose, 2303 | n: i32, 2304 | k: i32, 2305 | alpha: f32, 2306 | a: &[f32], 2307 | lda: i32, 2308 | b: &[f32], 2309 | ldb: i32, 2310 | beta: f32, 2311 | c: &mut [f32], 2312 | ldc: i32, 2313 | ) { 2314 | ffi::cblas_ssyr2k( 2315 | layout.into(), 2316 | uplo.into(), 2317 | trans.into(), 2318 | n, 2319 | k, 2320 | alpha, 2321 | a.as_ptr(), 2322 | lda, 2323 | b.as_ptr(), 2324 | ldb, 2325 | beta, 2326 | c.as_mut_ptr(), 2327 | ldc, 2328 | ) 2329 | } 2330 | 2331 | #[inline] 2332 | pub unsafe fn strmm( 2333 | layout: Layout, 2334 | side: Side, 2335 | uplo: Part, 2336 | transa: Transpose, 2337 | diag: Diagonal, 2338 | m: i32, 2339 | n: i32, 2340 | alpha: f32, 2341 | a: &[f32], 2342 | lda: i32, 2343 | b: &mut [f32], 2344 | ldb: i32, 2345 | ) { 2346 | ffi::cblas_strmm( 2347 | layout.into(), 2348 | side.into(), 2349 | uplo.into(), 2350 | transa.into(), 2351 | diag.into(), 2352 | m, 2353 | n, 2354 | alpha, 2355 | a.as_ptr(), 2356 | lda, 2357 | b.as_mut_ptr(), 2358 | ldb, 2359 | ) 2360 | } 2361 | 2362 | #[inline] 2363 | pub unsafe fn strsm( 2364 | layout: Layout, 2365 | side: Side, 2366 | uplo: Part, 2367 | transa: Transpose, 2368 | diag: Diagonal, 2369 | m: i32, 2370 | n: i32, 2371 | alpha: f32, 2372 | a: &[f32], 2373 | lda: i32, 2374 | b: &mut [f32], 2375 | ldb: i32, 2376 | ) { 2377 | ffi::cblas_strsm( 2378 | layout.into(), 2379 | side.into(), 2380 | uplo.into(), 2381 | transa.into(), 2382 | diag.into(), 2383 | m, 2384 | n, 2385 | alpha, 2386 | a.as_ptr(), 2387 | lda, 2388 | b.as_mut_ptr(), 2389 | ldb, 2390 | ) 2391 | } 2392 | 2393 | #[inline] 2394 | pub unsafe fn dgemm( 2395 | layout: Layout, 2396 | transa: Transpose, 2397 | transb: Transpose, 2398 | m: i32, 2399 | n: i32, 2400 | k: i32, 2401 | alpha: f64, 2402 | a: &[f64], 2403 | lda: i32, 2404 | b: &[f64], 2405 | ldb: i32, 2406 | beta: f64, 2407 | c: &mut [f64], 2408 | ldc: i32, 2409 | ) { 2410 | ffi::cblas_dgemm( 2411 | layout.into(), 2412 | transa.into(), 2413 | transb.into(), 2414 | m, 2415 | n, 2416 | k, 2417 | alpha, 2418 | a.as_ptr(), 2419 | lda, 2420 | b.as_ptr(), 2421 | ldb, 2422 | beta, 2423 | c.as_mut_ptr(), 2424 | ldc, 2425 | ) 2426 | } 2427 | 2428 | #[inline] 2429 | pub unsafe fn dsymm( 2430 | layout: Layout, 2431 | side: Side, 2432 | uplo: Part, 2433 | m: i32, 2434 | n: i32, 2435 | alpha: f64, 2436 | a: &[f64], 2437 | lda: i32, 2438 | b: &[f64], 2439 | ldb: i32, 2440 | beta: f64, 2441 | c: &mut [f64], 2442 | ldc: i32, 2443 | ) { 2444 | ffi::cblas_dsymm( 2445 | layout.into(), 2446 | side.into(), 2447 | uplo.into(), 2448 | m, 2449 | n, 2450 | alpha, 2451 | a.as_ptr(), 2452 | lda, 2453 | b.as_ptr(), 2454 | ldb, 2455 | beta, 2456 | c.as_mut_ptr(), 2457 | ldc, 2458 | ) 2459 | } 2460 | 2461 | #[inline] 2462 | pub unsafe fn dsyrk( 2463 | layout: Layout, 2464 | uplo: Part, 2465 | trans: Transpose, 2466 | n: i32, 2467 | k: i32, 2468 | alpha: f64, 2469 | a: &[f64], 2470 | lda: i32, 2471 | beta: f64, 2472 | c: &mut [f64], 2473 | ldc: i32, 2474 | ) { 2475 | ffi::cblas_dsyrk( 2476 | layout.into(), 2477 | uplo.into(), 2478 | trans.into(), 2479 | n, 2480 | k, 2481 | alpha, 2482 | a.as_ptr(), 2483 | lda, 2484 | beta, 2485 | c.as_mut_ptr(), 2486 | ldc, 2487 | ) 2488 | } 2489 | 2490 | #[inline] 2491 | pub unsafe fn dsyr2k( 2492 | layout: Layout, 2493 | uplo: Part, 2494 | trans: Transpose, 2495 | n: i32, 2496 | k: i32, 2497 | alpha: f64, 2498 | a: &[f64], 2499 | lda: i32, 2500 | b: &[f64], 2501 | ldb: i32, 2502 | beta: f64, 2503 | c: &mut [f64], 2504 | ldc: i32, 2505 | ) { 2506 | ffi::cblas_dsyr2k( 2507 | layout.into(), 2508 | uplo.into(), 2509 | trans.into(), 2510 | n, 2511 | k, 2512 | alpha, 2513 | a.as_ptr(), 2514 | lda, 2515 | b.as_ptr(), 2516 | ldb, 2517 | beta, 2518 | c.as_mut_ptr(), 2519 | ldc, 2520 | ) 2521 | } 2522 | 2523 | #[inline] 2524 | pub unsafe fn dtrmm( 2525 | layout: Layout, 2526 | side: Side, 2527 | uplo: Part, 2528 | transa: Transpose, 2529 | diag: Diagonal, 2530 | m: i32, 2531 | n: i32, 2532 | alpha: f64, 2533 | a: &[f64], 2534 | lda: i32, 2535 | b: &mut [f64], 2536 | ldb: i32, 2537 | ) { 2538 | ffi::cblas_dtrmm( 2539 | layout.into(), 2540 | side.into(), 2541 | uplo.into(), 2542 | transa.into(), 2543 | diag.into(), 2544 | m, 2545 | n, 2546 | alpha, 2547 | a.as_ptr(), 2548 | lda, 2549 | b.as_mut_ptr(), 2550 | ldb, 2551 | ) 2552 | } 2553 | 2554 | #[inline] 2555 | pub unsafe fn dtrsm( 2556 | layout: Layout, 2557 | side: Side, 2558 | uplo: Part, 2559 | transa: Transpose, 2560 | diag: Diagonal, 2561 | m: i32, 2562 | n: i32, 2563 | alpha: f64, 2564 | a: &[f64], 2565 | lda: i32, 2566 | b: &mut [f64], 2567 | ldb: i32, 2568 | ) { 2569 | ffi::cblas_dtrsm( 2570 | layout.into(), 2571 | side.into(), 2572 | uplo.into(), 2573 | transa.into(), 2574 | diag.into(), 2575 | m, 2576 | n, 2577 | alpha, 2578 | a.as_ptr(), 2579 | lda, 2580 | b.as_mut_ptr(), 2581 | ldb, 2582 | ) 2583 | } 2584 | 2585 | #[inline] 2586 | pub unsafe fn cgemm( 2587 | layout: Layout, 2588 | transa: Transpose, 2589 | transb: Transpose, 2590 | m: i32, 2591 | n: i32, 2592 | k: i32, 2593 | alpha: c32, 2594 | a: &[c32], 2595 | lda: i32, 2596 | b: &[c32], 2597 | ldb: i32, 2598 | beta: c32, 2599 | c: &mut [c32], 2600 | ldc: i32, 2601 | ) { 2602 | ffi::cblas_cgemm( 2603 | layout.into(), 2604 | transa.into(), 2605 | transb.into(), 2606 | m, 2607 | n, 2608 | k, 2609 | &alpha as *const _ as *const _, 2610 | a.as_ptr() as *const _, 2611 | lda, 2612 | b.as_ptr() as *const _, 2613 | ldb, 2614 | &beta as *const _ as *const _, 2615 | c.as_mut_ptr() as *mut _, 2616 | ldc, 2617 | ) 2618 | } 2619 | 2620 | #[inline] 2621 | pub unsafe fn csymm( 2622 | layout: Layout, 2623 | side: Side, 2624 | uplo: Part, 2625 | m: i32, 2626 | n: i32, 2627 | alpha: c32, 2628 | a: &[c32], 2629 | lda: i32, 2630 | b: &[c32], 2631 | ldb: i32, 2632 | beta: c32, 2633 | c: &mut [c32], 2634 | ldc: i32, 2635 | ) { 2636 | ffi::cblas_csymm( 2637 | layout.into(), 2638 | side.into(), 2639 | uplo.into(), 2640 | m, 2641 | n, 2642 | &alpha as *const _ as *const _, 2643 | a.as_ptr() as *const _, 2644 | lda, 2645 | b.as_ptr() as *const _, 2646 | ldb, 2647 | &beta as *const _ as *const _, 2648 | c.as_mut_ptr() as *mut _, 2649 | ldc, 2650 | ) 2651 | } 2652 | 2653 | #[inline] 2654 | pub unsafe fn csyrk( 2655 | layout: Layout, 2656 | uplo: Part, 2657 | trans: Transpose, 2658 | n: i32, 2659 | k: i32, 2660 | alpha: c32, 2661 | a: &[c32], 2662 | lda: i32, 2663 | beta: c32, 2664 | c: &mut [c32], 2665 | ldc: i32, 2666 | ) { 2667 | ffi::cblas_csyrk( 2668 | layout.into(), 2669 | uplo.into(), 2670 | trans.into(), 2671 | n, 2672 | k, 2673 | &alpha as *const _ as *const _, 2674 | a.as_ptr() as *const _, 2675 | lda, 2676 | &beta as *const _ as *const _, 2677 | c.as_mut_ptr() as *mut _, 2678 | ldc, 2679 | ) 2680 | } 2681 | 2682 | #[inline] 2683 | pub unsafe fn csyr2k( 2684 | layout: Layout, 2685 | uplo: Part, 2686 | trans: Transpose, 2687 | n: i32, 2688 | k: i32, 2689 | alpha: c32, 2690 | a: &[c32], 2691 | lda: i32, 2692 | b: &[c32], 2693 | ldb: i32, 2694 | beta: c32, 2695 | c: &mut [c32], 2696 | ldc: i32, 2697 | ) { 2698 | ffi::cblas_csyr2k( 2699 | layout.into(), 2700 | uplo.into(), 2701 | trans.into(), 2702 | n, 2703 | k, 2704 | &alpha as *const _ as *const _, 2705 | a.as_ptr() as *const _, 2706 | lda, 2707 | b.as_ptr() as *const _, 2708 | ldb, 2709 | &beta as *const _ as *const _, 2710 | c.as_mut_ptr() as *mut _, 2711 | ldc, 2712 | ) 2713 | } 2714 | 2715 | #[inline] 2716 | pub unsafe fn ctrmm( 2717 | layout: Layout, 2718 | side: Side, 2719 | uplo: Part, 2720 | transa: Transpose, 2721 | diag: Diagonal, 2722 | m: i32, 2723 | n: i32, 2724 | alpha: c32, 2725 | a: &[c32], 2726 | lda: i32, 2727 | b: &mut [c32], 2728 | ldb: i32, 2729 | ) { 2730 | ffi::cblas_ctrmm( 2731 | layout.into(), 2732 | side.into(), 2733 | uplo.into(), 2734 | transa.into(), 2735 | diag.into(), 2736 | m, 2737 | n, 2738 | &alpha as *const _ as *const _, 2739 | a.as_ptr() as *const _, 2740 | lda, 2741 | b.as_mut_ptr() as *mut _, 2742 | ldb, 2743 | ) 2744 | } 2745 | 2746 | #[inline] 2747 | pub unsafe fn ctrsm( 2748 | layout: Layout, 2749 | side: Side, 2750 | uplo: Part, 2751 | transa: Transpose, 2752 | diag: Diagonal, 2753 | m: i32, 2754 | n: i32, 2755 | alpha: c32, 2756 | a: &[c32], 2757 | lda: i32, 2758 | b: &mut [c32], 2759 | ldb: i32, 2760 | ) { 2761 | ffi::cblas_ctrsm( 2762 | layout.into(), 2763 | side.into(), 2764 | uplo.into(), 2765 | transa.into(), 2766 | diag.into(), 2767 | m, 2768 | n, 2769 | &alpha as *const _ as *const _, 2770 | a.as_ptr() as *const _, 2771 | lda, 2772 | b.as_mut_ptr() as *mut _, 2773 | ldb, 2774 | ) 2775 | } 2776 | 2777 | #[inline] 2778 | pub unsafe fn zgemm( 2779 | layout: Layout, 2780 | transa: Transpose, 2781 | transb: Transpose, 2782 | m: i32, 2783 | n: i32, 2784 | k: i32, 2785 | alpha: c64, 2786 | a: &[c64], 2787 | lda: i32, 2788 | b: &[c64], 2789 | ldb: i32, 2790 | beta: c64, 2791 | c: &mut [c64], 2792 | ldc: i32, 2793 | ) { 2794 | ffi::cblas_zgemm( 2795 | layout.into(), 2796 | transa.into(), 2797 | transb.into(), 2798 | m, 2799 | n, 2800 | k, 2801 | &alpha as *const _ as *const _, 2802 | a.as_ptr() as *const _, 2803 | lda, 2804 | b.as_ptr() as *const _, 2805 | ldb, 2806 | &beta as *const _ as *const _, 2807 | c.as_mut_ptr() as *mut _, 2808 | ldc, 2809 | ) 2810 | } 2811 | 2812 | #[inline] 2813 | pub unsafe fn zsymm( 2814 | layout: Layout, 2815 | side: Side, 2816 | uplo: Part, 2817 | m: i32, 2818 | n: i32, 2819 | alpha: c64, 2820 | a: &[c64], 2821 | lda: i32, 2822 | b: &[c64], 2823 | ldb: i32, 2824 | beta: c64, 2825 | c: &mut [c64], 2826 | ldc: i32, 2827 | ) { 2828 | ffi::cblas_zsymm( 2829 | layout.into(), 2830 | side.into(), 2831 | uplo.into(), 2832 | m, 2833 | n, 2834 | &alpha as *const _ as *const _, 2835 | a.as_ptr() as *const _, 2836 | lda, 2837 | b.as_ptr() as *const _, 2838 | ldb, 2839 | &beta as *const _ as *const _, 2840 | c.as_mut_ptr() as *mut _, 2841 | ldc, 2842 | ) 2843 | } 2844 | 2845 | #[inline] 2846 | pub unsafe fn zsyrk( 2847 | layout: Layout, 2848 | uplo: Part, 2849 | trans: Transpose, 2850 | n: i32, 2851 | k: i32, 2852 | alpha: c64, 2853 | a: &[c64], 2854 | lda: i32, 2855 | beta: c64, 2856 | c: &mut [c64], 2857 | ldc: i32, 2858 | ) { 2859 | ffi::cblas_zsyrk( 2860 | layout.into(), 2861 | uplo.into(), 2862 | trans.into(), 2863 | n, 2864 | k, 2865 | &alpha as *const _ as *const _, 2866 | a.as_ptr() as *const _, 2867 | lda, 2868 | &beta as *const _ as *const _, 2869 | c.as_mut_ptr() as *mut _, 2870 | ldc, 2871 | ) 2872 | } 2873 | 2874 | #[inline] 2875 | pub unsafe fn zsyr2k( 2876 | layout: Layout, 2877 | uplo: Part, 2878 | trans: Transpose, 2879 | n: i32, 2880 | k: i32, 2881 | alpha: c64, 2882 | a: &[c64], 2883 | lda: i32, 2884 | b: &[c64], 2885 | ldb: i32, 2886 | beta: c64, 2887 | c: &mut [c64], 2888 | ldc: i32, 2889 | ) { 2890 | ffi::cblas_zsyr2k( 2891 | layout.into(), 2892 | uplo.into(), 2893 | trans.into(), 2894 | n, 2895 | k, 2896 | &alpha as *const _ as *const _, 2897 | a.as_ptr() as *const _, 2898 | lda, 2899 | b.as_ptr() as *const _, 2900 | ldb, 2901 | &beta as *const _ as *const _, 2902 | c.as_mut_ptr() as *mut _, 2903 | ldc, 2904 | ) 2905 | } 2906 | 2907 | #[inline] 2908 | pub unsafe fn ztrmm( 2909 | layout: Layout, 2910 | side: Side, 2911 | uplo: Part, 2912 | transa: Transpose, 2913 | diag: Diagonal, 2914 | m: i32, 2915 | n: i32, 2916 | alpha: c64, 2917 | a: &[c64], 2918 | lda: i32, 2919 | b: &mut [c64], 2920 | ldb: i32, 2921 | ) { 2922 | ffi::cblas_ztrmm( 2923 | layout.into(), 2924 | side.into(), 2925 | uplo.into(), 2926 | transa.into(), 2927 | diag.into(), 2928 | m, 2929 | n, 2930 | &alpha as *const _ as *const _, 2931 | a.as_ptr() as *const _, 2932 | lda, 2933 | b.as_mut_ptr() as *mut _, 2934 | ldb, 2935 | ) 2936 | } 2937 | 2938 | #[inline] 2939 | pub unsafe fn ztrsm( 2940 | layout: Layout, 2941 | side: Side, 2942 | uplo: Part, 2943 | transa: Transpose, 2944 | diag: Diagonal, 2945 | m: i32, 2946 | n: i32, 2947 | alpha: c64, 2948 | a: &[c64], 2949 | lda: i32, 2950 | b: &mut [c64], 2951 | ldb: i32, 2952 | ) { 2953 | ffi::cblas_ztrsm( 2954 | layout.into(), 2955 | side.into(), 2956 | uplo.into(), 2957 | transa.into(), 2958 | diag.into(), 2959 | m, 2960 | n, 2961 | &alpha as *const _ as *const _, 2962 | a.as_ptr() as *const _, 2963 | lda, 2964 | b.as_mut_ptr() as *mut _, 2965 | ldb, 2966 | ) 2967 | } 2968 | 2969 | #[inline] 2970 | pub unsafe fn chemm( 2971 | layout: Layout, 2972 | side: Side, 2973 | uplo: Part, 2974 | m: i32, 2975 | n: i32, 2976 | alpha: c32, 2977 | a: &[c32], 2978 | lda: i32, 2979 | b: &[c32], 2980 | ldb: i32, 2981 | beta: c32, 2982 | c: &mut [c32], 2983 | ldc: i32, 2984 | ) { 2985 | ffi::cblas_chemm( 2986 | layout.into(), 2987 | side.into(), 2988 | uplo.into(), 2989 | m, 2990 | n, 2991 | &alpha as *const _ as *const _, 2992 | a.as_ptr() as *const _, 2993 | lda, 2994 | b.as_ptr() as *const _, 2995 | ldb, 2996 | &beta as *const _ as *const _, 2997 | c.as_mut_ptr() as *mut _, 2998 | ldc, 2999 | ) 3000 | } 3001 | 3002 | #[inline] 3003 | pub unsafe fn cherk( 3004 | layout: Layout, 3005 | uplo: Part, 3006 | trans: Transpose, 3007 | n: i32, 3008 | k: i32, 3009 | alpha: f32, 3010 | a: &[c32], 3011 | lda: i32, 3012 | beta: f32, 3013 | c: &mut [c32], 3014 | ldc: i32, 3015 | ) { 3016 | ffi::cblas_cherk( 3017 | layout.into(), 3018 | uplo.into(), 3019 | trans.into(), 3020 | n, 3021 | k, 3022 | alpha, 3023 | a.as_ptr() as *const _, 3024 | lda, 3025 | beta, 3026 | c.as_mut_ptr() as *mut _, 3027 | ldc, 3028 | ) 3029 | } 3030 | 3031 | #[inline] 3032 | pub unsafe fn cher2k( 3033 | layout: Layout, 3034 | uplo: Part, 3035 | trans: Transpose, 3036 | n: i32, 3037 | k: i32, 3038 | alpha: c32, 3039 | a: &[c32], 3040 | lda: i32, 3041 | b: &[c32], 3042 | ldb: i32, 3043 | beta: f32, 3044 | c: &mut [c32], 3045 | ldc: i32, 3046 | ) { 3047 | ffi::cblas_cher2k( 3048 | layout.into(), 3049 | uplo.into(), 3050 | trans.into(), 3051 | n, 3052 | k, 3053 | &alpha as *const _ as *const _, 3054 | a.as_ptr() as *const _, 3055 | lda, 3056 | b.as_ptr() as *const _, 3057 | ldb, 3058 | beta, 3059 | c.as_mut_ptr() as *mut _, 3060 | ldc, 3061 | ) 3062 | } 3063 | 3064 | #[inline] 3065 | pub unsafe fn zhemm( 3066 | layout: Layout, 3067 | side: Side, 3068 | uplo: Part, 3069 | m: i32, 3070 | n: i32, 3071 | alpha: c64, 3072 | a: &[c64], 3073 | lda: i32, 3074 | b: &[c64], 3075 | ldb: i32, 3076 | beta: c64, 3077 | c: &mut [c64], 3078 | ldc: i32, 3079 | ) { 3080 | ffi::cblas_zhemm( 3081 | layout.into(), 3082 | side.into(), 3083 | uplo.into(), 3084 | m, 3085 | n, 3086 | &alpha as *const _ as *const _, 3087 | a.as_ptr() as *const _, 3088 | lda, 3089 | b.as_ptr() as *const _, 3090 | ldb, 3091 | &beta as *const _ as *const _, 3092 | c.as_mut_ptr() as *mut _, 3093 | ldc, 3094 | ) 3095 | } 3096 | 3097 | #[inline] 3098 | pub unsafe fn zherk( 3099 | layout: Layout, 3100 | uplo: Part, 3101 | trans: Transpose, 3102 | n: i32, 3103 | k: i32, 3104 | alpha: f64, 3105 | a: &[c64], 3106 | lda: i32, 3107 | beta: f64, 3108 | c: &mut [c64], 3109 | ldc: i32, 3110 | ) { 3111 | ffi::cblas_zherk( 3112 | layout.into(), 3113 | uplo.into(), 3114 | trans.into(), 3115 | n, 3116 | k, 3117 | alpha, 3118 | a.as_ptr() as *const _, 3119 | lda, 3120 | beta, 3121 | c.as_mut_ptr() as *mut _, 3122 | ldc, 3123 | ) 3124 | } 3125 | 3126 | #[inline] 3127 | pub unsafe fn zher2k( 3128 | layout: Layout, 3129 | uplo: Part, 3130 | trans: Transpose, 3131 | n: i32, 3132 | k: i32, 3133 | alpha: c64, 3134 | a: &[c64], 3135 | lda: i32, 3136 | b: &[c64], 3137 | ldb: i32, 3138 | beta: f64, 3139 | c: &mut [c64], 3140 | ldc: i32, 3141 | ) { 3142 | ffi::cblas_zher2k( 3143 | layout.into(), 3144 | uplo.into(), 3145 | trans.into(), 3146 | n, 3147 | k, 3148 | &alpha as *const _ as *const _, 3149 | a.as_ptr() as *const _, 3150 | lda, 3151 | b.as_ptr() as *const _, 3152 | ldb, 3153 | beta, 3154 | c.as_mut_ptr() as *mut _, 3155 | ldc, 3156 | ) 3157 | } 3158 | --------------------------------------------------------------------------------