Re: [swift-users] [swift-evolution] Low efficiency multidimensional array problem

2017-04-21 Thread www.hbu.cn--- via swift-users
Hi Jaden Geller, Saagar , Thanks for the reply and advice. Array2D is really faster than the default two dimension. But I think as a general language, Swift should provide default efficient ways for multiple dimension array. I found this problem when I write an algorithm. It is a DP problem

Re: [swift-users] [swift-evolution] Low efficiency multidimensional array problem

2017-04-19 Thread Jaden Geller via swift-users
Hi Hbucius, You can define your own `Array2D` type that uses a 1-dimensional array as backing (for fast performance) but exposes a high-level 2-dimensional array API. Here’s a really primitive starting point I found on GitHub: https://github.com/raywenderlich/swift-algorithm-club/blob/master/Arr

Re: [swift-users] [swift-evolution] Low efficiency multidimensional array problem

2017-04-18 Thread Saagar Jha via swift-users
It might be helpful if you showed a bit more of the code you’re working on, so that we can better see what you’re trying to do. Is there any operation in particular that is slow? Also, CC’ing swift-users since I think it belongs there. Saagar Jha > On Apr 18, 2017, at 22:57, Hbucius Smith via