Skip to content

Commit 78554cc

Browse files
committed
Move NormType to lapack_traits
1 parent c5398ac commit 78554cc

File tree

3 files changed

+20
-17
lines changed

3 files changed

+20
-17
lines changed

src/lapack_traits/mod.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,21 @@ pub enum Transpose {
5656
Transpose = b'T',
5757
Hermite = b'C',
5858
}
59+
60+
#[derive(Debug, Clone, Copy)]
61+
#[repr(u8)]
62+
pub enum NormType {
63+
One = b'O',
64+
Infinity = b'I',
65+
Frobenius = b'F',
66+
}
67+
68+
impl NormType {
69+
pub(crate) fn transpose(self) -> Self {
70+
match self {
71+
NormType::One => NormType::Infinity,
72+
NormType::Infinity => NormType::One,
73+
NormType::Frobenius => NormType::Frobenius,
74+
}
75+
}
76+
}

src/lapack_traits/opnorm.rs

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,7 @@ use lapack::c::Layout::ColumnMajor as cm;
66
use layout::MatrixLayout;
77
use types::*;
88

9-
#[repr(u8)]
10-
pub enum NormType {
11-
One = b'O',
12-
Infinity = b'I',
13-
Frobenius = b'F',
14-
}
15-
16-
impl NormType {
17-
fn transpose(self) -> Self {
18-
match self {
19-
NormType::One => NormType::Infinity,
20-
NormType::Infinity => NormType::One,
21-
NormType::Frobenius => NormType::Frobenius,
22-
}
23-
}
24-
}
9+
use super::NormType;
2510

2611
pub trait OperatorNorm_: AssociatedReal {
2712
unsafe fn opnorm(NormType, MatrixLayout, &[Self]) -> Self::Real;

src/lapack_traits/solve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use num_traits::Zero;
88
use types::*;
99

1010
use super::{Pivot, Transpose, into_result};
11-
use super::opnorm::NormType;
11+
use super::NormType;
1212

1313
/// Wraps `*getrf`, `*getri`, and `*getrs`
1414
pub trait Solve_: AssociatedReal + Sized {

0 commit comments

Comments
 (0)