Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port the Rationals from the PowerPack #154

Closed
forki opened this issue Nov 23, 2012 · 17 comments
Closed

Port the Rationals from the PowerPack #154

forki opened this issue Nov 23, 2012 · 17 comments

Comments

@forki
Copy link
Member

forki commented Nov 23, 2012

We should port the Rationals to FSharpx.

It seems the PowerPack development has stopped.

@mausch what do you think?

@mausch
Copy link
Member

mausch commented Nov 23, 2012

Interesting... I think this implies merging PowerPack into FSharpx? Or am I reading too much into it? I'm not saying it's a bad thing, just trying to figure out the implications.

@funnelweb
Copy link
Contributor

See the discussion on the F# open source group,

https://groups.google.com/forum/?fromgroups=#!topic/fsharp-opensource/BRpOPujL4f0

Don Syme wrote a suggestion for which functionality to move into fsharpx. For "math" stuff he said:

FSharpx is not the natural home for a math library for F# and it's best not to confuse things and start down that direction. Instead organize that as a separate community project and keep the purpose of FSharpx clear. Much of the other math functionality has already been taken forward at http://mathprovider.codeplex.com/ and there is also Math.NET.

@funnelweb
Copy link
Contributor

I think the point is - if you're going to merge this code anywhere, then it should either be a new "F# math" project or be merged into Math.NET, which is the de-facto open source math library for .NET. It has a module specifically for F# support.

@ovatsus
Copy link

ovatsus commented Nov 23, 2012

The design of Math.NET is very different from the PowerPack math code. Personally, I prefer the matrix classes on Power Pack rather than the ones on Math.NET. It would probably make sense to either have a FSharpx.Math package, or create a new repository FMath or FsMath for it, as there is value there that isn't replaced by Math.NET

@ghost
Copy link

ghost commented Nov 23, 2012

I'd really encourage FSharpx not to go down this route. Math.NET looks like a better basis for open-source math programming on with F# on .NET than anything that FSharpx is going to produce. Do not make FSharpx a kitchen-sink for random bits of math functionality that don't add up to a convincing whole - if you do it will repeat the mistake we made with the power pack itself. Indeed, I recommend you just don't get into the "math library" game at all.

Focusing on core functional programming, functional collecctions, async, networking and type providers seems like a good remit for FSharpx. I think extending to math would be a bridge to far.

For the power pack Matrix/Vector types - as I understand it, Math.NET now allows the use of storage containers that use different matrix representations and storage (including native) as long as a basic set of operations (including some linear algebra) are defined on the storage. This may be a better route for progressing the power-pack matrix types - move them into the F# wrapper in Math.NET and hook them into the rest of the Math.NET functionality. If necessary, also wrap some other Math.NET functionality in F# window dressing.

Note we use Math.NET in Try F# 3,0, e.g. see here http://preview.tryfsharp.org/Courses?ID=4.

@ovatsus
Copy link

ovatsus commented Nov 23, 2012

Ok, putting math in FSharpx is probably not a good idea, but it would also be a shame if the existing work on powerpack math just dies. It would be nice to migrate it to a repository on github so it can be mantained by the community. Some things like defining pointwise operators can't be done on Math.Net because it's implemented in C# and operators can't be added on type extensions. Math.Net also doesn't have rational numbers.

@ovatsus
Copy link

ovatsus commented Nov 24, 2012

Sorry, ignore my last comment, powerpack is already on github.com/fsharp/powerpack

@7sharp9
Copy link
Member

7sharp9 commented Nov 27, 2012

I used the Matrix type from the Powerpack a while back and it was of better performance than one of the commercial offerings, so there is good stuff in there!

@nrolland
Copy link
Contributor

Apart from having a clear cohesive separation between libraries, the math.net guys have excellent ressources. Another reason to integrate smoothly with them and not bastardize fsharpx

@funnelweb
Copy link
Contributor

(FWIW "math.net" came up as a link in my email but is a spam site - the link is http://numerics.mathdotnet.com/ for those who need it)

@forki
Copy link
Member Author

forki commented Nov 28, 2012

I opened an issue in the mathnet-numerics project (mathnet/mathnet-numerics#60) so moving the discussion over to this project.

@ovatsus
Copy link

ovatsus commented Nov 30, 2012

@forki I'm trying to remove the PowerPack dependency (#165) by adding LazyList and the Async stuff, but the PowerPack is still needed by DistributionMonad because of BigRational. What do you suggest? Would it make sense to move it to Math.Net F#?

@ghost
Copy link

ghost commented Nov 30, 2012

If you follow my advice about "no math", then just remove the monad instance for BigRational :)

@ovatsus
Copy link

ovatsus commented Nov 30, 2012

I'm thinking of submiting a pull request to Math.Net to add the BigRational & Complex from PowerPack and DistributionMonad from FSharpx, but I'd like to hear @forki opinion first, I don't want to delete his work just like that

@ghost
Copy link

ghost commented Nov 30, 2012

Another option is to include BigRational and the DistributionMonad but immediately mark them [<Obsolete>].

@ovatsus
Copy link

ovatsus commented Nov 30, 2012

Sent pull request 172

@forki
Copy link
Member Author

forki commented Dec 1, 2012

You can move the DistributionMonad over. I'm ok with that.
The DistributionMonad is more a sample. I don't think it's that usefule since it's O(2^n)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants