37
37
//! This `S` for a matrix `A` is called "leading dimension of the array A" in LAPACK document, and denoted by `lda`.
38
38
//!
39
39
40
- pub type LDA = i32 ;
41
- pub type LEN = i32 ;
42
- pub type Col = i32 ;
43
- pub type Row = i32 ;
44
-
45
40
#[ derive( Debug , Clone , Copy , PartialEq , Eq ) ]
46
41
pub enum MatrixLayout {
47
42
C { row : i32 , lda : i32 } ,
48
43
F { col : i32 , lda : i32 } ,
49
44
}
50
45
51
46
impl MatrixLayout {
52
- pub fn size ( & self ) -> ( Row , Col ) {
47
+ pub fn size ( & self ) -> ( i32 , i32 ) {
53
48
match * self {
54
49
MatrixLayout :: C { row, lda } => ( row, lda) ,
55
50
MatrixLayout :: F { col, lda } => ( lda, col) ,
56
51
}
57
52
}
58
53
59
- pub fn resized ( & self , row : Row , col : Col ) -> MatrixLayout {
54
+ pub fn resized ( & self , row : i32 , col : i32 ) -> MatrixLayout {
60
55
match * self {
61
56
MatrixLayout :: C { .. } => MatrixLayout :: C { row, lda : col } ,
62
57
MatrixLayout :: F { .. } => MatrixLayout :: F { col, lda : row } ,
63
58
}
64
59
}
65
60
66
- pub fn lda ( & self ) -> LDA {
61
+ pub fn lda ( & self ) -> i32 {
67
62
std:: cmp:: max (
68
63
1 ,
69
64
match * self {
@@ -72,7 +67,7 @@ impl MatrixLayout {
72
67
)
73
68
}
74
69
75
- pub fn len ( & self ) -> LEN {
70
+ pub fn len ( & self ) -> i32 {
76
71
match * self {
77
72
MatrixLayout :: C { row, .. } => row,
78
73
MatrixLayout :: F { col, .. } => col,
0 commit comments