public Matrix(IList <string> xHeaders, IList <string> yHeaders, IEnumerable <IMatrixable <TValue> > items) : this(xHeaders, yHeaders) { foreach (var item in items) { var xHeaderIndex = XHeaders.IndexOf(item.XHeader); var yHeaderIndex = YHeaders.IndexOf(item.YHeader); Cells[xHeaderIndex][yHeaderIndex] = new Cell <TValue>(item.Value); } }
public TValue ValueAt(string xHeader, string yHeader) => Cells[XHeaders.IndexOf(xHeader)][YHeaders.IndexOf(yHeader)].Value;