/// <summary> /// Initializes a new instance of the <see cref="Cloud"/> class that /// contains points having the specified weights and whose coordinates /// are taken with respect to /// the standard basis. /// </summary> /// <param name="coordinates">The coordinates of the cloud points.</param> /// <param name="weights">The weights of the cloud points.</param> /// <remarks> /// <para>Matrix <paramref name="coordinates"/> has as many rows as the /// number of points in the cloud. /// The number of columns is the dimension of the space in which the /// points lie.</para> /// <para>Each row represents the coordinates of a given point in the cloud. /// Points are thus well ordered, and hence thoroughly identified, by the /// index of the row /// in which its coordinates are stored. As a consequence, the same order /// must be followed /// when inserting entries in the vector of weights. The coordinates are /// automatically referred to /// the standard basis having dimension equal to the number of columns of /// <paramref name="coordinates"/>.</para> /// </remarks> /// <exception cref="ArgumentNullException"> /// <paramref name="coordinates"/> is <b>null</b>.<br/> /// -or-<br/> /// <paramref name="weights"/> is <b>null</b>. /// </exception> /// <exception cref="ArgumentOutOfRangeException"> /// <paramref name="weights"/> is not a column vector.<br/> /// -or-<br/> /// <paramref name="coordinates"/> /// and <paramref name="weights"/> have not the same numbers of rows. /// </exception> public Cloud(DoubleMatrix coordinates, DoubleMatrix weights) : this( coordinates, weights, coordinates is null ? null : Basis.Standard( coordinates.NumberOfColumns)) { }
/// <summary> /// Initializes a new instance of the <see cref="Cloud"/> class that /// contains points whose coordinates /// are taken with respect to /// the standard basis. To each point is assigned a weight equal to /// the reciprocal of the /// number of points. /// </summary> /// <param name="coordinates">The coordinates of the cloud points.</param> /// <remarks> /// <para>Matrix <paramref name="coordinates"/> has as many rows as the /// number of points in the cloud. /// The number of columns is the dimension of the space in which the /// points lie.</para> /// <para>Each row represents the coordinates of a given point in the cloud. /// Points are thus well ordered, and hence thoroughly identified, by the /// index of the row /// in which its coordinates are stored. Cloud points are automatically /// weighted using /// as elementary weight the reciprocal of the number of points. The /// coordinates are automatically /// referred to the standard basis having dimension equal to the number /// of columns of /// <paramref name="coordinates"/>.</para> /// </remarks> /// <exception cref="ArgumentNullException"> /// <paramref name="coordinates"/> is <b>null</b>. /// </exception> public Cloud(DoubleMatrix coordinates) : this( coordinates, coordinates is null ? null : DoubleMatrix.Dense( coordinates.NumberOfRows, 1, 1.0 / coordinates.NumberOfRows), coordinates is null ? null : Basis.Standard( coordinates.NumberOfColumns)) { }