File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -20,4 +20,27 @@ impl Order {
20
20
21
21
/// "A" is an alias for automatic ordering
22
22
pub const A : Order = Order :: Automatic ;
23
+
24
+ /// Return Order::RowMajor if the input is true, Order::ColumnMajor otherwise
25
+ #[ inline]
26
+ pub fn use_c ( use_c : bool ) -> Order {
27
+ if use_c { Order :: C } else { Order :: F }
28
+ }
29
+
30
+ /// Return Order::ColumnMajor if the input is true, Order::RowMajor otherwise
31
+ #[ inline]
32
+ pub fn use_f ( use_f : bool ) -> Order {
33
+ Self :: use_c ( !use_f)
34
+ }
35
+
36
+ /// Return the transpose: row major becomes column major and vice versa.
37
+ /// Note that automatic stays automatic.
38
+ #[ inline]
39
+ pub fn transpose ( self ) -> Order {
40
+ match self {
41
+ Order :: RowMajor => Order :: ColumnMajor ,
42
+ Order :: ColumnMajor => Order :: RowMajor ,
43
+ Order :: Automatic => Order :: Automatic ,
44
+ }
45
+ }
23
46
}
You can’t perform that action at this time.
0 commit comments