Quantcast
Channel: mathnetnumerics Wiki & Documentation Rss Feed
Viewing all 88 articles
Browse latest View live

Updated Wiki: Linear Algebra

$
0
0

Linear Algebra

All linear algebra functionality for Math.Net can be found under the MathNet.Numerics.LinearAlgebra namespace. This namespace is divided up into four different subnamespaces
  • MathNet.Numerics.LinearAlgebra.Double: for doing real linear algebra using double floating point precision.
  • MathNet.Numerics.LinearAlgebra.Single: for doing real linear algebra using single floating point precision.
  • MathNet.Numerics.LinearAlgebra.Complex: for doing complex linear algebra using double floating point precision.
  • MathNet.Numerics.LinearAlgebra.Complex32: for doing complex linear algebra using single floating point precision.

The reason we make this distinction is that each of the different formats has different memory requirements. A real matrix in single floating point precision will be the smallest. The same matrix represented as a complex double floating point matrix will require roughly four times as much memory. The downside of real single floating point precision is less accuracy and no ability to do decompositions that involve complex quantities.

Another distinction we make in the linear algebra library is in different matrix storage representations. Currently, Math.Net supports three different matrix storage representations (for each of the four different types mentionned above):
  • DenseMatrix: for representing arbitrary matrices.
  • SparseMatrix: for representing sparse matrices.
  • DiagonalMatrix: for representing diagonal matrices.

Again, each different matrix storage representation optimizes for a particular usage pattern. Sparse matrices are represented in 3-array compressed-sparse-row (CSR) format. Diagonal matrices are represented as vectors. Math.Net supports both dense and sparse vectors.

The final feature of the linear algebra library is which computational engine executes the calculations. The default configuration for Math.Net uses all managed code to execute matrix operations. Since managed code executes on the x87 unit, it cannot use any of the special vectorized instructions to speed up calculations. For very large matrices this will have an impact on performance compared to native implementations. We suggest you vote on Microsoft Connect to encourage the CLR team to implement this feature in the future. Nonetheless, Math.Net also support native providers for executing linear algebra computations. To configure these providers, use the following code

// Use the ATLAS native linear algebra provider.
MathNet.Numerics.Control.LinearAlgebraProvider = new AtlasLinearAlgebraProvider();


Currently, Math.Net supports Atlas and Intel MKL providers. We encourage the community to contribute other providers (such as GPU backed computations).

Decompositions & Least Squares Problems

...

Samples

A short sample for creating a matrix and a vector and multiplying them together can be found below.
using MathNet.Numerics.LinearAlgebra.Double;
// Create a vector of dimension 5 with 4.0 in every entry.
var x = new DenseVector(5, 4.0);
// Create a 3 by 5 matrix with 2.0 in every entry.
var A = new DenseMatrix(3, 5, 2.0);
// Multiply the matrix and the vector.
var y = A * x;

Updated Wiki: Special Functions

$
0
0

Special Functions

Factorial


Code Sample:
double x = SpecialFunctions.Factorial(14);
// x will now have the value 87178291200.0

double y = SpecialFunctions.Factorial(31);
// y will now have the value 8.2228386541779224E+33

Gamma

Commonly used gamma-related functions in literature:

GAMMA(a) = int(exp(-t)t^(a-1), t=0..infinity)
gamma(a,x) = int(exp(-t)t^(a-1),t=0..x)  
Gamma(a,x) = int(exp(-t)t^(a-1),t=x..infinity)  
P(a,x) = gamma(a,x)/GAMMA(a)  
Q(a,x) = Gamma(a,x)/GAMMA(a)

Digamma (Psi)

Euler Beta

Error Function

  • Error Function: Erf
  • Complementary Error Function: Erfc
  • Inverse Error Function: ErfInv
  • Inverse Complementary Error Function: ErfcInv

Code Sample:
double x = 0.9;
double res = SpecialFunctions.Erf(x);
// res will now have the value 0.7969082124

Logistic (Sigmoid)

  • Logistic Function: Logistic
  • Logit Function (inverse of Logistic): Logit

Harmonic Numbers

Various Numerically Stable Functions

Updated Wiki: Interpolation

$
0
0

Interpolation

Namespace: MathNet.Numerics.Interpolation

Interpolation is a two-phased operation in Math.NET Numerics:
  1. Create an interpolation scheme for the chosen algorithm and optimized for the given sample points. You get back a class that implements the IInterpolation interface.
  2. Use this scheme to compute values at arbitrary points. Some interpolation algorithms also allow you to compute the derivative and the indefinite integral at that point.

The static Interpolate class provides simple factory methods to create the interpolation scheme in a simple method call:
  • RationalWithoutPoles, creates a Floater-Hormann barycentric interpolation
  • RationalWithPoles, creates a Bulirsch & Stoer rational interpolation
  • LinearBetweenPoints, creates a linear spline interpolation

If unsure, we recommend using RationalWithoutPoles for most cases.

Alternatively you can also use the algorithms directly, they're publicly available in the Algorithms sub-namespace for those who want to use a specific algorithm. The following algorithms are available:

Interpolation on equidistant sample points

  • Polynomial: Barycentric Algorithm

Interpolation on arbitrary sample points

  • Rational pole-free: Barycentric Floater-Hormann Algorithm
  • Rational with poles: Bulirsch & Stoer Algorithm
  • Neville Polynomial: Neville Algorithm. Note that the Neville algorithm performs very badly on equidistant points. If you need to interpolate a polynomial on equidistant points, we recommend to use the barycentric algorithm instead.
  • Linear Spline
  • Cubic Spline with boundary conditions
  • Natural Cubic Spline
  • Akima Cubic Spline

Interpolation with additional data

  • Generic Barycentric Interpolation, requires barycentric weights
  • Generic Spline, requires spline coefficients
  • Generic Cubic Hermite Spline, requires the derivatives

Updated Wiki: Interpolation

$
0
0

Interpolation

Namespace: MathNet.Numerics.Interpolation

Interpolation is a two-phased operation in Math.NET Numerics:
  1. Create an interpolation scheme for the chosen algorithm and optimized for the given sample points. You get back a class that implements the IInterpolation interface.
  2. Use this scheme to compute values at arbitrary points. Some interpolation algorithms also allow you to compute the derivative and the indefinite integral at that point.
The static Interpolate class provides simple factory methods to create the interpolation scheme in a simple method call:
  • RationalWithoutPoles, creates a Floater-Hormann barycentric interpolation
  • RationalWithPoles, creates a Bulirsch & Stoer rational interpolation
  • LinearBetweenPoints, creates a linear spline interpolation
If unsure, we recommend using RationalWithoutPoles for most cases.

Alternatively you can also use the algorithms directly, they're publicly available in the Algorithms sub-namespace for those who want to use a specific algorithm. The following algorithms are available:

Interpolation on equidistant sample points

  • Polynomial: Barycentric Algorithm

Interpolation on arbitrary sample points

  • Rational pole-free: Barycentric Floater-Hormann Algorithm
  • Rational with poles: Bulirsch & Stoer Algorithm
  • Neville Polynomial: Neville Algorithm. Note that the Neville algorithm performs very badly on equidistant points. If you need to interpolate a polynomial on equidistant points, we recommend to use the barycentric algorithm instead.
  • Linear Spline
  • Cubic Spline with boundary conditions
  • Natural Cubic Spline
  • Akima Cubic Spline

Interpolation with additional data

  • Generic Barycentric Interpolation, requires barycentric weights
  • Generic Spline, requires spline coefficients
  • Generic Cubic Hermite Spline, requires the derivatives

Updated Wiki: Integration

$
0
0

Numerical Integration

Simpson's Rule

Newton Cotes Trapezium Rule

Double-Exponential Transformation

Updated Wiki: Native Providers

$
0
0

Native Providers

Math.NET Numerics currently supports two native providers Intel's Math Kernel Library (MKL) and AMD's Core Math Library (ACML).

MKL (Windows)

  1. Install MKL on your system (we are using v10.3 Update 2).
  2. Open the NativeWrappers.sln in VS 2010 under \src\NativeWrappers\Windows .
  3. Open the Configuration Manager and select either the 32-bit or 64-bit solution platform.
  4. Right click on the MKLWrapper project and update the MKL include directory under C/C++/General and the library directory under Linker/General to point to your MKL installation.
  5. Right click on the MKLWrapper project and click rebuild.
  6. There will be two DLLs in the output directory: Math.NET.Numerics.MKL.dll and libiomp5md.dll. The output directory will be either \src\NativeWrappers\Windows\Win32\Release or \src\NativeWrappers\Windows\x64\release.
  7. Copy the two DLLs from #6 to the same directory as MathNet.Numerics.dll.
  8. Tell the Math.NET Numerics library to use the MKL provider by adding this line to your code:
MathNet.Numerics.Control.LinearAlgebraProvider =
   new MathNet.Numerics.Algorithms.LinearAlgebra.Mkl.MklLinearAlgebraProvider();

ACML (Windows)

  1. Install the Intel Fortran version of ACML on your system (we are using v4.4) - http://developer.amd.com/cpu/Libraries/acml/Pages/default.aspx
  2. Open the NativeWrappers.sln in VS 2010 under \src\NativeWrappers\Windows .
  3. Open the Configuration Manager and select either the 32-bit or 64-bit solution platform.
  4. Right click on the ACMLWrapper project and update the ACML include directory under C/C++/General and the library directory under Linker/General to point to your ACML installation.
  5. Right click on the ACMLWrapper project and click rebuild.
  6. There will be one DLL in the output directory: Math.NET.Numerics.ACML.dll. The output directory will be either \src\NativeWrappers\Windows\Win32\Release or \src\NativeWrappers\Windows\x64\release.
  7. Copy the DLL from #6 to the same directory as MathNet.Numerics.dll.
  8. Copy these DLLS from your ACML installation to the same directory as MathNet.Numerics: libacmlmpdll.dll, libifcoremd.dll, libiomp5md.dll, and libmmd.dll
  9. Tell the Math.NET Numerics library to use the ACML provider by adding this line to your code:
MathNet.Numerics.Control.LinearAlgebraProvider =
   new MathNet.Numerics.Algorithms.LinearAlgebra.Acml.AcmlLinearAlgebraProvider();

Note: The ACML wrapper dynamically links the ACML libraries. If you have the Intel Fortran Complier installed you can statically link them.

Updated Wiki: Native Providers

$
0
0

Native Linear Algebra Providers

Math.NET Numerics currently supports two native providers Intel's Math Kernel Library (MKL) and AMD's Core Math Library (ACML).

MKL (Windows)

  1. Install MKL on your system (we are using v10.3 Update 2).
  2. Open the NativeWrappers.sln in VS 2010 under \src\NativeWrappers\Windows .
  3. Open the Configuration Manager and select either the 32-bit or 64-bit solution platform.
  4. Right click on the MKLWrapper project and update the MKL include directory under C/C++/General and the library directory under Linker/General to point to your MKL installation.
  5. Right click on the MKLWrapper project and click rebuild.
  6. There will be two DLLs in the output directory: Math.NET.Numerics.MKL.dll and libiomp5md.dll. The output directory will be either \src\NativeWrappers\Windows\Win32\Release or \src\NativeWrappers\Windows\x64\release.
  7. Copy the two DLLs from #6 to the same directory as MathNet.Numerics.dll.
  8. Tell the Math.NET Numerics library to use the MKL provider by adding this line to your code:
MathNet.Numerics.Control.LinearAlgebraProvider =
   new MathNet.Numerics.Algorithms.LinearAlgebra.Mkl.MklLinearAlgebraProvider();

ACML (Windows)

  1. Install the Intel Fortran version of ACML on your system (we are using v4.4) - http://developer.amd.com/cpu/Libraries/acml/Pages/default.aspx
  2. Open the NativeWrappers.sln in VS 2010 under \src\NativeWrappers\Windows .
  3. Open the Configuration Manager and select either the 32-bit or 64-bit solution platform.
  4. Right click on the ACMLWrapper project and update the ACML include directory under C/C++/General and the library directory under Linker/General to point to your ACML installation.
  5. Right click on the ACMLWrapper project and click rebuild.
  6. There will be one DLL in the output directory: Math.NET.Numerics.ACML.dll. The output directory will be either \src\NativeWrappers\Windows\Win32\Release or \src\NativeWrappers\Windows\x64\release.
  7. Copy the DLL from #6 to the same directory as MathNet.Numerics.dll.
  8. Copy these DLLS from your ACML installation to the same directory as MathNet.Numerics: libacmlmpdll.dll, libifcoremd.dll, libiomp5md.dll, and libmmd.dll
  9. Tell the Math.NET Numerics library to use the ACML provider by adding this line to your code:
MathNet.Numerics.Control.LinearAlgebraProvider =
   new MathNet.Numerics.Algorithms.LinearAlgebra.Acml.AcmlLinearAlgebraProvider();

Note: The ACML wrapper dynamically links the ACML libraries. If you have the Intel Fortran Complier installed you can statically link them.

Updated Wiki: Documentation

$
0
0

Math.NET Numerics Documentation

Math.NET Numerics is an opensource numerical library for .Net, Silverlight, Metro and Mono. This topic lists documentation that will help you use the toolkit in your own application. In addition to the user guide, there's also a condensed API Reference available, or if you prefer examples the sample code project may give you some ideas.

User Guide

  • Quick Start
  • Basic Concepts
  • F# Extensions

Advanced Topics


Updated Wiki: Integral Transforms

$
0
0

Linear Integral Transforms

Math.NET Numerics currently supports two linear integral transforms: The discrete Fourier transform and the discrete Hartley transform. Both are strongly localized in the frequency spectrum, but while the Fourier transform operates on complex values, the Hartley transform operates on real values only.

The transforms implement a separate forward and inverse transform method. How the forward and inverse methods are related to each other and what exact definition is to be used can be specified by an additional options parameter.

Fourier Space: Discrete Fourier Transform and FFT

Wikipedia has an extensive article on the discrete fourier transform (DFT). We provide implementations of the following algorithms:
  • Naive Discrete Fourier Transform (DFT): Out-place transform for arbitrary vector lengths. Mainly intended for verifying faster algorithms: NaiveForward, NaiveInverse
  • Radix-2 Fast Fourier Transform (FFT): In-place fast fourier transform for vectors with a power-of-two length (Radix-2): Radix2Forward, Radix2Inverse

Furthermore, the Transform class provides a shortcut for the Bluestein FFT using static methods which are even easier to use: FourierForward, FourierInverse.

Code Sample using the Transform class:
// create a complex sample vector of length 96
Complex[] samples = SignalGenerator.EquidistantInterval(
     t => new Complex(1.0 / (t * t + 1.0), t / (t * t + 1.0)),
     -16, 16, 96);

// inplace bluestein FFT with default options
Transform.FourierForward(samples);


Fourier Options:
  • Default: Uses a negative exponent sign in forward transformations, and symmetric scaling (that is, sqrt(1/N) for both forward and inverse transformation). This is the convention used in Maple and is widely accepted in the educational sector (due to the symmetry).
  • AsymmetricScaling: Set this flag to suppress scaling on the forward transformation but scale the inverse transform with 1/N.
  • NoScaling: Set this flag to suppress scaling for both forward and inverse transformation. Note that in this case if you apply first the forward and then inverse transformation you won't get back the original signal (by factor N/2).
  • InverseExponent: Uses the positive instead of the negative sign in the forward exponent, and the negative (instead of positive) exponent in the inverse transformation.
  • Matlab: Use this flag if you need Matlab compatibility. Equals to setting the AsymmetricScaling flag. This matches the definition used in the wikipedia article.
  • NumericalRecipes: Use this flag if you need Numerical Recipes compatibility. Equal to setting both the InverseExponent and the NoScaling flags.

Useful symmetries of the fourier transform:
  • h(t) is real valued <=> real part of H(f) is even, imgainary part of H(f) is odd
  • h(t) is imaginary valued <=> real part of H(f) is odd, imaginary part of H(f) is even
  • h(t) is even <=> H(f) is even
  • h(t) is odd <=> H(f) is odd
  • h(t) is real-valued even <=> H(f) is real-valued even
  • h(t) is real-valued odd <=> H(f) is imaginary-valued odd
  • h(t) is imaginary-valued even <=> H(f) is imaginary-valued even
  • h(t) is imaginary-valued odd <=> H(f) is real-valued odd

Hartley Space: Discrete Hartley Transform

...

Updated Wiki: Number Theory

$
0
0

Number Theory

In the MathNet.Numerics.NumberTheory namespace we provide as set of arithmetic methods for integers types like int, long and BigInteger. Among the algorithms are Euclid's algorithm for computing the greatest common divisor of two or a larger set of integers, checking for perfect squares etc.

Updated Wiki: Documentation

$
0
0

Math.NET Numerics Documentation

Math.NET Numerics is an opensource numerical library for .Net, Silverlight, Metro and Mono. This topic lists documentation that will help you use the toolkit in your own application. In addition to the user guide, there's also a condensed API Reference available, or if you prefer examples the sample code project may give you some ideas.

User Guide

  • Quick Start
  • Basic Concepts
  • F# Extensions

Advanced Topics

Updated Wiki: Probability Distributions

$
0
0

Probability Distributions

In MathNet.Numerics.Distributions we have a whole set of probability distributions. They are divided up into univariate continuous, univariate discrete and multivariate distributions. All the univariate distributions derive from the MathNet.Numerics.Distributions.IDistribution interface whereas the continuous ones derive from MathNet.Numerics.Distributions.IContinuousDistribution and the discrete distributions derive from MathNet.Numerics.Distributions.IDiscreteDistribution. On the other hand, there is no particular class hierarchy for the multivariate distributions: as their domains can be quite different it would be hard to come up with a simple and clean unifying interface.

Warning: One has to be careful when using distributions. There are many ways to parameterize a distribution in the literature; when using the default constructor, study carefully which parameters it requires. If they do not suite your needs, there will likely be static method which can construct the distribution for you with the parameters of your choice. For example, to construct a normal distribution with mean 0.0 and standard deviation 2.0 you can use var n = new Normal(0.0, 2.0); . However, if you'd rather parameterize the normal distribution using a mean and precision, one can use the following code instead: var n = Normal.WithMeanPrecision(0.0,0.5);

All the distributions implement a basic set of operations such as computing the mean, standard deviation, density, etc. Note that it is often numerically more stable and faster to compute quantities in the log domain; for some quantities (e.g. Density) we implement an equivalent method that does all computations in the log domain (e.g. DensityLn).

Each distribution provides methods to generate random numbers from that distribution. These random variate generators work by accessing the distribution's member RandomSource (which is a subclass of System.Random, see Random Numbers for details) to provide uniform random numbers. By default, this member is an instance of System.Random but one can easily replace this with more sophisticated random number generators from MathNet.Numerics.Random. Each distribution class has two static and two class methods: for each pair (static and class), one of them generates a single sample, the other will generate an IEnumerable<T> of samples. The static methods allow random number generation without instantiating the actual class.

Discrete Distributions

The following discrete distributions are currently implemented. Strikeout items are not ported yet but are available in Iridium or dnAnalytics and thus should be available soon.

Continuous Distributions

Multivariate Distributions

Updated Wiki: Statistics

$
0
0

Statistics

Univariate Statistical Analysis

To compute descriptive statistical characteristics of a sample set you can either call the extension methods of the Statistics class directly, or create a new DescriptiveStatistics instance and pass your samples to its constructor to compute all the characteristics in one pass.

Code Sample using DescriptiveStatistics:
using MathNet.Numerics.Statistics;

var samples = new ChiSquare(5).Samples().Take(1000);
var statistics = new DescriptiveStatistics(samples);

// Order Statistics
var largestElement = statistics.Maximum;
var smallestElement = statistics.Minimum;
var median = statistics.Median;

// Central Tendency
var mean = statistics.Mean;

// Dispersion
var variance = statistics.Variance;
var stdDev = statistics.StandardDeviation;

// Other Statistics
var kurtosis = statistics.Kurtosis;
var skewness = statistics.Skewness;


Code Sample using the extensions methods:
using MathNet.Numerics.Statistics;

// Extension methods are defined on IEnumerable<double>,
// yet we call ToArray so all the methods operate on the same data
var samples = new ChiSquare(5).Samples().Take(1000).ToArray();

// Order Statistics
var largestElement = samples.Maximum();
var smallestElement = samples.Minimum();
var median = samples.Median();
var 250thOrderStatistic = samples.OrderStatistic(250);

// Central Tendency
var mean = samples.Mean();

// Dispersion
var variance = samples.Variance();
var biasedPopulationVariance = samples.PopulationVariance();
var stdDev = samples.StandardDeviation();
var biasedPopulationStdDev = samples.PopulationStandardDeviation();

Histograms

A histrogram can be computed using the Histogram class. Its constructor takes the samples enumerable. the number of buckets to create, plus optionally the range (minimum, maximum) of the sample data if available.

var histogram = new Histogram(samples, 10);
var bucket3count = histogram[2].Count;

Percentiles

Percentiles can be computed using the Percentile class. It supports four methods, which can be chosen using the Methods property:
  • Nist: Using the method recommended by NIST. This is the default method.
  • Nearest: Using the nearest rank method.
  • Excel: Using the method that is also used by Microsoft Excel.
  • Interpolation: Using linear interpolation between the two nearest ranks, see wikipedia.

var percentile = new Percentile(samples) { Method = PercentileMethod.Nearest };
var percentile90 = percentile.Compute(0.9);
var percentiles = percentile.Compute(new[] { .25, .5, .75 });

Correlation

The Correlation class supports computing Pearson product-momentum correlation coefficients:

Code Sample: Computing the correlation coefficient between 1000 samples of f(x) = 2x and g(x) = x^2:
double[] dataF = SignalGenerator.EquidistantInterval(x => x * 2, 0, 100, 1000);
double[] dataG = SignalGenerator.EquidistantInterval(x => x * x, 0, 100, 1000);
double correlation = Correlation.Pearson(dataF, dataG);

Updated Wiki: Linear Algebra

$
0
0

Linear Algebra

All linear algebra functionality for Math.NET can be found under the MathNet.Numerics.LinearAlgebra namespace. This namespace is divided up into four different subnamespaces
  • MathNet.Numerics.LinearAlgebra.Double: for doing real linear algebra using double floating point precision.
  • MathNet.Numerics.LinearAlgebra.Single: for doing real linear algebra using single floating point precision.
  • MathNet.Numerics.LinearAlgebra.Complex: for doing complex linear algebra using double floating point precision.
  • MathNet.Numerics.LinearAlgebra.Complex32: for doing complex linear algebra using single floating point precision.
The reason we make this distinction is that each of the different formats has different memory requirements. A real matrix in single floating point precision will be the smallest. The same matrix represented as a complex double floating point matrix will require roughly four times as much memory. The downside of real single floating point precision is less accuracy and no ability to do decompositions that involve complex quantities.

Another distinction we make in the linear algebra library is in different matrix storage representations. Currently, Math.Net supports three different matrix storage representations (for each of the four different types mentionned above):
  • DenseMatrix: for representing arbitrary matrices.
  • SparseMatrix: for representing sparse matrices.
  • DiagonalMatrix: for representing diagonal matrices.

Again, each different matrix storage representation optimizes for a particular usage pattern. Sparse matrices are represented in 3-array compressed-sparse-row (CSR) format. Diagonal matrices are represented as vectors. Math.NET supports both dense and sparse vectors.

The final feature of the linear algebra library is which computational engine executes the calculations. The default configuration for Math.NET uses all managed code to execute matrix operations. Since managed code executes on the x87 unit, it cannot use any of the special vectorized instructions to speed up calculations. For very large matrices this will have an impact on performance compared to native implementations. We suggest you vote on Microsoft Connect to encourage the CLR team to implement this feature in the future. Nonetheless, Math.NET also supports native providers for executing linear algebra computations. To configure these providers, use the following code

// Use the ATLAS native linear algebra provider.
MathNet.Numerics.Control.LinearAlgebraProvider = new AtlasLinearAlgebraProvider();

Currently, Math.NET supports Atlas and Intel MKL providers. We encourage the community to contribute other providers (such as GPU backed computations, e.g. using Nvidia CUDA).

Decompositions & Least Squares Problems

...

Samples

A short sample for creating a matrix and a vector and multiplying them together can be found below.
using MathNet.Numerics.LinearAlgebra.Double;
// Create a vector of dimension 5 with 4.0 in every entry.
var x = new DenseVector(5, 4.0);
// Create a 3 by 5 matrix with 2.0 in every entry.
var A = new DenseMatrix(3, 5, 2.0);
// Multiply the matrix and the vector.
var y = A * x;

Updated Wiki: Linear Algebra

$
0
0

Linear Algebra

All linear algebra functionality for Math.NET can be found under the MathNet.Numerics.LinearAlgebra namespace. This namespace is divided up into four different subnamespaces
  • MathNet.Numerics.LinearAlgebra.Double: for doing real linear algebra using double floating point precision.
  • MathNet.Numerics.LinearAlgebra.Single: for doing real linear algebra using single floating point precision.
  • MathNet.Numerics.LinearAlgebra.Complex: for doing complex linear algebra using double floating point precision.
  • MathNet.Numerics.LinearAlgebra.Complex32: for doing complex linear algebra using single floating point precision.
The reason we make this distinction is that each of the different formats has different memory requirements. A real matrix in single floating point precision will be the smallest. The same matrix represented as a complex double floating point matrix will require roughly four times as much memory. The downside of real single floating point precision is less accuracy and no ability to do decompositions that involve complex quantities.

Another distinction we make in the linear algebra library is in different matrix storage representations. Currently, Math.Net supports three different matrix storage representations (for each of the four different types mentionned above):
  • DenseMatrix: for representing arbitrary matrices.
  • SparseMatrix: for representing sparse matrices.
  • DiagonalMatrix: for representing diagonal matrices.
Again, each different matrix storage representation optimizes for a particular usage pattern. Sparse matrices are represented in 3-array compressed-sparse-row (CSR) format. Diagonal matrices are represented as vectors. Math.NET supports both dense and sparse vectors.

The final feature of the linear algebra library is which computational engine executes the calculations. The default configuration for Math.NET uses all managed code to execute matrix operations. Since managed code executes on the x87 unit, it cannot use any of the special vectorized instructions to speed up calculations. For very large matrices this will have an impact on performance compared to native implementations. We suggest you vote on Microsoft Connect to encourage the CLR team to implement this feature in the future. Nonetheless, Math.NET also supports native providers for executing linear algebra computations. To configure these providers, use the following code

// Use the ATLAS native linear algebra provider.
MathNet.Numerics.Control.LinearAlgebraProvider = new AtlasLinearAlgebraProvider();

Currently, Math.NET supports Atlas and Intel MKL providers. We encourage the community to contribute other providers (such as GPU backed computations, e.g. using Nvidia CUDA).

Decompositions & Least Squares Problems

...

Samples

A short sample for creating a matrix and a vector and multiplying them together can be found below.
using MathNet.Numerics.LinearAlgebra.Double;
// Create a vector of dimension 5 with 4.0 in every entry.
var x = new DenseVector(5, 4.0);
// Create a 3 by 5 matrix with 2.0 in every entry.
var A = new DenseMatrix(3, 5, 2.0);
// Multiply the matrix and the vector.
var y = A * x;

Updated Wiki: Special Functions

$
0
0

Special Functions

Factorial

Code Sample:
double x = SpecialFunctions.Factorial(14);
// x will now have the value 87178291200.0

double y = SpecialFunctions.Factorial(31);
// y will now have the value 8.2228386541779224E+33

Gamma

Commonly used gamma-related functions in literature:

GAMMA(a) = int(exp(-t)t^(a-1), t=0..infinity)
gamma(a,x) = int(exp(-t)t^(a-1),t=0..x)  
Gamma(a,x) = int(exp(-t)t^(a-1),t=x..infinity)  
P(a,x) = gamma(a,x)/GAMMA(a)  
Q(a,x) = Gamma(a,x)/GAMMA(a)

Digamma (Psi)

Euler Beta

Error Function

  • Error Function: Erf
  • Complementary Error Function: Erfc
  • Inverse Error Function: ErfInv
  • Inverse Complementary Error Function: ErfcInv
Code Sample:
double x = 0.9;
double res = SpecialFunctions.Erf(x);
// res will now have the value 0.7969082124

Logistic (Sigmoid)

  • Logistic Function: Logistic
  • Logit Function (inverse of Logistic): Logit

Harmonic Numbers

Various Numerically Stable Functions

Updated Wiki: References

$
0
0

References - Math.NET in the wild

On this page we try to collect an excerpt of the "social" graph of the Math.NET Numerics project. What other code or projects contributed in some way to Math.NET? Where is it used in the wild?

Direct Contributions

Maintainers

Contributors

Indirect Contributions and Inspiration

Contributors via dnAnalytics and Math.NET Iridium (both merged into Numerics)

  • Patrick van der Valde
  • Joannès Vermorel
  • Matthew Kitchin
  • Rana Ian
  • Andrew Kurochka
  • Thaddaeus Parker

Contributors via other opensource projects

  • ALGLIB by Sergey Bochkanov (with permission before license changed - thanks!)
  • Boost by John Maddock
  • Cephes Math Library by Stephen L. Moshier

Where Math.NET is used

Excerpt of some projects and works where Math.NET is used or referenced today, or has been in the past. Please let us know if you'd like your work listed here as well, or if you'd prefer if we remove it.

Opensource Projects and Code Snippets

Articles & Tutorials

Thesis & Papers

TODO: find links, verify
  • Detecting falls and poses in image silhouettes, Master's Thesis in Complex Adaptive Systems, Niklas Schräder, Chalmers University of Technology, Gothenburg, Sweden, 2011
  • SoundLog, Master's Thesis in Information and Software Engineering, André Filipe Mateus Ferreira, Instituto Superior Técnico, Universidade Técnica de Lisboa
  • ACCELEROMETERS USABILITY FOR DANGER TILT OFF-HIGHWAY VEHICLES AND SIGNAL FILTRATION WITH KALMAN FILTER, Ondrej LÍŠKA, Kamil ŽIDEK, Technical University of Kosice, SjF, Department of biomedical engineering automation and measuring, Journal of applied science in the thermodynamics and fluid mechanics Vol. 4, No. 2/2010, ISSN 1802-9388
  • Fast evaluation of Greeks in Monte Carlo calculations with the Adjoint Method, Bachelor Thesis, Ivan Kuliš, Fachbereich Informatik und Mathematik, Institut für Mathematik, Johann Wolfgang Goethe Universität, Frankfurt am Main, 14.09.2011
  • 3DMapping for Robotic Search and Rescue, Peter Nelson, New College, 28 May 2011
  • Quantitative structure-property relationship modeling algorithms, challenges and IT solutions, Thesis, Ondrej Skrehota, FACULTY OF INFORMATIC, MASARYK UNIVERSITY, 2010
  • Seismic Performance Assessment of Buildings Volume 2 – Implementation Guide, ATC-58-1 75% Draft, APPLIED TECHNOLOGY COUNCIL, 201 Redwood Shores Parkway, Suite 240, Redwood City, California 94065, prepared for U.S. DEPARTMENT OF HOMELAND SECURITY (DHS) FEDERAL EMERGENCY MANAGEMENT AGENCY
  • Use of Mobile Phones as Intelligent Sensors for Sound Input Analysis and Sleep State Detection, Ondrej Krejcar, Jakub Jirka, Dalibor Janckulik, Sensors 2011, 11, 6037-6055, ISSN 1424-8220, 2011
  • Design of a Wireless Acquisition System for a Digital Stethoscope, Bachelor Thesis, Justin Miller, Faculty of Engineering & Surveying, University of Southern Queensland, ENG4112 Research Project, 2010
  • Konzeption und Umsetzung einer RIA zur untersuchungsbegleitenden Erfassung von RNFLT-Scans und Untersuchung von Klassifikatoren für die diagnostische Unterstützung bei neurodegenerativen Erkrankungen am Beispiel der Multiplen Sklerose, Diplomarbeit, Sebastian Bischoff, Fachbereich Informatik und Medien, Fachhochschule Brandenburg, 1.11.2009
  • Ka`imiolakai ROV, Team Limawa, Kapi´olani Community College
  • Prototipo de una aplicación informática para gestión y mantenimiento de recursos pesquero, Silvia Rodríguez Rodríguez, José Juan Castro Hernández, 2010

University Course Work

  • Uni Muenster, Computer Vision und Mustererkennung (SS 2011)

Updated Wiki: References

$
0
0

References - Math.NET in the wild

On this page we try to collect an excerpt of the "social" graph of the Math.NET Numerics project. What other code or projects contributed in some way to Math.NET? Where is it used in the wild?

Direct Contributions

Maintainers

Contributors

Indirect Contributions and Inspiration

Contributors via dnAnalytics and Math.NET Iridium (both merged into Numerics)

  • Patrick van der Valde
  • Joannès Vermorel
  • Matthew Kitchin
  • Rana Ian
  • Andrew Kurochka
  • Thaddaeus Parker

Contributors via other opensource projects

  • ALGLIB by Sergey Bochkanov (with permission before license changed - thanks!)
  • Boost by John Maddock
  • Cephes Math Library by Stephen L. Moshier

Where Math.NET is used

Excerpt of some projects and works where Math.NET is used or referenced today, or has been in the past. Please let us know if you'd like your work listed here as well, or if you'd prefer we remove it.

Opensource Projects and Code Snippets

Articles & Tutorials

Thesis & Papers

TODO: find links, verify
  • Detecting falls and poses in image silhouettes, Master's Thesis in Complex Adaptive Systems, Niklas Schräder, Chalmers University of Technology, Gothenburg, Sweden, 2011
  • SoundLog, Master's Thesis in Information and Software Engineering, André Filipe Mateus Ferreira, Instituto Superior Técnico, Universidade Técnica de Lisboa
  • ACCELEROMETERS USABILITY FOR DANGER TILT OFF-HIGHWAY VEHICLES AND SIGNAL FILTRATION WITH KALMAN FILTER, Ondrej LÍŠKA, Kamil ŽIDEK, Technical University of Kosice, SjF, Department of biomedical engineering automation and measuring, Journal of applied science in the thermodynamics and fluid mechanics Vol. 4, No. 2/2010, ISSN 1802-9388
  • Fast evaluation of Greeks in Monte Carlo calculations with the Adjoint Method, Bachelor Thesis, Ivan Kuliš, Fachbereich Informatik und Mathematik, Institut für Mathematik, Johann Wolfgang Goethe Universität, Frankfurt am Main, 14.09.2011
  • 3DMapping for Robotic Search and Rescue, Peter Nelson, New College, 28 May 2011
  • Quantitative structure-property relationship modeling algorithms, challenges and IT solutions, Thesis, Ondrej Skrehota, FACULTY OF INFORMATIC, MASARYK UNIVERSITY, 2010
  • Seismic Performance Assessment of Buildings Volume 2 – Implementation Guide, ATC-58-1 75% Draft, APPLIED TECHNOLOGY COUNCIL, 201 Redwood Shores Parkway, Suite 240, Redwood City, California 94065, prepared for U.S. DEPARTMENT OF HOMELAND SECURITY (DHS) FEDERAL EMERGENCY MANAGEMENT AGENCY
  • Use of Mobile Phones as Intelligent Sensors for Sound Input Analysis and Sleep State Detection, Ondrej Krejcar, Jakub Jirka, Dalibor Janckulik, Sensors 2011, 11, 6037-6055, ISSN 1424-8220, 2011
  • Design of a Wireless Acquisition System for a Digital Stethoscope, Bachelor Thesis, Justin Miller, Faculty of Engineering & Surveying, University of Southern Queensland, ENG4112 Research Project, 2010
  • Konzeption und Umsetzung einer RIA zur untersuchungsbegleitenden Erfassung von RNFLT-Scans und Untersuchung von Klassifikatoren für die diagnostische Unterstützung bei neurodegenerativen Erkrankungen am Beispiel der Multiplen Sklerose, Diplomarbeit, Sebastian Bischoff, Fachbereich Informatik und Medien, Fachhochschule Brandenburg, 1.11.2009
  • Ka`imiolakai ROV, Team Limawa, Kapi´olani Community College
  • Prototipo de una aplicación informática para gestión y mantenimiento de recursos pesquero, Silvia Rodríguez Rodríguez, José Juan Castro Hernández, 2010

University Course Work

  • Uni Muenster, Computer Vision und Mustererkennung (SS 2011)

Updated Wiki: References

$
0
0

References - Math.NET in the wild

On this page we try to collect an excerpt of the "social" graph of the Math.NET Numerics project. What other code or projects contributed in some way to Math.NET? Where is it used in the wild?

Direct Contributions

Maintainers

Contributors

Indirect Contributions and Inspiration

Contributors via dnAnalytics and Math.NET Iridium (both merged into Numerics)

  • Patrick van der Valde
  • Joannès Vermorel
  • Matthew Kitchin
  • Rana Ian
  • Andrew Kurochka
  • Thaddaeus Parker

Contributors via other opensource projects

  • ALGLIB by Sergey Bochkanov (with permission before license changed - thanks!)
  • Boost by John Maddock
  • Cephes Math Library by Stephen L. Moshier

Where Math.NET is used

Excerpt of some projects and works where Math.NET is used or referenced today, or has been in the past. Please let us know if you'd like your work listed here as well, or if you'd prefer we remove it.

Opensource Projects and Code Snippets

Articles & Tutorials

Thesis & Papers

TODO: find links, verify
  • Detecting falls and poses in image silhouettes, Master's Thesis in Complex Adaptive Systems, Niklas Schräder, Chalmers University of Technology, Gothenburg, Sweden, 2011
  • SoundLog, Master's Thesis in Information and Software Engineering, André Filipe Mateus Ferreira, Instituto Superior Técnico, Universidade Técnica de Lisboa
  • ACCELEROMETERS USABILITY FOR DANGER TILT OFF-HIGHWAY VEHICLES AND SIGNAL FILTRATION WITH KALMAN FILTER, Ondrej LÍŠKA, Kamil ŽIDEK, Technical University of Kosice, SjF, Department of biomedical engineering automation and measuring, Journal of applied science in the thermodynamics and fluid mechanics Vol. 4, No. 2/2010, ISSN 1802-9388
  • Fast evaluation of Greeks in Monte Carlo calculations with the Adjoint Method, Bachelor Thesis, Ivan Kuliš, Fachbereich Informatik und Mathematik, Institut für Mathematik, Johann Wolfgang Goethe Universität, Frankfurt am Main, 14.09.2011
  • 3DMapping for Robotic Search and Rescue, Peter Nelson, New College, 28 May 2011
  • Quantitative structure-property relationship modeling algorithms, challenges and IT solutions, Thesis, Ondrej Skrehota, FACULTY OF INFORMATIC, MASARYK UNIVERSITY, 2010
  • Seismic Performance Assessment of Buildings Volume 2 – Implementation Guide, ATC-58-1 75% Draft, APPLIED TECHNOLOGY COUNCIL, 201 Redwood Shores Parkway, Suite 240, Redwood City, California 94065, prepared for U.S. DEPARTMENT OF HOMELAND SECURITY (DHS) FEDERAL EMERGENCY MANAGEMENT AGENCY
  • Use of Mobile Phones as Intelligent Sensors for Sound Input Analysis and Sleep State Detection, Ondrej Krejcar, Jakub Jirka, Dalibor Janckulik, Sensors 2011, 11, 6037-6055, ISSN 1424-8220, 2011
  • Design of a Wireless Acquisition System for a Digital Stethoscope, Bachelor Thesis, Justin Miller, Faculty of Engineering & Surveying, University of Southern Queensland, ENG4112 Research Project, 2010
  • Konzeption und Umsetzung einer RIA zur untersuchungsbegleitenden Erfassung von RNFLT-Scans und Untersuchung von Klassifikatoren für die diagnostische Unterstützung bei neurodegenerativen Erkrankungen am Beispiel der Multiplen Sklerose, Diplomarbeit, Sebastian Bischoff, Fachbereich Informatik und Medien, Fachhochschule Brandenburg, 1.11.2009
  • Ka`imiolakai ROV, Team Limawa, Kapi´olani Community College
  • Prototipo de una aplicación informática para gestión y mantenimiento de recursos pesquero, Silvia Rodríguez Rodríguez, José Juan Castro Hernández, 2010

University Course Work

  • Uni Muenster, Computer Vision und Mustererkennung (SS 2011)

Updated Wiki: References

$
0
0

References - Math.NET in the wild

On this page we try to collect an excerpt of the "social" graph of the Math.NET Numerics project. What other code or projects contributed in some way to Math.NET? Where is it used in the wild?

Direct Contributions

Maintainers

Contributors

Indirect Contributions and Inspiration

Contributors via dnAnalytics and Math.NET Iridium (both merged into Numerics)

  • Patrick van der Valde
  • Joannès Vermorel
  • Matthew Kitchin
  • Rana Ian
  • Andrew Kurochka
  • Thaddaeus Parker

Contributors via other opensource projects

  • ALGLIB by Sergey Bochkanov (with permission before license changed - thanks!)
  • Boost by John Maddock
  • Cephes Math Library by Stephen L. Moshier

Where Math.NET is used

Excerpt of some projects and works where Math.NET is used or referenced today, or has been in the past. Please let us know if you'd like your work listed here as well, or if you'd prefer we remove it.

Opensource Projects and Code Snippets

Articles & Tutorials

Thesis & Papers

TODO: find links, verify
  • Detecting falls and poses in image silhouettes, Master's Thesis in Complex Adaptive Systems, Niklas Schräder, Chalmers University of Technology, Gothenburg, Sweden, 2011
  • SoundLog, Master's Thesis in Information and Software Engineering, André Filipe Mateus Ferreira, Instituto Superior Técnico, Universidade Técnica de Lisboa
  • ACCELEROMETERS USABILITY FOR DANGER TILT OFF-HIGHWAY VEHICLES AND SIGNAL FILTRATION WITH KALMAN FILTER, Ondrej LÍŠKA, Kamil ŽIDEK, Technical University of Kosice, SjF, Department of biomedical engineering automation and measuring, Journal of applied science in the thermodynamics and fluid mechanics Vol. 4, No. 2/2010, ISSN 1802-9388
  • Fast evaluation of Greeks in Monte Carlo calculations with the Adjoint Method, Bachelor Thesis, Ivan Kuliš, Fachbereich Informatik und Mathematik, Institut für Mathematik, Johann Wolfgang Goethe Universität, Frankfurt am Main, 14.09.2011
  • 3DMapping for Robotic Search and Rescue, Peter Nelson, New College, 28 May 2011
  • Quantitative structure-property relationship modeling algorithms, challenges and IT solutions, Thesis, Ondrej Skrehota, FACULTY OF INFORMATIC, MASARYK UNIVERSITY, 2010
  • Seismic Performance Assessment of Buildings Volume 2 – Implementation Guide, ATC-58-1 75% Draft, APPLIED TECHNOLOGY COUNCIL, 201 Redwood Shores Parkway, Suite 240, Redwood City, California 94065, prepared for U.S. DEPARTMENT OF HOMELAND SECURITY (DHS) FEDERAL EMERGENCY MANAGEMENT AGENCY
  • Use of Mobile Phones as Intelligent Sensors for Sound Input Analysis and Sleep State Detection, Ondrej Krejcar, Jakub Jirka, Dalibor Janckulik, Sensors 2011, 11, 6037-6055, ISSN 1424-8220, 2011
  • Design of a Wireless Acquisition System for a Digital Stethoscope, Bachelor Thesis, Justin Miller, Faculty of Engineering & Surveying, University of Southern Queensland, ENG4112 Research Project, 2010
  • Konzeption und Umsetzung einer RIA zur untersuchungsbegleitenden Erfassung von RNFLT-Scans und Untersuchung von Klassifikatoren für die diagnostische Unterstützung bei neurodegenerativen Erkrankungen am Beispiel der Multiplen Sklerose, Diplomarbeit, Sebastian Bischoff, Fachbereich Informatik und Medien, Fachhochschule Brandenburg, 1.11.2009
  • Ka`imiolakai ROV, Team Limawa, Kapi´olani Community College
  • Prototipo de una aplicación informática para gestión y mantenimiento de recursos pesquero, Silvia Rodríguez Rodríguez, José Juan Castro Hernández, 2010

University Course Work

  • Uni Muenster, Computer Vision und Mustererkennung (SS 2011)
Viewing all 88 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>