0

What sort of mathematics do you use in your .NET application, excluding everything that's in System.Math?

I think that System.Math is woefully inadequate. For example, in several official .NET frameworks, I can count three different implementations of matrices. The same goes for vectors. One implementation of a complex number; several different implementations of arbitrary rational numbers, and so on.

So, what would you like to see in a hypothetical System.Mathematics namespace?

JasonMArcher
  • 14,195
  • 22
  • 56
  • 52
TraumaPony
  • 10,742
  • 12
  • 54
  • 74

5 Answers5

4

Here is what I use:

  • Numerical integrals
  • Numerical derivatives
  • FFTs
  • Matrices
  • Vectors
  • Complex numbers
  • Geometric types such as polygons, spheres, toroids, etc
  • Gaussian distributions
  • Navier-Stokes equations
  • DSP filters
  • Symbolic algebra
  • Quaternions
  • Optimisation
  • Ordinary Differential Equations and ODE solvers
  • Likewise for PDEs
TraumaPony
  • 10,742
  • 12
  • 54
  • 74
  • How many programmers would use advanced maths like this day to day? – Jonathan Webb Oct 21 '08 at 08:53
  • Well, complex numbers/matrices/vectors/Gaussian distributions aren't exactly 'advanced'... – TraumaPony Oct 21 '08 at 09:53
  • They are pretty advanced for most applications, and once they are used they should be very high performant. Every bank I've worked at have implemented their own maths library since the quantitative analysts want "their own" algorithm. – Mats Fredriksson Oct 21 '08 at 10:17
  • Yes, some are pretty advanced... But you could argue that for CodeDOM or Reflection.Emit. Microsoft already has implemented a lot of these several times; they should be implemented once and for all in a dedicated namespace. – TraumaPony Oct 21 '08 at 10:50
  • Oh my God, FFT, DSP filters and Quaternions! I barely scratch the surface of those topics -- You gotta love math! – Camilo Martin Mar 26 '10 at 03:27
2

I rarely need anything outside of basic 'accounting math'.

Craig
  • 36,306
  • 34
  • 114
  • 197
1

Generics support (since C# 3.0 doesn't allow use of generics and operators), like here.

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900
  • I actually made a library to do that. It creates an expression tree for each type, which adds the two inputs together, and compiles that to a delegate; it caches that delegate and then calls it. I made it an extension method of object, so you can do something like var z = x.Add(y);. – TraumaPony Oct 21 '08 at 08:36
  • Yes, me too ;-p It sits in Jon's MiscUtil library, courtesy of the Operator class. – Marc Gravell Oct 21 '08 at 09:09
0

Expression evaluation like that in Flee or Dotmath (see here and here)

Community
  • 1
  • 1
John Sheehan
  • 77,456
  • 30
  • 160
  • 194
0

Check http://msdn.microsoft.com/en-us/vcsharp/aa336740.aspx

Under the Math there are some links to some libraries for C#

João Augusto
  • 2,285
  • 24
  • 28