File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ openblas = ["blas/openblas", "lapack/openblas"]
15
15
netlib = [" blas/netlib" , " lapack/netlib" ]
16
16
17
17
[dependencies ]
18
+ derive-new = " 0.4"
18
19
enum-error-derive = " 0.1"
19
20
num-traits = " 0.1"
20
21
num-complex = " 0.1"
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ use std::error;
4
4
use std:: fmt;
5
5
use ndarray:: { Ixs , ShapeError } ;
6
6
7
+ pub type LResult < T > = Result < T , LinalgError > ;
8
+
7
9
#[ derive( Debug , EnumError ) ]
8
10
pub enum LinalgError {
9
11
NotSquare ( NotSquareError ) ,
@@ -13,7 +15,7 @@ pub enum LinalgError {
13
15
Shape ( ShapeError ) ,
14
16
}
15
17
16
- #[ derive( Debug ) ]
18
+ #[ derive( Debug , new ) ]
17
19
pub struct LapackError {
18
20
pub return_code : i32 ,
19
21
}
@@ -36,7 +38,7 @@ impl From<i32> for LapackError {
36
38
}
37
39
}
38
40
39
- #[ derive( Debug ) ]
41
+ #[ derive( Debug , new ) ]
40
42
pub struct NotSquareError {
41
43
pub rows : usize ,
42
44
pub cols : usize ,
@@ -54,7 +56,7 @@ impl error::Error for NotSquareError {
54
56
}
55
57
}
56
58
57
- #[ derive( Debug ) ]
59
+ #[ derive( Debug , new ) ]
58
60
pub struct StrideError {
59
61
pub s0 : Ixs ,
60
62
pub s1 : Ixs ,
@@ -72,7 +74,7 @@ impl error::Error for StrideError {
72
74
}
73
75
}
74
76
75
- #[ derive( Debug ) ]
77
+ #[ derive( Debug , new ) ]
76
78
pub struct MemoryContError { }
77
79
78
80
impl fmt:: Display for MemoryContError {
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ extern crate num_complex;
39
39
extern crate ndarray;
40
40
#[ macro_use]
41
41
extern crate enum_error_derive;
42
+ #[ macro_use]
43
+ extern crate derive_new;
42
44
43
45
pub mod impls;
44
46
pub mod error;
You can’t perform that action at this time.
0 commit comments