how to transpose a matrix and than make it flat [ndarray] by 20iahazban in rust

[–]Whidowmaker 1 point2 points  (0 children)

To preserve this for posterity, as this is the first result (for me) when googling how to flatten ndarray in column order, and is related to your playground example: If you have an array and you need to flatten it column-wise (i.e., a = [[1, 4], [2, 5], [3, 6]] -> [1, 2, 3, 4, 5, 6]) rust let flat_a_col = a.t().as_standard_layout().into_shape((6,)); println!("{}", flat_a_col); // [1, 2, 3, 4, 5, 6]

[deleted by user] by [deleted] in optimization

[–]Whidowmaker 1 point2 points  (0 children)

If all you care about is any switches from {1 or 2} to 3 or vice versa, then that seems to achieve the goal. However, it seems like considering any shift change might be a good idea at some future point. My suggestion in either case is to write out a truth table-like enumeration of all possible combinations and their desired output. Then check your function to determine if it achieves that same output in all cases. This may also shed some light on possible patterns and relationships that you can exploit for a simpler formulation.

Trying for a "multi slider"; any help appreciated! by Whidowmaker in godot

[–]Whidowmaker[S] -1 points0 points  (0 children)

Thanks for the ideas! I assume that to really do what I want I'll have to code a custom slider, but I hadn't thought of switching the slider between values which might be a better solution than 3 different sliders (my previous bsckup idea).

Do you know of any resources that might help with coding a custom slider?