Browse Source

Comments: compact inline xml doc

v2
Christoph Ruegg 14 years ago
parent
commit
f505ced801
  1. 296
      src/Numerics/LinearAlgebra/Generic/Vector.cs

296
src/Numerics/LinearAlgebra/Generic/Vector.cs

@ -144,9 +144,7 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Returns a deep-copy clone of the vector. /// Returns a deep-copy clone of the vector.
/// </summary> /// </summary>
/// <returns> /// <returns>A deep-copy clone of the vector.</returns>
/// A deep-copy clone of the vector.
/// </returns>
public Vector<T> Clone() public Vector<T> Clone()
{ {
var result = CreateVector(Count); var result = CreateVector(Count);
@ -157,15 +155,9 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Copies the values of this vector into the target vector. /// Copies the values of this vector into the target vector.
/// </summary> /// </summary>
/// <param name="target"> /// <param name="target">The vector to copy elements into.</param>
/// The vector to copy elements into. /// <exception cref="ArgumentNullException">If <paramref name="target"/> is <see langword="null"/>.</exception>
/// </param> /// <exception cref="ArgumentException">If <paramref name="target"/> is not the same size as this vector.</exception>
/// <exception cref="ArgumentNullException">
/// If <paramref name="target"/> is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// If <paramref name="target"/> is not the same size as this vector.
/// </exception>
public void CopyTo(Vector<T> target) public void CopyTo(Vector<T> target)
{ {
if (target == null) if (target == null)
@ -179,18 +171,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Copies the requested elements from this vector to another. /// Copies the requested elements from this vector to another.
/// </summary> /// </summary>
/// <param name="destination"> /// <param name="destination">The vector to copy the elements to.</param>
/// The vector to copy the elements to. /// <param name="sourceIndex">The element to start copying from.</param>
/// </param> /// <param name="targetIndex">The element to start copying to.</param>
/// <param name="sourceIndex"> /// <param name="count">The number of elements to copy.</param>
/// The element to start copying from.
/// </param>
/// <param name="targetIndex">
/// The element to start copying to.
/// </param>
/// <param name="count">
/// The number of elements to copy.
/// </param>
public void CopySubVectorTo(Vector<T> destination, int sourceIndex, int targetIndex, int count) public void CopySubVectorTo(Vector<T> destination, int sourceIndex, int targetIndex, int count)
{ {
if (destination == null) if (destination == null)
@ -212,27 +196,17 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// Creates a matrix with the given dimensions using the same storage type /// Creates a matrix with the given dimensions using the same storage type
/// as this vector. /// as this vector.
/// </summary> /// </summary>
/// <param name="rows"> /// <param name="rows">The number of rows.</param>
/// The number of rows. /// <param name="columns">The number of columns.</param>
/// </param> /// <returns>A matrix with the given dimensions.</returns>
/// <param name="columns">
/// The number of columns.
/// </param>
/// <returns>
/// A matrix with the given dimensions.
/// </returns>
public abstract Matrix<T> CreateMatrix(int rows, int columns); public abstract Matrix<T> CreateMatrix(int rows, int columns);
/// <summary> /// <summary>
/// Creates a <strong>Vector</strong> of the given size using the same storage type /// Creates a <strong>Vector</strong> of the given size using the same storage type
/// as this vector. /// as this vector.
/// </summary> /// </summary>
/// <param name="size"> /// <param name="size">The size of the <strong>Vector</strong> to create.</param>
/// The size of the <strong>Vector</strong> to create. /// <returns>The new <c>Vector</c>.</returns>
/// </param>
/// <returns>
/// The new <c>Vector</c>.
/// </returns>
public abstract Vector<T> CreateVector(int size); public abstract Vector<T> CreateVector(int size);
#region Elementary operations #region Elementary operations
@ -240,9 +214,7 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Adds a scalar to each element of the vector. /// Adds a scalar to each element of the vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to add.</param>
/// The scalar to add.
/// </param>
/// <returns>A copy of the vector with the scalar added.</returns> /// <returns>A copy of the vector with the scalar added.</returns>
public Vector<T> Add(T scalar) public Vector<T> Add(T scalar)
{ {
@ -259,18 +231,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Adds a scalar to each element of the vector and stores the result in the result vector. /// Adds a scalar to each element of the vector and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to add.</param>
/// The scalar to add. /// <param name="result">The vector to store the result of the addition.</param>
/// </param> /// <exception cref="ArgumentNullException">If the result vector is <see langword="null"/>.</exception>
/// <param name="result"> /// <exception cref="ArgumentException">If this vector and <paramref name="result"/> are not the same size.</exception>
/// The vector to store the result of the addition.
/// </param>
/// <exception cref="ArgumentNullException">
/// If the result vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="result"/> are not the same size.
/// </exception>
public void Add(T scalar, Vector<T> result) public void Add(T scalar, Vector<T> result)
{ {
if (result == null) if (result == null)
@ -295,20 +259,14 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Adds a scalar to each element of the vector and stores the result in the result vector. /// Adds a scalar to each element of the vector and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to add.</param>
/// The scalar to add. /// <param name="result">The vector to store the result of the addition.</param>
/// </param>
/// <param name="result">
/// The vector to store the result of the addition.
/// </param>
protected abstract void DoAdd(T scalar, Vector<T> result); protected abstract void DoAdd(T scalar, Vector<T> result);
/// <summary> /// <summary>
/// Returns a copy of this vector. /// Returns a copy of this vector.
/// </summary> /// </summary>
/// <returns> /// <returns>This vector.</returns>
/// This vector.
/// </returns>
/// <remarks> /// <remarks>
/// Added as an alternative to the unary addition operator. /// Added as an alternative to the unary addition operator.
/// </remarks> /// </remarks>
@ -320,16 +278,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Adds another vector to this vector. /// Adds another vector to this vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The vector to add to this one.</param>
/// The vector to add to this one.
/// </param>
/// <returns>A new vector containing the sum of both vectors.</returns> /// <returns>A new vector containing the sum of both vectors.</returns>
/// <exception cref="ArgumentNullException"> /// <exception cref="ArgumentNullException">If the other vector is <see langword="null"/>.</exception>
/// If the other vector is <see langword="null"/>. /// <exception cref="ArgumentException">If this vector and <paramref name="other"/> are not the same size.</exception>
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="other"/> are not the same size.
/// </exception>
public Vector<T> Add(Vector<T> other) public Vector<T> Add(Vector<T> other)
{ {
if (other == null) if (other == null)
@ -350,24 +302,12 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Adds another vector to this vector and stores the result into the result vector. /// Adds another vector to this vector and stores the result into the result vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The vector to add to this one.</param>
/// The vector to add to this one. /// <param name="result">The vector to store the result of the addition.</param>
/// </param> /// <exception cref="ArgumentNullException">If the other vector is <see langword="null"/>.</exception>
/// <param name="result"> /// <exception cref="ArgumentNullException">If the result vector is <see langword="null"/>.</exception>
/// The vector to store the result of the addition. /// <exception cref="ArgumentException">If this vector and <paramref name="other"/> are not the same size.</exception>
/// </param> /// <exception cref="ArgumentException">If this vector and <paramref name="result"/> are not the same size.</exception>
/// <exception cref="ArgumentNullException">
/// If the other vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentNullException">
/// If the result vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="other"/> are not the same size.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="result"/> are not the same size.
/// </exception>
public void Add(Vector<T> other, Vector<T> result) public void Add(Vector<T> other, Vector<T> result)
{ {
if (result == null) if (result == null)
@ -386,20 +326,14 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Adds another vector to this vector and stores the result into the result vector. /// Adds another vector to this vector and stores the result into the result vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The vector to add to this one.</param>
/// The vector to add to this one. /// <param name="result">The vector to store the result of the addition.</param>
/// </param>
/// <param name="result">
/// The vector to store the result of the addition.
/// </param>
protected abstract void DoAdd(Vector<T> other, Vector<T> result); protected abstract void DoAdd(Vector<T> other, Vector<T> result);
/// <summary> /// <summary>
/// Subtracts a scalar from each element of the vector. /// Subtracts a scalar from each element of the vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to subtract.</param>
/// The scalar to subtract.
/// </param>
/// <returns>A new vector containing the subtraction of this vector and the scalar.</returns> /// <returns>A new vector containing the subtraction of this vector and the scalar.</returns>
public Vector<T> Subtract(T scalar) public Vector<T> Subtract(T scalar)
{ {
@ -416,18 +350,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Subtracts a scalar from each element of the vector and stores the result in the result vector. /// Subtracts a scalar from each element of the vector and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to subtract.</param>
/// The scalar to subtract. /// <param name="result">The vector to store the result of the subtraction.</param>
/// </param> /// <exception cref="ArgumentNullException">If the result vector is <see langword="null"/>.</exception>
/// <param name="result"> /// <exception cref="ArgumentException">If this vector and <paramref name="result"/> are not the same size.</exception>
/// The vector to store the result of the subtraction.
/// </param>
/// <exception cref="ArgumentNullException">
/// If the result vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="result"/> are not the same size.
/// </exception>
public void Subtract(T scalar, Vector<T> result) public void Subtract(T scalar, Vector<T> result)
{ {
if (result == null) if (result == null)
@ -452,38 +378,24 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Subtracts a scalar from each element of the vector and stores the result in the result vector. /// Subtracts a scalar from each element of the vector and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to subtract.</param>
/// The scalar to subtract. /// <param name="result">The vector to store the result of the subtraction.</param>
/// </param>
/// <param name="result">
/// The vector to store the result of the subtraction.
/// </param>
protected abstract void DoSubtract(T scalar, Vector<T> result); protected abstract void DoSubtract(T scalar, Vector<T> result);
/// <summary> /// <summary>
/// Returns a negated vector. /// Returns a negated vector.
/// </summary> /// </summary>
/// <returns> /// <returns>The negated vector.</returns>
/// The negated vector. /// <remarks>Added as an alternative to the unary negation operator.</remarks>
/// </returns>
/// <remarks>
/// Added as an alternative to the unary negation operator.
/// </remarks>
public abstract Vector<T> Negate(); public abstract Vector<T> Negate();
/// <summary> /// <summary>
/// Subtracts another vector from this vector. /// Subtracts another vector from this vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The vector to subtract from this one.</param>
/// The vector to subtract from this one.
/// </param>
/// <returns>A new vector containing the subtraction of the the two vectors.</returns> /// <returns>A new vector containing the subtraction of the the two vectors.</returns>
/// <exception cref="ArgumentNullException"> /// <exception cref="ArgumentNullException">If the other vector is <see langword="null"/>.</exception>
/// If the other vector is <see langword="null"/>. /// <exception cref="ArgumentException">If this vector and <paramref name="other"/> are not the same size.</exception>
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="other"/> are not the same size.
/// </exception>
public Vector<T> Subtract(Vector<T> other) public Vector<T> Subtract(Vector<T> other)
{ {
if (other == null) if (other == null)
@ -504,24 +416,12 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Subtracts another vector to this vector and stores the result into the result vector. /// Subtracts another vector to this vector and stores the result into the result vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The vector to subtract from this one.</param>
/// The vector to subtract from this one. /// <param name="result">The vector to store the result of the subtraction.</param>
/// </param> /// <exception cref="ArgumentNullException">If the other vector is <see langword="null"/>.</exception>
/// <param name="result"> /// <exception cref="ArgumentNullException">If the result vector is <see langword="null"/>.</exception>
/// The vector to store the result of the subtraction. /// <exception cref="ArgumentException">If this vector and <paramref name="other"/> are not the same size.</exception>
/// </param> /// <exception cref="ArgumentException">If this vector and <paramref name="result"/> are not the same size.</exception>
/// <exception cref="ArgumentNullException">
/// If the other vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentNullException">
/// If the result vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="other"/> are not the same size.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="result"/> are not the same size.
/// </exception>
public void Subtract(Vector<T> other, Vector<T> result) public void Subtract(Vector<T> other, Vector<T> result)
{ {
if (result == null) if (result == null)
@ -540,20 +440,14 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Subtracts another vector to this vector and stores the result into the result vector. /// Subtracts another vector to this vector and stores the result into the result vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The vector to subtract from this one.</param>
/// The vector to subtract from this one. /// <param name="result">The vector to store the result of the subtraction.</param>
/// </param>
/// <param name="result">
/// The vector to store the result of the subtraction.
/// </param>
protected abstract void DoSubtract(Vector<T> other, Vector<T> result); protected abstract void DoSubtract(Vector<T> other, Vector<T> result);
/// <summary> /// <summary>
/// Multiplies a scalar to each element of the vector. /// Multiplies a scalar to each element of the vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to multiply.</param>
/// The scalar to multiply.
/// </param>
/// <returns>A new vector that is the multiplication of the vector and the scalar.</returns> /// <returns>A new vector that is the multiplication of the vector and the scalar.</returns>
public Vector<T> Multiply(T scalar) public Vector<T> Multiply(T scalar)
{ {
@ -575,18 +469,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Multiplies a scalar to each element of the vector and stores the result in the result vector. /// Multiplies a scalar to each element of the vector and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to multiply.</param>
/// The scalar to multiply. /// <param name="result">The vector to store the result of the multiplication.</param>
/// </param> /// <exception cref="ArgumentNullException">If the result vector is <see langword="null"/>.</exception>
/// <param name="result"> /// <exception cref="ArgumentException">If this vector and <paramref name="result"/> are not the same size.</exception>
/// The vector to store the result of the multiplication.
/// </param>
/// <exception cref="ArgumentNullException">
/// If the result vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="result"/> are not the same size.
/// </exception>
public void Multiply(T scalar, Vector<T> result) public void Multiply(T scalar, Vector<T> result)
{ {
if (result == null) if (result == null)
@ -617,29 +503,17 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Multiplies a scalar to each element of the vector and stores the result in the result vector. /// Multiplies a scalar to each element of the vector and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to multiply.</param>
/// The scalar to multiply. /// <param name="result">The vector to store the result of the multiplication.</param>
/// </param>
/// <param name="result">
/// The vector to store the result of the multiplication.
/// </param>
protected abstract void DoMultiply(T scalar, Vector<T> result); protected abstract void DoMultiply(T scalar, Vector<T> result);
/// <summary> /// <summary>
/// Computes the dot product between this vector and another vector. /// Computes the dot product between this vector and another vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The other vector to add.</param>
/// The other vector to add. /// <returns>The result of the addition.</returns>
/// </param> /// <exception cref="ArgumentException">If <paramref name="other"/> is not of the same size.</exception>
/// <returns>s /// <exception cref="ArgumentNullException">If <paramref name="other"/> is <see langword="null"/>.</exception>
/// The result of the addition.
/// </returns>
/// <exception cref="ArgumentException">
/// If <paramref name="other"/> is not of the same size.
/// </exception>
/// <exception cref="ArgumentNullException">
/// If <paramref name="other"/> is <see langword="null"/>.
/// </exception>
public T DotProduct(Vector<T> other) public T DotProduct(Vector<T> other)
{ {
if (other == null) if (other == null)
@ -658,20 +532,14 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Computes the dot product between this vector and another vector. /// Computes the dot product between this vector and another vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The other vector to add.</param>
/// The other vector to add. /// <returns>The result of the addition.</returns>
/// </param>
/// <returns>s
/// The result of the addition.
/// </returns>
protected abstract T DoDotProduct(Vector<T> other); protected abstract T DoDotProduct(Vector<T> other);
/// <summary> /// <summary>
/// Divides each element of the vector by a scalar. /// Divides each element of the vector by a scalar.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to divide with.</param>
/// The scalar to divide with.
/// </param>
/// <returns>A new vector that is the division of the vector and the scalar.</returns> /// <returns>A new vector that is the division of the vector and the scalar.</returns>
public Vector<T> Divide(T scalar) public Vector<T> Divide(T scalar)
{ {
@ -688,18 +556,10 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Divides each element of the vector by a scalar and stores the result in the result vector. /// Divides each element of the vector by a scalar and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to divide with.</param>
/// The scalar to divide with. /// <param name="result">The vector to store the result of the division.</param>
/// </param> /// <exception cref="ArgumentNullException">If the result vector is <see langword="null"/>.</exception>
/// <param name="result"> /// <exception cref="ArgumentException">If this vector and <paramref name="result"/> are not the same size.</exception>
/// The vector to store the result of the division.
/// </param>
/// <exception cref="ArgumentNullException">
/// If the result vector is <see langword="null"/>.
/// </exception>
/// <exception cref="ArgumentException">
/// If this vector and <paramref name="result"/> are not the same size.
/// </exception>
public void Divide(T scalar, Vector<T> result) public void Divide(T scalar, Vector<T> result)
{ {
if (result == null) if (result == null)
@ -724,12 +584,8 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Divides each element of the vector by a scalar and stores the result in the result vector. /// Divides each element of the vector by a scalar and stores the result in the result vector.
/// </summary> /// </summary>
/// <param name="scalar"> /// <param name="scalar">The scalar to divide with.</param>
/// The scalar to divide with. /// <param name="result">The vector to store the result of the division.</param>
/// </param>
/// <param name="result">
/// The vector to store the result of the division.
/// </param>
protected abstract void DoDivide(T scalar, Vector<T> result); protected abstract void DoDivide(T scalar, Vector<T> result);
/// <summary> /// <summary>
@ -858,12 +714,8 @@ namespace MathNet.Numerics.LinearAlgebra.Generic
/// <summary> /// <summary>
/// Pointwise divide this vector with another vector and stores the result into the result vector. /// Pointwise divide this vector with another vector and stores the result into the result vector.
/// </summary> /// </summary>
/// <param name="other"> /// <param name="other">The vector to pointwise divide this one by.</param>
/// The vector to pointwise divide this one by. /// <param name="result">The result of the division.</param>
/// </param>
/// <param name="result">
/// The result of the division.
/// </param>
protected abstract void DoPointwiseDivide(Vector<T> other, Vector<T> result); protected abstract void DoPointwiseDivide(Vector<T> other, Vector<T> result);
/// <summary> /// <summary>

Loading…
Cancel
Save