Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/12/08 13:10:09 (15 years ago)
Author:
vdorfer
Message:

Created API documentation for HeuristLab.Data namespace (#331)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Data/DoubleMatrixData.cs

    r344 r737  
    2828
    2929namespace HeuristicLab.Data {
     30  /// <summary>
     31  /// A two-dimensional matrix consisting of double values.
     32  /// </summary>
    3033  public class DoubleMatrixData : ArrayDataBase {
     34    /// <summary>
     35    /// Gets or sets the double elements of the matrix.
     36    /// </summary>
     37    /// <remarks>Uses property <see cref="ArrayDataBase.Data"/> of base
     38    /// class <see cref="ArrayDataBase"/>. No own data storage present.</remarks>
    3139    public new double[,] Data {
    3240      get { return (double[,])base.Data; }
     
    3442    }
    3543
     44    /// <summary>
     45    /// Initializes a new instance of the <see cref="DoubleMatrixData"/> class.
     46    /// </summary>
    3647    public DoubleMatrixData() {
    3748      Data = new double[1, 1];
    3849    }
     50    /// <summary>
     51    /// Initializes a new instance of the <see cref="DoubleMatrixData"/> class.
     52    /// <note type="caution"> No CopyConstructor! <paramref name="data"/> is not copied!</note>
     53    /// </summary>
     54    /// <param name="data">The two-dimensional double matrix the instance should represent.</param>
    3955    public DoubleMatrixData(double[,] data) {
    4056      Data = data;
    4157    }
    4258
     59    /// <summary>
     60    /// Creates a new instance of the <see cref="DoubleMatrixDataView"/> class.
     61    /// </summary>
     62    /// <returns>The created instance as <see cref="DoubleMatrixDataView"/>.</returns>
    4363    public override IView CreateView() {
    4464      return new DoubleMatrixDataView(this);
    4565    }
    4666
     67    /// <summary>
     68    /// Saves the current instance as <see cref="XmlNode"/> in the specified <paramref name="document"/>.
     69    /// </summary>
     70    /// <remarks>The dimensions of the matrix are saved as attributes (<c>Dimension1</c>,<c>Dimension2</c>),
     71    /// formatted according to the local culture info and its number format.<br/>
     72    /// The elements of the matrix are saved as string in the node's inner text,
     73    /// each element separated by a semicolon, all line by line, formatted according to the
     74    /// local number format.</remarks>
     75    /// <param name="name">The (tag)name of the <see cref="XmlNode"/>.</param>
     76    /// <param name="document">The <see cref="XmlDocument"/> where the data is saved.</param>
     77    /// <param name="persistedObjects">A dictionary of all already persisted objects. (Needed to avoid cycles.)</param>
     78    /// <returns>The saved <see cref="XmlNode"/>.</returns>
    4779    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid,IStorable> persistedObjects) {
    4880      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
     
    5688      return node;
    5789    }
     90    /// <summary>
     91    /// Loads the persisted matrix from the specified <paramref name="node"/>.
     92    /// </summary>
     93    /// <remarks>The dimensions of the matrix must be saved as Attributes (<c>Dimension1</c>, <c>Dimension2</c>),
     94    /// formatted in the local number format. <br/>
     95    /// The elements of the matrix must be saved in the node's inner text as string,
     96    /// each element separated by a semicolon, line by line, formatted according to the local
     97    /// culture info and its number format (see <see cref="GetXmlNode"/>).</remarks>
     98    /// <exception cref="System.FormatException">Thrown when a saved element cannot be parsed as a double value.</exception>
     99    /// <param name="node">The <see cref="XmlNode"/> where the instance is saved.</param>
     100    /// <param name="restoredObjects">The dictionary of all already restored objects. (Needed to avoid cycles.)</param>
    58101    public override void Populate(XmlNode node, IDictionary<Guid,IStorable> restoredObjects) {
    59102      base.Populate(node, restoredObjects);
     
    72115    }
    73116
     117    /// <summary>
     118    /// The string representation of the matrix.
     119    /// </summary>
     120    /// <returns>The elements of the matrix as a string, line by line, each element separated by a
     121    /// semicolon and formatted according to local number format.</returns>
    74122    public override string ToString() {
    75123      return ToString(CultureInfo.CurrentCulture.NumberFormat);
    76124    }
    77 
     125   
     126    /// <summary>
     127    /// The string representation of the matrix, considering a specified <paramref name="format"/>.
     128    /// </summary>
     129    /// <param name="format">The <see cref="NumberFormatInfo"/> the double values are formatted accordingly.</param>
     130    /// <returns>The elements of the matrix as a string, line by line, each element separated by a
     131    /// semicolon and formatted according to the specified <paramref name="format"/>.</returns>
    78132    private string ToString(NumberFormatInfo format) {
    79133      StringBuilder builder = new StringBuilder();
Note: See TracChangeset for help on using the changeset viewer.