diff --git a/src/Numerics/Constants.cs b/src/Numerics/Constants.cs index 214f7179..745af170 100644 --- a/src/Numerics/Constants.cs +++ b/src/Numerics/Constants.cs @@ -393,6 +393,9 @@ namespace MathNet.Numerics /// Helion Molar Mass: [kg mol^-1] (2007 CODATA) public const double HelionMolarMass = 3.0149322473e-3; + /// Avogadro constant: [mol^-1] (2010 CODATA) + public const double Avogadro = 6.0221412927e23; + #endregion #region Scientific Prefixes diff --git a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs index 656b6f9d..9616250b 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs @@ -491,7 +491,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex throw new ArgumentException(Resources.ArgumentVectorsSameLength, "rightSide"); } - return Control.LinearAlgebraProvider.DotProduct(leftSide.Values, rightSide.Values); + return leftSide.DotProduct(rightSide); } /// @@ -508,7 +508,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex throw new ArgumentNullException("leftSide"); } - return (DenseVector)leftSide.Multiply(Complex.One / rightSide); + return (DenseVector)leftSide.Divide(rightSide); } /// diff --git a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs index 6c01a206..d382ff0b 100644 --- a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs @@ -177,6 +177,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex /// Creates a with a the given dimension. /// /// The size of the vector. + /// True if all fields must be mutable. /// /// A with the given dimension. /// diff --git a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs index ba6e7534..2c532191 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs @@ -706,7 +706,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex throw new ArgumentNullException("leftSide"); } - return (SparseVector)leftSide.Multiply(Complex.One / rightSide); + return (SparseVector)leftSide.Divide(rightSide); } /// diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs index b384b390..86719122 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs @@ -491,7 +491,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 throw new ArgumentException(Resources.ArgumentVectorsSameLength, "rightSide"); } - return Control.LinearAlgebraProvider.DotProduct(leftSide.Values, rightSide.Values); + return leftSide.DotProduct(rightSide); } /// @@ -508,7 +508,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 throw new ArgumentNullException("leftSide"); } - return (DenseVector)leftSide.Multiply(Complex32.One / rightSide); + return (DenseVector)leftSide.Divide(rightSide); } /// diff --git a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs index ab0282ec..89fd1db0 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs @@ -177,6 +177,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 /// Creates a with a the given dimension. /// /// The size of the vector. + /// True if all fields must be mutable. /// /// A with the given dimension. /// diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs index ba0cdbaa..203d5ff6 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs @@ -706,7 +706,7 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 throw new ArgumentNullException("leftSide"); } - return (SparseVector)leftSide.Multiply(Complex32.One / rightSide); + return (SparseVector)leftSide.Divide(rightSide); } /// diff --git a/src/Numerics/LinearAlgebra/Double/DenseVector.cs b/src/Numerics/LinearAlgebra/Double/DenseVector.cs index e5fa5159..98d324bc 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseVector.cs @@ -491,7 +491,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double throw new ArgumentException(Resources.ArgumentVectorsSameLength, "rightSide"); } - return Control.LinearAlgebraProvider.DotProduct(leftSide.Values, rightSide.Values); + return leftSide.DotProduct(rightSide); } /// @@ -508,7 +508,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double throw new ArgumentNullException("leftSide"); } - return (DenseVector)leftSide.Multiply(1.0 / rightSide); + return (DenseVector)leftSide.Divide(rightSide); } /// @@ -542,7 +542,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// The divisor to use, /// The result of the calculation /// If is . - public static DenseVector operator %(DenseVector leftSide, float rightSide) + public static DenseVector operator %(DenseVector leftSide, double rightSide) { if (leftSide == null) { diff --git a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs index 5ccd41cd..105c783c 100644 --- a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs @@ -176,6 +176,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// Creates a with a the given dimension. /// /// The size of the vector. + /// True if all fields must be mutable. /// /// A with the given dimension. /// diff --git a/src/Numerics/LinearAlgebra/Double/SparseVector.cs b/src/Numerics/LinearAlgebra/Double/SparseVector.cs index a54c12b3..90169a7b 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseVector.cs @@ -674,7 +674,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double throw new ArgumentNullException("leftSide"); } - return (SparseVector)leftSide.Multiply(1.0 / rightSide); + return (SparseVector)leftSide.Divide(rightSide); } /// @@ -708,7 +708,7 @@ namespace MathNet.Numerics.LinearAlgebra.Double /// The divisor to use, /// The result of the calculation /// If is . - public static SparseVector operator %(SparseVector leftSide, float rightSide) + public static SparseVector operator %(SparseVector leftSide, double rightSide) { if (leftSide == null) { diff --git a/src/Numerics/LinearAlgebra/Single/DenseVector.cs b/src/Numerics/LinearAlgebra/Single/DenseVector.cs index 3dd63186..82d65168 100644 --- a/src/Numerics/LinearAlgebra/Single/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/DenseVector.cs @@ -491,7 +491,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single throw new ArgumentException(Resources.ArgumentVectorsSameLength, "rightSide"); } - return Control.LinearAlgebraProvider.DotProduct(leftSide.Values, rightSide.Values); + return leftSide.DotProduct(rightSide); } /// @@ -508,7 +508,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single throw new ArgumentNullException("leftSide"); } - return (DenseVector)leftSide.Multiply(1f / rightSide); + return (DenseVector)leftSide.Divide(rightSide); } /// diff --git a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs index 972523e3..a4c0c375 100644 --- a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs @@ -176,6 +176,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single /// Creates a with a the given dimension. /// /// The size of the vector. + /// True if all fields must be mutable. /// /// A with the given dimension. /// diff --git a/src/Numerics/LinearAlgebra/Single/SparseVector.cs b/src/Numerics/LinearAlgebra/Single/SparseVector.cs index b3b16ac3..440d7e60 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseVector.cs @@ -675,7 +675,7 @@ namespace MathNet.Numerics.LinearAlgebra.Single throw new ArgumentNullException("leftSide"); } - return (SparseVector)leftSide.Multiply(1.0f / rightSide); + return (SparseVector)leftSide.Divide(rightSide); } ///