/// <summary> /// Iterates this array efficiently. /// </summary> /// <param name="function">The function to call for every value in this array.</param> public virtual void ForEach(ForFunctionHandler function) { fixed(double *src = this) { var cnt = LinearLength; for (int i = 0; i < cnt; i++) { function(src[i]); } } }
public virtual void ForEach(int property, ForFunctionHandler function) { if (property >= Properties) { throw new ArgumentOutOfRangeException(nameof(property)); } if (Properties == 1) { ForEach(function); } else { fixed(double *src = this) { var cnt = Count; var props = Properties; for (int i = property; i < cnt; i += props) { function(src[i]); } } } }