|
|
|
@ -198,6 +198,13 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
/// <param name="result">The vector to store the result of the pointwise power.</param>
|
|
|
|
protected abstract void DoPointwisePower(T exponent, Vector<T> result); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Pointwise raise this vector to an exponent vector and store the result into the result vector.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="exponent">The exponent vector to raise this vector values to.</param>
|
|
|
|
/// <param name="result">The vector to store the result of the pointwise power.</param>
|
|
|
|
protected abstract void DoPointwisePower(Vector<T> exponent, Vector<T> result); |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Pointwise canonical modulus, where the result has the sign of the divisor,
|
|
|
|
/// of this vector with another vector and stores the result into the result vector.
|
|
|
|
@ -822,6 +829,43 @@ namespace MathNet.Numerics.LinearAlgebra |
|
|
|
DoPointwisePower(exponent, result); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Pointwise raise this vector to an exponent and store the result into the result vector.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="exponent">The exponent to raise this vector values to.</param>
|
|
|
|
public Vector<T> PointwisePower(Vector<T> exponent) |
|
|
|
{ |
|
|
|
if (Count != exponent.Count) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "exponent"); |
|
|
|
} |
|
|
|
|
|
|
|
var result = Build.SameAs(this); |
|
|
|
DoPointwisePower(exponent, result); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Pointwise raise this vector to an exponent.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="exponent">The exponent to raise this vector values to.</param>
|
|
|
|
/// <param name="result">The vector to store the result into.</param>
|
|
|
|
/// <exception cref="ArgumentException">If this vector and <paramref name="result"/> are not the same size.</exception>
|
|
|
|
public void PointwisePower(Vector<T> exponent, Vector<T> result) |
|
|
|
{ |
|
|
|
if (Count != exponent.Count) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "exponent"); |
|
|
|
} |
|
|
|
|
|
|
|
if (Count != result.Count) |
|
|
|
{ |
|
|
|
throw new ArgumentException(Resources.ArgumentVectorsSameLength, "result"); |
|
|
|
} |
|
|
|
|
|
|
|
DoPointwisePower(exponent, result); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Pointwise canonical modulus, where the result has the sign of the divisor,
|
|
|
|
/// of this vector with another vector.
|
|
|
|
|