/// <summary> /// Determines whether the specified index is valid to use with this array's indexer. /// </summary> /// <typeparam name="T">The type of values stored in the array.</typeparam> /// <param name="array">The array.</param> /// <param name="index">The index to check.</param> /// <returns>True if the index is valid to use, otherwise false.</returns> public static bool IsIndexValid <T>(this T[,,] array, Index3D index) { Contracts.Requires.That(array != null); return(index.IsIn(array.GetLowerBounds(), array.GetUpperBounds())); }
public static Index3D GetMiddleIndex <T>(this T[,,] array, bool roundUp = false) { Contracts.Requires.That(array != null); return(MiddleIndex.Get(array.GetLowerBounds(), array.GetUpperBounds(), roundUp)); }