public BoxProjection(Box <T> source, IndexSpec index) { Contract.Requires <ArgumentNullException>(source != null, "source"); Contract.Requires <ArgumentNullException>(index != null, "indices"); Contract.Requires <ArgumentException>(source.Rank >= index.MinSourceDimension, "Index length is greater than source rank."); _source = source; _index = index.Project(FullSourceIndex); }
public override Box <T> this[params DimSpec[] indices] { get { Contract.Requires <ArgumentNullException>(indices != null, "indices"); var indexToApply = new IndexSpec(indices); var newIndex = indexToApply.Project(_index); return(new BoxProjection <T>(_source, newIndex)); } }