From 9cc336e5a806d8ab4d355a038ce901318c003b4c Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Fri, 18 Nov 2016 09:06:11 +0100 Subject: [PATCH] LA: Symbolic .^ operator for pointwise power where supported (F#) --- src/Numerics/LinearAlgebra/Matrix.Operators.cs | 12 ++++++++++++ src/Numerics/LinearAlgebra/Vector.Operators.cs | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/Numerics/LinearAlgebra/Matrix.Operators.cs b/src/Numerics/LinearAlgebra/Matrix.Operators.cs index 0ee07cf9..f326e5d7 100644 --- a/src/Numerics/LinearAlgebra/Matrix.Operators.cs +++ b/src/Numerics/LinearAlgebra/Matrix.Operators.cs @@ -293,5 +293,17 @@ namespace MathNet.Numerics.LinearAlgebra { return dividend.PointwiseRemainder(divisor); } + + [SpecialName] + public static Matrix op_DotHat(Matrix matrix, Matrix exponent) + { + return matrix.PointwisePower(exponent); + } + + [SpecialName] + public static Matrix op_DotHat(Matrix matrix, T exponent) + { + return matrix.PointwisePower(exponent); + } } } diff --git a/src/Numerics/LinearAlgebra/Vector.Operators.cs b/src/Numerics/LinearAlgebra/Vector.Operators.cs index adf01d3c..d773eaa0 100644 --- a/src/Numerics/LinearAlgebra/Vector.Operators.cs +++ b/src/Numerics/LinearAlgebra/Vector.Operators.cs @@ -259,5 +259,17 @@ namespace MathNet.Numerics.LinearAlgebra { return dividend.PointwiseRemainder(divisor); } + + [SpecialName] + public static Vector op_DotHat(Vector vector, Vector exponent) + { + return vector.PointwisePower(exponent); + } + + [SpecialName] + public static Vector op_DotHat(Vector vector, T exponent) + { + return vector.PointwisePower(exponent); + } } }