From 01b54a51687b59ba38f469a5ce041a083a4fd321 Mon Sep 17 00:00:00 2001 From: Christoph Ruegg Date: Sat, 27 Jul 2013 18:11:06 +0200 Subject: [PATCH] Drop obsolete code --- src/FSharp/LinearAlgebra.Double.Matrix.fs | 7 - src/FSharp/LinearAlgebra.Double.Vector.fs | 12 +- src/Numerics/Complex32.cs | 57 ------- src/Numerics/Complex64.cs | 20 --- .../Distributions/Discrete/Categorical.cs | 26 ---- .../LinearAlgebra/Complex/DenseMatrix.cs | 44 ------ .../LinearAlgebra/Complex/DenseVector.cs | 34 ----- .../LinearAlgebra/Complex/DiagonalMatrix.cs | 24 --- .../LinearAlgebra/Complex/SparseMatrix.cs | 47 ------ .../LinearAlgebra/Complex/SparseVector.cs | 34 ----- .../LinearAlgebra/Complex32/DenseMatrix.cs | 44 ------ .../LinearAlgebra/Complex32/DenseVector.cs | 34 ----- .../LinearAlgebra/Complex32/DiagonalMatrix.cs | 24 --- .../LinearAlgebra/Complex32/SparseMatrix.cs | 47 ------ .../LinearAlgebra/Complex32/SparseVector.cs | 34 ----- .../LinearAlgebra/Double/DenseMatrix.cs | 44 ------ .../LinearAlgebra/Double/DenseVector.cs | 34 ----- .../LinearAlgebra/Double/DiagonalMatrix.cs | 24 --- .../LinearAlgebra/Double/SparseMatrix.cs | 47 ------ .../LinearAlgebra/Double/SparseVector.cs | 34 ----- src/Numerics/LinearAlgebra/Generic/Matrix.cs | 78 ---------- .../LinearAlgebra/Generic/Vector.BCL.cs | 9 -- src/Numerics/LinearAlgebra/Generic/Vector.cs | 19 --- .../LinearAlgebra/Single/DenseMatrix.cs | 44 ------ .../LinearAlgebra/Single/DenseVector.cs | 34 ----- .../LinearAlgebra/Single/DiagonalMatrix.cs | 24 --- .../LinearAlgebra/Single/SparseMatrix.cs | 47 ------ .../LinearAlgebra/Single/SparseVector.cs | 34 ----- src/Numerics/Numerics.csproj | 1 - src/Numerics/SpecialFunctions/Evaluate.cs | 20 --- .../Statistics/DescriptiveStatistics.cs | 17 --- src/Numerics/Statistics/Percentile.cs | 140 ------------------ src/Numerics/Threading/CommonParallel.cs | 115 -------------- .../StatisticsTests/PercentileTests.cs | 47 +----- 34 files changed, 12 insertions(+), 1288 deletions(-) delete mode 100644 src/Numerics/Statistics/Percentile.cs diff --git a/src/FSharp/LinearAlgebra.Double.Matrix.fs b/src/FSharp/LinearAlgebra.Double.Matrix.fs index 637a7a19..5ff75f6a 100644 --- a/src/FSharp/LinearAlgebra.Double.Matrix.fs +++ b/src/FSharp/LinearAlgebra.Double.Matrix.fs @@ -67,13 +67,6 @@ module Matrix = for i = 0 to A.RowCount-1 do A.SetRow(i, f i (A.Row(i))) - [] - let inplaceMapi = mapiInPlace - [] - let inplaceMapCols = mapColsInPlace - [] - let inplaceMapRows = mapRowsInPlace - /// Map every matrix element using the given function. let inline map (f: float -> float) (A: #Matrix) = let A = A.Clone() diff --git a/src/FSharp/LinearAlgebra.Double.Vector.fs b/src/FSharp/LinearAlgebra.Double.Vector.fs index f0e23856..61624295 100644 --- a/src/FSharp/LinearAlgebra.Double.Vector.fs +++ b/src/FSharp/LinearAlgebra.Double.Vector.fs @@ -224,7 +224,7 @@ module DenseVector = /// Create a vector from a float list. let inline ofList (fl: float list) = DenseVector(Array.ofList fl) - /// Create a vector from a sequences. + /// Create a vector from a float sequence. let inline ofSeq (fs: #seq) = DenseVector.OfEnumerable(fs) /// Create a vector with a given dimension from an indexed list of index, value pairs. @@ -255,13 +255,11 @@ module SparseVector = /// Initialize a vector by calling a construction function for every element. let inline init (n: int) (f: int -> float) = SparseVector.Create(n, fun i -> f i) - /// Create a sparse vector with a given dimension from a list of index, value pairs. - [] - let inline ofList (n: int) (fl: list) = SparseVector.OfIndexedEnumerable(n, Seq.ofList fl) + /// Create a sparse vector from a float list. + let inline ofList (n: int) (fl: float list) = SparseVector.OfEnumerable(Seq.ofList fl) - /// Create a sparse vector with a given dimension from a sequence of index, value pairs. - [] - let inline ofSeq (n: int) (fs: #seq) = SparseVector.OfIndexedEnumerable(n, fs) + /// Create a sparse vector from a float sequence. + let inline ofSeq (n: int) (fs: #seq) = SparseVector.OfEnumerable(fs) /// Create a sparse vector with a given dimension from an indexed list of index, value pairs. let inline ofListi (n: int) (fl: list) = SparseVector.OfIndexedEnumerable(n, Seq.ofList fl) diff --git a/src/Numerics/Complex32.cs b/src/Numerics/Complex32.cs index b3468b54..2fdf9da5 100644 --- a/src/Numerics/Complex32.cs +++ b/src/Numerics/Complex32.cs @@ -34,7 +34,6 @@ namespace MathNet.Numerics using System.Collections.Generic; using System.Globalization; using System.Runtime.InteropServices; - using Properties; #if !PORTABLE using System.Runtime; @@ -109,23 +108,6 @@ namespace MathNet.Numerics return new Complex32(magnitude * (float)Math.Cos(phase), magnitude * (float)Math.Sin(phase)); } - [Obsolete("Use the public constructor instead. Scheduled for removal in v3.0.")] - public static Complex32 WithRealImaginary(float real, float imaginary) - { - return new Complex32(real, imaginary); - } - - [Obsolete("Use static FromPolarCoordinates instead. Scheduled for removal in v3.0.")] - public static Complex32 WithModulusArgument(float modulus, float argument) - { - if (modulus < 0.0f) - { - throw new ArgumentOutOfRangeException("modulus", Resources.ArgumentNotNegative); - } - - return new Complex32(modulus * (float)Math.Cos(argument), modulus * (float)Math.Sin(argument)); - } - /// /// Returns a new instance /// with a real number equal to zero and an imaginary number equal to zero. @@ -150,9 +132,6 @@ namespace MathNet.Numerics /// public static readonly Complex32 PositiveInfinity = new Complex32(float.PositiveInfinity, float.PositiveInfinity); - [Obsolete("Use PositiveInfinity instead. Scheduled for removal in v3.0.")] - public static readonly Complex32 Infinity = PositiveInfinity; - /// /// Returns a new instance /// with real and imaginary numbers not a number. @@ -674,18 +653,6 @@ namespace MathNet.Numerics return new Complex32(dividend._real / divisor, dividend._imag / divisor); } - [Obsolete("No Operation. Scheduled for removal in v3.0.")] - public Complex32 Plus() - { - return this; - } - - [Obsolete("Use static Complex32.Negate or the unary - operator instead. Scheduled for removal in v3.0.")] - public Complex32 Negate() - { - return -this; - } - /// /// Computes the conjugate of a complex number and returns the result. /// @@ -707,30 +674,6 @@ namespace MathNet.Numerics return 1.0f / this; } - [Obsolete("Use static Complex32.Add or the + operator instead. Scheduled for removal in v3.0.")] - public Complex32 Add(Complex32 other) - { - return this + other; - } - - [Obsolete("Use static Complex32.Subtract or the - operator instead. Scheduled for removal in v3.0.")] - public Complex32 Subtract(Complex32 other) - { - return this - other; - } - - [Obsolete("Use static Complex32.Multiply or the * operator instead. Scheduled for removal in v3.0.")] - public Complex32 Multiply(Complex32 multiplier) - { - return this * multiplier; - } - - [Obsolete("Use static Complex32.Divide or the / operator instead. Scheduled for removal in v3.0.")] - public Complex32 Divide(Complex32 divisor) - { - return this / divisor; - } - #region IFormattable Members /// diff --git a/src/Numerics/Complex64.cs b/src/Numerics/Complex64.cs index 18e2e606..262a1460 100644 --- a/src/Numerics/Complex64.cs +++ b/src/Numerics/Complex64.cs @@ -101,23 +101,6 @@ namespace MathNet.Numerics return new Complex(magnitude * Math.Cos(phase), magnitude * Math.Sin(phase)); } - [Obsolete("Use the public constructor instead. Scheduled for removal in v3.0.")] - public static Complex WithRealImaginary(double real, double imaginary) - { - return new Complex(real, imaginary); - } - - [Obsolete("Use static FromPolarCoordinates instead. Scheduled for removal in v3.0.")] - public static Complex WithModulusArgument(double modulus, double argument) - { - if (modulus < 0.0d) - { - throw new ArgumentOutOfRangeException("modulus", Resources.ArgumentNotNegative); - } - - return new Complex(modulus * Math.Cos(argument), modulus * Math.Sin(argument)); - } - /// /// Returns a new Complex instance /// with a real number equal to zero and an imaginary number equal to zero. @@ -142,9 +125,6 @@ namespace MathNet.Numerics /// public static readonly Complex PositiveInfinity = new Complex(float.PositiveInfinity, float.PositiveInfinity); - [Obsolete("Use PositiveInfinity instead. Scheduled for removal in v3.0.")] - public static readonly Complex Infinity = PositiveInfinity; - /// /// Returns a new Complex instance /// with real and imaginary numbers not a number. diff --git a/src/Numerics/Distributions/Discrete/Categorical.cs b/src/Numerics/Distributions/Discrete/Categorical.cs index f69f719e..aa8db620 100644 --- a/src/Numerics/Distributions/Discrete/Categorical.cs +++ b/src/Numerics/Distributions/Discrete/Categorical.cs @@ -408,19 +408,6 @@ namespace MathNet.Numerics.Distributions } } - /// - /// Samples one categorical distributed random variable; also known as the Discrete distribution. - /// - /// The random number generator to use. - /// An array of nonnegative ratios: this array does not need to be normalized - /// as this is often impossible using floating point arithmetic. - /// One random integer between 0 and the size of the categorical (exclusive). - [Obsolete("Use SampleWithProbabilityMass instead (or SampleWithCumulativeDistribution which is faster). Scheduled for removal in v3.0.")] - public static int Sample(Random rnd, double[] pmfUnnormalized) - { - return SampleWithProbabilityMass(rnd, pmfUnnormalized); - } - /// /// Samples one categorical distributed random variable; also known as the Discrete distribution. /// @@ -454,19 +441,6 @@ namespace MathNet.Numerics.Distributions return SampleUnchecked(rnd, cdf); } - /// - /// Samples a categorically distributed random variable. - /// - /// The random number generator to use. - /// An array of nonnegative ratios: this array does not need to be normalized - /// as this is often impossible using floating point arithmetic. - /// random integers between 0 and the size of the categorical (exclusive). - [Obsolete("Use SamplesWithProbabilityMass instead (or SamplesWithCumulativeDistribution which is faster). Scheduled for removal in v3.0.")] - public static IEnumerable Samples(Random rnd, double[] p) - { - return SamplesWithProbabilityMass(rnd, p); - } - /// /// Samples a categorically distributed random variable. /// diff --git a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs index 924285d6..7f6fea9d 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseMatrix.cs @@ -254,50 +254,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex (i, j) => new Complex(distribution.Sample(), distribution.Sample()))); } - /// - /// Create a new dense matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use DenseMatrix.Create instead. Scheduled for removal in v3.0.")] - public DenseMatrix(int rows, int columns, Complex value) - : this(DenseColumnMajorMatrixStorage.OfInit(rows, columns, (i, j) => value)) - { - } - - /// - /// Create a new dense matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DenseMatrix(Complex[,] array) - : this(DenseColumnMajorMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new dense matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DenseMatrix(Matrix matrix) - : this(DenseColumnMajorMatrixStorage.OfMatrix(matrix.Storage)) - { - } - - /// - /// Gets the matrix's data. - /// - /// The matrix's data. - [Obsolete("Use Values instead. Scheduled for removal in v3.0.")] - public Complex[] Data - { - get { return _values; } - } - /// /// Gets the matrix's data. /// diff --git a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs index e4f471d6..c562a31f 100644 --- a/src/Numerics/LinearAlgebra/Complex/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/DenseVector.cs @@ -144,40 +144,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex i => new Complex(distribution.Sample(), distribution.Sample()))); } - /// - /// Create a new dense vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use DenseVector.Create instead. Scheduled for removal in v3.0.")] - public DenseVector(int length, Complex value) - : this(DenseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new dense vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfVector instead. Scheduled for removal in v3.0.")] - public DenseVector(Vector other) - : this(DenseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new dense vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public DenseVector(IEnumerable other) - : this(DenseVectorStorage.OfEnumerable(other)) - { - } - /// /// Gets the vector's data. /// diff --git a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs index e233ffa8..13cd8caf 100644 --- a/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/DiagonalMatrix.cs @@ -186,30 +186,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex i => new Complex(distribution.Sample(), distribution.Sample()))); } - /// - /// Create a new diagonal matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// The array to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(Complex[,] array) - : this(DiagonalMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new diagonal matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// The matrix to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(Matrix matrix) - : this(DiagonalMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a DiagonalMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs index 7d304548..eb1596ff 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseMatrix.cs @@ -207,53 +207,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex return new SparseMatrix(SparseCompressedRowMatrixStorage.OfInit(rows, columns, init)); } - /// - /// Create a new sparse matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use a dense matrix or SparseMatrix.Create instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, Complex value) - : this(SparseCompressedRowMatrixStorage.OfInit(rows, columns, (i, j) => value)) - { - } - - /// - /// Create a new sparse matrix with the given number of rows and columns as a copy of the given array. - /// The array is assumed to be in column-major order (column by column). - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - /// - [Obsolete("Use SparseMatrix.OfColumnMajor instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, Complex[] array) - : this(SparseCompressedRowMatrixStorage.OfColumnMajorList(rows, columns, array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public SparseMatrix(Complex[,] array) - : this(SparseCompressedRowMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public SparseMatrix(Matrix matrix) - : this(SparseCompressedRowMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a SparseMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs index ea687bf4..dc974195 100644 --- a/src/Numerics/LinearAlgebra/Complex/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex/SparseVector.cs @@ -125,40 +125,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex return new SparseVector(SparseVectorStorage.OfInit(length, init)); } - /// - /// Create a new sparse vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use a dense vector instead. Scheduled for removal in v3.0.")] - public SparseVector(int length, Complex value) - : this(SparseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new sparse vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfVector instead. Scheduled for removal in v3.0.")] - public SparseVector(Vector other) - : this(SparseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new sparse vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public SparseVector(IEnumerable other) - : this(SparseVectorStorage.OfEnumerable(other)) - { - } - /// /// Creates a matrix with the given dimensions using the same storage type /// as this vector. diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs index 6c6d6d6c..3e1ed738 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DenseMatrix.cs @@ -249,50 +249,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 (i, j) => new Complex32((float) distribution.Sample(), (float) distribution.Sample()))); } - /// - /// Create a new dense matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use DenseMatrix.Create instead. Scheduled for removal in v3.0.")] - public DenseMatrix(int rows, int columns, Complex32 value) - : this(DenseColumnMajorMatrixStorage.OfInit(rows, columns, (i, j) => value)) - { - } - - /// - /// Create a new dense matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DenseMatrix(Complex32[,] array) - : this(DenseColumnMajorMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new dense matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DenseMatrix(Matrix matrix) - : this(DenseColumnMajorMatrixStorage.OfMatrix(matrix.Storage)) - { - } - - /// - /// Gets the matrix's data. - /// - /// The matrix's data. - [Obsolete("Use Values instead. Scheduled for removal in v3.0.")] - public Complex32[] Data - { - get { return _values; } - } - /// /// Gets the matrix's data. /// diff --git a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs index 2a37daf0..36e27f00 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DenseVector.cs @@ -139,40 +139,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 i => new Complex32((float)distribution.Sample(), (float)distribution.Sample()))); } - /// - /// Create a new dense vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use DenseVector.Create instead. Scheduled for removal in v3.0.")] - public DenseVector(int length, Complex32 value) - : this(DenseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new dense vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfVector instead. Scheduled for removal in v3.0.")] - public DenseVector(Vector other) - : this(DenseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new dense vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public DenseVector(IEnumerable other) - : this(DenseVectorStorage.OfEnumerable(other)) - { - } - /// /// Gets the vector's data. /// diff --git a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs index baab65d3..0f34aefa 100644 --- a/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/DiagonalMatrix.cs @@ -181,30 +181,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 i => new Complex32((float) distribution.Sample(), (float) distribution.Sample()))); } - /// - /// Create a new diagonal matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// The array to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(Complex32[,] array) - : this(DiagonalMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new diagonal matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// The matrix to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(Matrix matrix) - : this(DiagonalMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a DiagonalMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs index f6c63a3f..fdaaf603 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseMatrix.cs @@ -202,53 +202,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 return new SparseMatrix(SparseCompressedRowMatrixStorage.OfInit(rows, columns, init)); } - /// - /// Create a new sparse matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use a dense matrix or SparseMatrix.Create instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, Complex32 value) - : this(SparseCompressedRowMatrixStorage.OfInit(rows, columns, (i,j) => value)) - { - } - - /// - /// Create a new sparse matrix with the given number of rows and columns as a copy of the given array. - /// The array is assumed to be in column-major order (column by column). - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - /// - [Obsolete("Use SparseMatrix.OfColumnMajor instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, Complex32[] array) - : this(SparseCompressedRowMatrixStorage.OfColumnMajorList(rows, columns, array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public SparseMatrix(Complex32[,] array) - : this(SparseCompressedRowMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public SparseMatrix(Matrix matrix) - : this(SparseCompressedRowMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a SparseMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs index 7eca9e85..c89cc400 100644 --- a/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Complex32/SparseVector.cs @@ -120,40 +120,6 @@ namespace MathNet.Numerics.LinearAlgebra.Complex32 return new SparseVector(SparseVectorStorage.OfInit(length, init)); } - /// - /// Create a new sparse vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use a dense vector instead. Scheduled for removal in v3.0.")] - public SparseVector(int length, Complex32 value) - : this(SparseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new sparse vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfVector instead. Scheduled for removal in v3.0.")] - public SparseVector(Vector other) - : this(SparseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new sparse vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public SparseVector(IEnumerable other) - : this(SparseVectorStorage.OfEnumerable(other)) - { - } - /// /// Creates a matrix with the given dimensions using the same storage type /// as this vector. diff --git a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs index 1a519517..c1e0d364 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseMatrix.cs @@ -249,50 +249,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double (i, j) => distribution.Sample())); } - /// - /// Create a new dense matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use DenseMatrix.Create instead. Scheduled for removal in v3.0.")] - public DenseMatrix(int rows, int columns, double value) - : this(DenseColumnMajorMatrixStorage.OfInit(rows, columns, (i, j) => value)) - { - } - - /// - /// Create a new dense matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DenseMatrix(double[,] array) - : this(DenseColumnMajorMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new dense matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DenseMatrix(Matrix matrix) - : this(DenseColumnMajorMatrixStorage.OfMatrix(matrix.Storage)) - { - } - - /// - /// Gets the matrix's data. - /// - /// The matrix's data. - [Obsolete("Use Values instead. Scheduled for removal in v3.0.")] - public double[] Data - { - get { return _values; } - } - /// /// Gets the matrix's data. /// diff --git a/src/Numerics/LinearAlgebra/Double/DenseVector.cs b/src/Numerics/LinearAlgebra/Double/DenseVector.cs index bd75bf80..83639d21 100644 --- a/src/Numerics/LinearAlgebra/Double/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/DenseVector.cs @@ -140,40 +140,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double i => distribution.Sample())); } - /// - /// Create a new dense vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use DenseVector.Create instead. Scheduled for removal in v3.0.")] - public DenseVector(int length, double value) - : this(DenseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new dense vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfVector instead. Scheduled for removal in v3.0.")] - public DenseVector(Vector other) - : this(DenseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new dense vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public DenseVector(IEnumerable other) - : this(DenseVectorStorage.OfEnumerable(other)) - { - } - /// /// Gets the vector's data. /// diff --git a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs index 72a8b0ee..191ed633 100644 --- a/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/DiagonalMatrix.cs @@ -180,30 +180,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double i => distribution.Sample())); } - /// - /// Create a new diagonal matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// The array to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(double[,] array) - : this(DiagonalMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new diagonal matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// The matrix to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(Matrix matrix) - : this(DiagonalMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a DiagonalMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs index b0165585..3351da70 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseMatrix.cs @@ -201,53 +201,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double return new SparseMatrix(SparseCompressedRowMatrixStorage.OfInit(rows, columns, init)); } - /// - /// Create a new sparse matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use a dense matrix or SparseMatrix.Create instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, double value) - : this(SparseCompressedRowMatrixStorage.OfInit(rows, columns, (i, j) => value)) - { - } - - /// - /// Create a new sparse matrix with the given number of rows and columns as a copy of the given array. - /// The array is assumed to be in column-major order (column by column). - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - /// - [Obsolete("Use SparseMatrix.OfColumnMajor instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, double[] array) - : this(SparseCompressedRowMatrixStorage.OfColumnMajorList(rows, columns, array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public SparseMatrix(double[,] array) - : this(SparseCompressedRowMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public SparseMatrix(Matrix matrix) - : this(SparseCompressedRowMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a SparseMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Double/SparseVector.cs b/src/Numerics/LinearAlgebra/Double/SparseVector.cs index 0b75a004..b1c02c67 100644 --- a/src/Numerics/LinearAlgebra/Double/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Double/SparseVector.cs @@ -120,40 +120,6 @@ namespace MathNet.Numerics.LinearAlgebra.Double return new SparseVector(SparseVectorStorage.OfInit(length, init)); } - /// - /// Create a new sparse vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use a dense vector instead. Scheduled for removal in v3.0.")] - public SparseVector(int length, double value) - : this(SparseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new sparse vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfVector instead. Scheduled for removal in v3.0.")] - public SparseVector(Vector other) - : this(SparseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new sparse vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public SparseVector(IEnumerable other) - : this(SparseVectorStorage.OfEnumerable(other)) - { - } - /// /// Creates a matrix with the given dimensions using the same storage type /// as this vector. diff --git a/src/Numerics/LinearAlgebra/Generic/Matrix.cs b/src/Numerics/LinearAlgebra/Generic/Matrix.cs index 9959bb2c..01c6f89b 100644 --- a/src/Numerics/LinearAlgebra/Generic/Matrix.cs +++ b/src/Numerics/LinearAlgebra/Generic/Matrix.cs @@ -77,84 +77,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic /// The number of rows. public int RowCount { get; private set; } - /// - /// Constructs matrix from a list of column vectors. - /// - /// The vectors to construct the matrix from. - /// The matrix constructed from the list of column vectors. - /// Creates a matrix of size Max([i].Count) x .Count - [Obsolete("Use DenseMatrix.OfColumns or SparseMatrix.OfColumns instead. Scheduled for removal in v3.0.")] - public static Matrix CreateFromColumns(IList> columnVectors) - { - if (columnVectors == null) - { - throw new ArgumentNullException("columnVectors"); - } - - if (columnVectors.Count == 0) - { - throw new ArgumentOutOfRangeException("columnVectors"); - } - - var rows = columnVectors[0].Count; - var columns = columnVectors.Count; - - for (var column = 1; column < columns; column++) - { - rows = Math.Max(rows, columnVectors[column].Count); - } - - var matrix = columnVectors[0].CreateMatrix(rows, columns); - for (var j = 0; j < columns; j++) - { - for (var i = 0; i < columnVectors[j].Count; i++) - { - matrix.At(i, j, columnVectors[j].At(i)); - } - } - - return matrix; - } - - /// - /// Constructs matrix from a list of row vectors. - /// - /// The vectors to construct the matrix from. - /// The matrix constructed from the list of row vectors. - /// Creates a matrix of size Max(.Count) x [i].Count - [Obsolete("Use DenseMatrix.OfRows or SparseMatrix.OfRows instead. Scheduled for removal in v3.0.")] - public static Matrix CreateFromRows(IList> rowVectors) - { - if (rowVectors == null) - { - throw new ArgumentNullException("rowVectors"); - } - - if (rowVectors.Count == 0) - { - throw new ArgumentOutOfRangeException("rowVectors"); - } - - var rows = rowVectors.Count; - var columns = rowVectors[0].Count; - - for (var row = 1; row < rows; row++) - { - columns = Math.Max(columns, rowVectors[row].Count); - } - - var matrix = rowVectors[0].CreateMatrix(rows, columns); - for (var i = 0; i < rows; i++) - { - for (var j = 0; j < rowVectors[i].Count; j++) - { - matrix.At(i, j, rowVectors[i].At(j)); - } - } - - return matrix; - } - /// /// Gets or sets the value at the given row and column, with range checking. /// diff --git a/src/Numerics/LinearAlgebra/Generic/Vector.BCL.cs b/src/Numerics/LinearAlgebra/Generic/Vector.BCL.cs index 5484f060..0c6c171b 100644 --- a/src/Numerics/LinearAlgebra/Generic/Vector.BCL.cs +++ b/src/Numerics/LinearAlgebra/Generic/Vector.BCL.cs @@ -348,14 +348,5 @@ namespace MathNet.Numerics.LinearAlgebra.Generic { return string.Concat(ToTypeString(), Environment.NewLine, ToVectorString(Control.MaxToStringRows, Control.MaxToStringColumns, formatProvider)); } - - /// - /// Returns a that summarizes this vector. - /// - [Obsolete("Scheduled for removal in v3.0.")] - public string ToString(IFormatProvider formatProvider) - { - return ToString(null, formatProvider); - } } } diff --git a/src/Numerics/LinearAlgebra/Generic/Vector.cs b/src/Numerics/LinearAlgebra/Generic/Vector.cs index d896c2e7..015863ef 100644 --- a/src/Numerics/LinearAlgebra/Generic/Vector.cs +++ b/src/Numerics/LinearAlgebra/Generic/Vector.cs @@ -317,19 +317,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic DoAdd(scalar, result); } - /// - /// Returns a copy of this vector. - /// - /// This vector. - /// - /// Added as an alternative to the unary addition operator. - /// - [Obsolete("Use Clone instead. Scheduled for removal in v3.0.")] - public Vector Plus() - { - return Clone(); - } - /// /// Adds another vector to this vector. /// @@ -1477,12 +1464,6 @@ namespace MathNet.Numerics.LinearAlgebra.Generic Storage.CopySubVectorTo(destination.Storage, sourceIndex, targetIndex, count); } - [Obsolete("Use CopySubVectorTo instead. Scheduled for removal in v3.0.")] - public void CopyTo(Vector destination, int sourceIndex, int targetIndex, int count) - { - CopySubVectorTo(destination, sourceIndex, targetIndex, count); - } - /// /// Returns the data contained in the vector as an array. /// diff --git a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs index 993efde9..fbec5ab5 100644 --- a/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DenseMatrix.cs @@ -249,50 +249,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single (i, j) => (float) distribution.Sample())); } - /// - /// Create a new dense matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use DenseMatrix.Create instead. Scheduled for removal in v3.0.")] - public DenseMatrix(int rows, int columns, float value) - : this(DenseColumnMajorMatrixStorage.OfInit(rows, columns, (i, j) => value)) - { - } - - /// - /// Create a new dense matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DenseMatrix(float[,] array) - : this(DenseColumnMajorMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new dense matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DenseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DenseMatrix(Matrix matrix) - : this(DenseColumnMajorMatrixStorage.OfMatrix(matrix.Storage)) - { - } - - /// - /// Gets the matrix's data. - /// - /// The matrix's data. - [Obsolete("Use Values instead. Scheduled for removal in v3.0.")] - public float[] Data - { - get { return _values; } - } - /// /// Gets the matrix's data. /// diff --git a/src/Numerics/LinearAlgebra/Single/DenseVector.cs b/src/Numerics/LinearAlgebra/Single/DenseVector.cs index abcbeabb..4a510e18 100644 --- a/src/Numerics/LinearAlgebra/Single/DenseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/DenseVector.cs @@ -139,40 +139,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single i => (float)distribution.Sample())); } - /// - /// Create a new dense vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use DenseVector.Create instead. Scheduled for removal in v3.0.")] - public DenseVector(int length, float value) - : this(DenseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new dense vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfVector instead. Scheduled for removal in v3.0.")] - public DenseVector(Vector other) - : this(DenseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new dense vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use DenseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public DenseVector(IEnumerable other) - : this(DenseVectorStorage.OfEnumerable(other)) - { - } - /// /// Gets the vector's data. /// diff --git a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs index 34886fdd..da2bcb43 100644 --- a/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/DiagonalMatrix.cs @@ -180,30 +180,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single i => (float) distribution.Sample())); } - /// - /// Create a new diagonal matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// The array to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(float[,] array) - : this(DiagonalMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new diagonal matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// The matrix to copy from must be diagonal as well. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use DiagonalMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public DiagonalMatrix(Matrix matrix) - : this(DiagonalMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a DiagonalMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs index 28449551..555e87b8 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseMatrix.cs @@ -201,53 +201,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single return new SparseMatrix(SparseCompressedRowMatrixStorage.OfInit(rows, columns, init)); } - /// - /// Create a new sparse matrix with the given number of rows and columns. - /// All cells of the matrix will be initialized to the provided value. - /// Zero-length matrices are not supported. - /// - /// If the row or column count is less than one. - [Obsolete("Use a dense matrix or SparseMatrix.Create instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, float value) - : this(SparseCompressedRowMatrixStorage.OfInit(rows, columns, (i, j) => value)) - { - } - - /// - /// Create a new sparse matrix with the given number of rows and columns as a copy of the given array. - /// The array is assumed to be in column-major order (column by column). - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - /// - [Obsolete("Use SparseMatrix.OfColumnMajor instead. Scheduled for removal in v3.0.")] - public SparseMatrix(int rows, int columns, float[] array) - : this(SparseCompressedRowMatrixStorage.OfColumnMajorList(rows, columns, array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given two-dimensional array. - /// This new matrix will be independent from the provided array. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfArray instead. Scheduled for removal in v3.0.")] - public SparseMatrix(float[,] array) - : this(SparseCompressedRowMatrixStorage.OfArray(array)) - { - } - - /// - /// Create a new sparse matrix as a copy of the given other matrix. - /// This new matrix will be independent from the other matrix. - /// A new memory block will be allocated for storing the matrix. - /// - [Obsolete("Use SparseMatrix.OfMatrix instead. Scheduled for removal in v3.0.")] - public SparseMatrix(Matrix matrix) - : this(SparseCompressedRowMatrixStorage.OfMatrix(matrix.Storage)) - { - } - /// /// Creates a SparseMatrix for the given number of rows and columns. /// diff --git a/src/Numerics/LinearAlgebra/Single/SparseVector.cs b/src/Numerics/LinearAlgebra/Single/SparseVector.cs index 8415b269..40e0dd77 100644 --- a/src/Numerics/LinearAlgebra/Single/SparseVector.cs +++ b/src/Numerics/LinearAlgebra/Single/SparseVector.cs @@ -120,40 +120,6 @@ namespace MathNet.Numerics.LinearAlgebra.Single return new SparseVector(SparseVectorStorage.OfInit(length, init)); } - /// - /// Create a new sparse vector with the given length. - /// All cells of the vector will be initialized with the provided value. - /// Zero-length vectors are not supported. - /// - /// If length is less than one. - [Obsolete("Use a dense vector instead. Scheduled for removal in v3.0.")] - public SparseVector(int length, float value) - : this(SparseVectorStorage.OfInit(length, i => value)) - { - } - - /// - /// Create a new sparse vector as a copy of the given other vector. - /// This new vector will be independent from the other vector. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfVector instead. Scheduled for removal in v3.0.")] - public SparseVector(Vector other) - : this(SparseVectorStorage.OfVector(other.Storage)) - { - } - - /// - /// Create a new sparse vector as a copy of the given enumerable. - /// This new vector will be independent from the enumerable. - /// A new memory block will be allocated for storing the vector. - /// - [Obsolete("Use SparseVector.OfEnumerable instead. Scheduled for removal in v3.0.")] - public SparseVector(IEnumerable other) - : this(SparseVectorStorage.OfEnumerable(other)) - { - } - /// /// Creates a matrix with the given dimensions using the same storage type /// as this vector. diff --git a/src/Numerics/Numerics.csproj b/src/Numerics/Numerics.csproj index 39987e82..4ef4f47a 100644 --- a/src/Numerics/Numerics.csproj +++ b/src/Numerics/Numerics.csproj @@ -451,7 +451,6 @@ - diff --git a/src/Numerics/SpecialFunctions/Evaluate.cs b/src/Numerics/SpecialFunctions/Evaluate.cs index 22e06419..366b0d9c 100644 --- a/src/Numerics/SpecialFunctions/Evaluate.cs +++ b/src/Numerics/SpecialFunctions/Evaluate.cs @@ -55,26 +55,6 @@ namespace MathNet.Numerics /// public static class Evaluate { - /// - /// Evaluate polynomials. - /// - /// The coefficients of the polynomial. - /// The location where to evaluate the polynomial at. - /// the evaluation of the polynomial. - [Obsolete("Use Polynomial(z, params coefficients) instead.")] - public static double Polynomial(double[] coefficients, double z) - { - int count = coefficients.Length; - double sum = coefficients[count - 1]; - for (int i = count - 2; i >= 0; --i) - { - sum *= z; - sum += coefficients[i]; - } - - return sum; - } - /// /// Evaluate a polynomial at point x. /// Coefficients are ordered by power with power k at index k. diff --git a/src/Numerics/Statistics/DescriptiveStatistics.cs b/src/Numerics/Statistics/DescriptiveStatistics.cs index 1a8e58eb..e80dedf5 100644 --- a/src/Numerics/Statistics/DescriptiveStatistics.cs +++ b/src/Numerics/Statistics/DescriptiveStatistics.cs @@ -86,8 +86,6 @@ namespace MathNet.Numerics.Statistics { Compute(data); } - - _medianLazy = new Lazy(() => data.Median()); } /// @@ -109,7 +107,6 @@ namespace MathNet.Numerics.Statistics throw new ArgumentNullException("data"); } - if (increasedAccuracy) { ComputeHA(data); @@ -118,8 +115,6 @@ namespace MathNet.Numerics.Statistics { Compute(data); } - - _medianLazy = new Lazy(() => data.Median()); } /// @@ -153,18 +148,6 @@ namespace MathNet.Numerics.Statistics /// Returns zero if is less than three. public double Skewness { get; private set; } - /// - /// Gets the sample median. - /// - /// The sample median. - [Obsolete("Please use Statistics.Median instead (performance). Scheduled for removal in v3.0.")] - public double Median - { - get { return _medianLazy.Value; } - } - - readonly Lazy _medianLazy; - /// /// Gets the sample kurtosis. /// diff --git a/src/Numerics/Statistics/Percentile.cs b/src/Numerics/Statistics/Percentile.cs deleted file mode 100644 index 03cf2434..00000000 --- a/src/Numerics/Statistics/Percentile.cs +++ /dev/null @@ -1,140 +0,0 @@ -// -// Math.NET Numerics, part of the Math.NET Project -// http://numerics.mathdotnet.com -// http://github.com/mathnet/mathnet-numerics -// http://mathnetnumerics.codeplex.com -// -// Copyright (c) 2009-2013 Math.NET -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -namespace MathNet.Numerics.Statistics -{ - using System; - using System.Collections.Generic; - using System.Linq; - - /// - /// Methods to calculate the percentiles. - /// - public enum PercentileMethod - { - /// - /// Using the method recommened my NIST, - /// http://www.itl.nist.gov/div898/handbook/prc/section2/prc252.htm - /// - Nist = 0, - - /// - /// Using the nearest rank, http://en.wikipedia.org/wiki/Percentile#Nearest_Rank - /// - Nearest, - - /// - /// Using the same method as Excel does, - /// http://www.itl.nist.gov/div898/handbook/prc/section2/prc252.htm - /// - Excel, - - /// - /// Use linear interpolation between the two nearest ranks, - /// http://en.wikipedia.org/wiki/Percentile#Linear_Interpolation_Between_Closest_Ranks - /// - Interpolation - } - - /// - /// Class to calculate percentiles. - /// - [Obsolete("Use Statistics.Quantile or .QuantileFunc or one of the custom variants instead. Scheduled for removal in v3.0.")] - public class Percentile - { - /// - /// Holds the data. - /// - private readonly double[] _data; - - /// - /// Gets or sets the method used to calculate the percentiles. - /// - /// The calculation method. - /// defaults to . - public PercentileMethod Method - { - get; - set; - } - - /// - /// Initializes a new instance of the class. - /// - /// The data to calculate the percentiles of. - public Percentile(IEnumerable data) - { - if (data == null) - { - throw new ArgumentNullException("data"); - } - - _data = data.ToArray(); - Array.Sort(_data); - } - - /// - /// Computes the percentile. - /// - /// The percentile, must be between 0.0 and 1.0 (inclusive). - /// the requested percentile. - public double Compute(double percentile) - { - switch (Method) - { - case PercentileMethod.Nist: - return SortedArrayStatistics.QuantileCustom(_data, percentile, QuantileDefinition.Nist); - case PercentileMethod.Nearest: - return SortedArrayStatistics.QuantileCustom(_data, percentile, QuantileDefinition.R3); - case PercentileMethod.Interpolation: - return SortedArrayStatistics.QuantileCustom(_data, percentile, QuantileDefinition.R5); - case PercentileMethod.Excel: - return SortedArrayStatistics.QuantileCustom(_data, percentile, QuantileDefinition.Excel); - default: - return SortedArrayStatistics.Quantile(_data, percentile); - } - } - - /// - /// Computes the percentiles for the given list. - /// - /// The percentiles, must be between 0.0 and 1.0 (inclusive) - /// the values that correspond to the given percentiles. - public IList Compute(IEnumerable percentiles) - { - if (percentiles == null) - { - throw new ArgumentNullException("percentiles"); - } - - return percentiles.Select(Compute).ToList(); - } - } -} diff --git a/src/Numerics/Threading/CommonParallel.cs b/src/Numerics/Threading/CommonParallel.cs index c6397e28..a897de96 100644 --- a/src/Numerics/Threading/CommonParallel.cs +++ b/src/Numerics/Threading/CommonParallel.cs @@ -46,35 +46,6 @@ namespace MathNet.Numerics.Threading /// public static class CommonParallel { - /// - /// Executes a for loop in which iterations may run in parallel. - /// - /// The start index, inclusive. - /// The end index, exclusive. - /// The body to be invoked for each iteration. - /// The argument is null. - /// At least one invocation of the body threw an exception. - [Obsolete("Use a more efficient overload instead. Scheduled for removal in v3.0.")] - public static void For(int fromInclusive, int toExclusive, Action body) - { - if (body == null) throw new ArgumentNullException("body"); - if (toExclusive <= fromInclusive) throw new ArgumentOutOfRangeException("toExclusive"); - - int rangeSize = (toExclusive - fromInclusive)/(Control.NumberOfParallelWorkerThreads*2); - rangeSize = Math.Max(rangeSize, 1); - - For(fromInclusive, - toExclusive, - rangeSize, - (start, stop) => - { - for (var i = start; i < stop; i++) - { - body(i); - } - }); - } - /// /// Executes a for loop in which iterations may run in parallel. /// @@ -142,92 +113,6 @@ namespace MathNet.Numerics.Threading #endif } - /// - /// Executes a for loop in which iterations may run in parallel. - /// - /// The array to iterate over. - /// The body to be invoked for each iteration. - /// The argument is null. - /// At least one invocation of the body threw an exception. - [Obsolete("Use a more efficient overload instead. Scheduled for removal in v3.0.")] - public static void For(T[] array, Action body) - { - if (body == null) - { - throw new ArgumentNullException("body"); - } - - // Special case: no action - if (array == null || array.Length == 0) - { - return; - } - - // Special case: single action, inline - if (array.Length == 0) - { - body(0, array[0]); - return; - } - - // Special case: straight execution without parallelism - if (Control.DisableParallelization || Control.NumberOfParallelWorkerThreads < 2) - { - // efficient since the compiler can drop the range checks - for (int i = 0; i < array.Length; i++) - { - body(i, array[i]); - } - return; - } - - // Common case -#if PORTABLE - var tasks = new Task[Control.NumberOfParallelWorkerThreads]; - var size = array.Length / tasks.Length; - - // partition the jobs into separate sets for each but the last worked thread - for (var i1 = 0; i1 < tasks.Length - 1; i1++) - { - var start = (i1 * size); - var stop = ((i1 + 1) * size); - - tasks[i1] = Task.Factory.StartNew(() => - { - for (int j = start; j < stop; j++) - { - body(j, array[j]); - } - }); - } - - // add another set for last worker thread - tasks[tasks.Length - 1] = Task.Factory.StartNew(() => - { - for (int j = ((tasks.Length - 1) * size); j < array.Length; j++) - { - body(j, array[j]); - } - }); - - Task.WaitAll(tasks); -#else - Parallel.ForEach( - Partitioner.Create(0, array.Length), - new ParallelOptions - { - MaxDegreeOfParallelism = Control.NumberOfParallelWorkerThreads - }, - (range, loopState) => - { - for (var i = range.Item1; i < range.Item2; i++) - { - body(i, array[i]); - } - }); -#endif - } - /// /// Executes each of the provided actions inside a discrete, asynchronous task. /// diff --git a/src/UnitTests/StatisticsTests/PercentileTests.cs b/src/UnitTests/StatisticsTests/PercentileTests.cs index 73c2900e..d1d76fe7 100644 --- a/src/UnitTests/StatisticsTests/PercentileTests.cs +++ b/src/UnitTests/StatisticsTests/PercentileTests.cs @@ -28,8 +28,6 @@ // OTHER DEALINGS IN THE SOFTWARE. // -using System; - namespace MathNet.Numerics.UnitTests.StatisticsTests { using NUnit.Framework; @@ -38,7 +36,7 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests /// /// Percentile tests. /// - [TestFixture, Obsolete] + [TestFixture] public class PercentileTests { /// @@ -49,63 +47,37 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests /// /// Can compute percentile using NIST method. /// - [Test, Obsolete] + [Test] public void CanComputePercentileUsingNistMethod() { - var percentile = new Percentile(Data) - { - Method = PercentileMethod.Nist - }; - Assert.AreEqual(95.19807, percentile.Compute(.9)); Assert.AreEqual(95.19807, Data.QuantileCustom(.9, QuantileDefinition.Nist)); } /// /// Can compute percentile using excel method. /// - [Test, Obsolete] + [Test] public void CanComputePercentileUsingExcelMethod() { - var percentile = new Percentile(Data) - { - Method = PercentileMethod.Excel - }; - Assert.AreEqual(95.19568, percentile.Compute(.9)); Assert.AreEqual(95.19568, Data.QuantileCustom(.9, QuantileDefinition.Excel)); } /// /// Can compute percentile using nearest method. /// - [Test, Obsolete] + [Test] public void CanComputePercentileUsingNearestMethod() { - var percentile = new Percentile(Data) - { - Method = PercentileMethod.Nearest - }; - Assert.AreEqual(95.1959, percentile.Compute(.9)); Assert.AreEqual(95.1959, Data.QuantileCustom(.9, QuantileDefinition.Nearest)); } /// /// Can compute percentile using interpolation method /// - [Test, Obsolete] + [Test] public void CanComputePercentileUsingInterpolationMethod() { var data = new double[] {1, 2, 3, 4, 5}; - var percentile = new Percentile(data) - { - Method = PercentileMethod.Interpolation - }; - - var values = new[] {.25, .5, .75}; - var percentiles = percentile.Compute(values); - Assert.AreEqual(1.75, percentiles[0]); - Assert.AreEqual(3.0, percentiles[1]); - Assert.AreEqual(4.25, percentiles[2]); - var q = data.QuantileCustomFunc(QuantileDefinition.R5); Assert.AreEqual(1.75, q(0.25)); Assert.AreEqual(3.0, q(0.5)); @@ -115,24 +87,19 @@ namespace MathNet.Numerics.UnitTests.StatisticsTests /// /// Empty dataset returns NaN. /// - [Test, Obsolete] + [Test] public void EmptyDataSetReturnsNaN() { var data = new double[] {}; - var percentile = new Percentile(data); - Assert.IsTrue(double.IsNaN(percentile.Compute(0))); Assert.IsTrue(double.IsNaN(data.Quantile(0))); } /// /// Invalid percentile values return NaN. /// - [Test, Obsolete] + [Test] public void InvalidPercentileValuesReturnNaN() { - var percentile = new Percentile(Data); - Assert.IsTrue(double.IsNaN(percentile.Compute(-0.1))); - Assert.IsTrue(double.IsNaN(percentile.Compute(1.1))); Assert.IsTrue(double.IsNaN(Data.Quantile(-0.1))); Assert.IsTrue(double.IsNaN(Data.Quantile(1.1))); }