We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ff2e45 commit c04752fCopy full SHA for c04752f
1 file changed
src/order.rs
@@ -44,4 +44,25 @@ impl Order {
44
45
/// "F" (for Fortran) is an alias for column major ordering
46
pub const F: Order = Order::ColumnMajor;
47
+
48
+ /// Return Order::RowMajor if the input is true, Order::ColumnMajor otherwise
49
+ #[inline]
50
+ pub fn use_c(use_c: bool) -> Order {
51
+ if use_c { Order::C } else { Order::F }
52
+ }
53
54
+ /// Return Order::ColumnMajor if the input is true, Order::RowMajor otherwise
55
56
+ pub fn use_f(use_f: bool) -> Order {
57
+ Self::use_c(!use_f)
58
59
60
+ /// Return the transpose: row major becomes column major and vice versa.
61
62
+ pub fn transpose(self) -> Order {
63
+ match self {
64
+ Order::RowMajor => Order::ColumnMajor,
65
+ Order::ColumnMajor => Order::RowMajor,
66
67
68
}
0 commit comments