public override void WriteTo(XmlWriter xmlWriter) { SetUpCells(); SetUpColumnsGroupings(); SetUpRowGroupings(); xmlWriter.WriteStartElement("Matrix"); { xmlWriter.WriteAttributeString("Name", Name); if (Corner != null) { Corner.WriteTo(xmlWriter); } ColumnGroupings.WriteTo(xmlWriter); RowGroupings.WriteTo(xmlWriter); MatrixColumns.WriteTo(xmlWriter); MatrixRows.WriteTo(xmlWriter); base.WriteTo(xmlWriter); } xmlWriter.WriteEndElement(); }
public Matrix(Space source, Space target, double[,] elements) { if (elements.GetLength(0) != target.Dimension || elements.GetLength(1) != source.Dimension) { throw new ArgumentException("The length of elements has to be m×n, where m is the dimension of target and n the dimension of source."); } _SourceSpace = source; _TargetSpace = target; _Elements = elements; Rows = new MatrixRows(this); Columns = new MatrixColumns(this); }