Skip to content

Commit 295e30f

Browse files
committed
Eliminate the C wrappers
1 parent 8d5eb23 commit 295e30f

File tree

9 files changed

+33500
-98594
lines changed

9 files changed

+33500
-98594
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ version = "0.1"
2424
default-features = false
2525

2626
[dependencies.lapack-sys]
27-
version = "0.11"
27+
version = "0.12"
2828
default-features = false

README.md

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,10 @@
22

33
The package provides wrappers for [LAPACK] (Fortran).
44

5-
## Example (C)
5+
## Example
66

77
```rust
8-
use lapack::c::*;
9-
10-
let n = 3;
11-
let mut a = vec![3.0, 1.0, 1.0, 1.0, 3.0, 1.0, 1.0, 1.0, 3.0];
12-
let mut w = vec![0.0; n as usize];
13-
let info;
14-
15-
unsafe {
16-
info = dsyev(Layout::ColumnMajor, b'V', b'U', n, &mut a, n, &mut w);
17-
}
18-
19-
assert_eq!(info, 0);
20-
for (one, another) in w.iter().zip(&[2.0, 2.0, 5.0]) {
21-
assert!((one - another).abs() < 1e-14);
22-
}
23-
```
24-
25-
## Example (Fortran)
26-
27-
```rust
28-
use lapack::fortran::*;
8+
use lapack::*;
299

3010
let n = 3;
3111
let mut a = vec![3.0, 1.0, 1.0, 1.0, 3.0, 1.0, 1.0, 1.0, 3.0];
@@ -38,7 +18,7 @@ unsafe {
3818
dsyev(b'V', b'U', n, &mut a, n, &mut w, &mut work, lwork, &mut info);
3919
}
4020

41-
assert_eq!(info, 0);
21+
assert!(info == 0);
4222
for (one, another) in w.iter().zip(&[2.0, 2.0, 5.0]) {
4323
assert!((one - another).abs() < 1e-14);
4424
}

bin/c.py

Lines changed: 0 additions & 200 deletions
This file was deleted.
File renamed without changes.

bin/fortran.py renamed to bin/generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python
22

3-
from common import Function, read_functions
3+
from function import Function, read_functions
44
import argparse
55
import os
66
import re
@@ -197,5 +197,5 @@ def do(functions):
197197
parser = argparse.ArgumentParser()
198198
parser.add_argument('--sys', required=True)
199199
arguments = parser.parse_args()
200-
path = os.path.join(arguments.sys, 'src', 'fortran.rs')
200+
path = os.path.join(arguments.sys, 'src', 'lib.rs')
201201
do(prepare(read_functions(path)))

0 commit comments

Comments
 (0)