We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c33e556 commit e13570aCopy full SHA for e13570a
1 file changed
src/order.rs
@@ -15,4 +15,25 @@ impl Order {
15
16
/// "F" (for Fortran) is an alias for column major ordering
17
pub const F: Order = Order::ColumnMajor;
18
+
19
+ /// Return Order::RowMajor if the input is true, Order::ColumnMajor otherwise
20
+ #[inline]
21
+ pub fn use_c(use_c: bool) -> Order {
22
+ if use_c { Order::C } else { Order::F }
23
+ }
24
25
+ /// Return Order::ColumnMajor if the input is true, Order::RowMajor otherwise
26
27
+ pub fn use_f(use_f: bool) -> Order {
28
+ Self::use_c(!use_f)
29
30
31
+ /// Return the transpose: row major becomes column major and vice versa.
32
33
+ pub fn transpose(self) -> Order {
34
+ match self {
35
+ Order::RowMajor => Order::ColumnMajor,
36
+ Order::ColumnMajor => Order::RowMajor,
37
38
39
}
0 commit comments