jjjkkkjjj / Matft

Numpy-like library in swift. (Multi-dimensional Array, ndarray, matrix and vector library)
BSD 3-Clause "New" or "Revised" License
134 stars 21 forks source link

Copy On Write implementation #36

Open jjjkkkjjj opened 1 year ago

jjjkkkjjj commented 1 year ago

I think it is easier for Matft to implement COW than I expected. Because MfArray has a data class, which is MfData, all we have to do are 2 points. First add “mutating” keyword into conversion method and subscript function. Second check the _isView property in those “mutating” function and then replace the referenced MfData into the new one if the _isView is true.

KhalidAl-otaibi commented 1 year ago

Should I try to implement it or are you working on it?

jjjkkkjjj commented 1 year ago

@KhalidAl-otaibi Could you try this if possible? I’d like to do this, but I’ll be busy until next month due to my work :( Of course, I’ll help you after next month or I’ll work on this if you can wait until next month :)