Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

Problem with Math.Elementwise class in V3.3.0 ... .Add method shows as having 2474 overloads. #319

Closed
rpmSportsAnalytics opened this issue Oct 8, 2016 · 3 comments

Comments

@rpmSportsAnalytics
Copy link

When I try to use the Elementwise.Add method to replace the deprecated Matrix.Add method Visual Studio freezes while trying to auto-complete the .Add method. As a test, I also tried to use the Elementwise.Subtract method and the same thing happens. After a very long delay I can proceed to add the function parameters. The problem appears to be associated with the following:

... the Elementwise.Add method shows as having 2474 overloads!

I am using VS 2015, .net 4.6.1 and Accord 3.3.0.

@rpmSportsAnalytics rpmSportsAnalytics changed the title Problem with Math.Elementwise class in V3.3.0 ... shows as having 2474 overloads. Problem with Math.Elementwise class in V3.3.0 ... .Add method shows as having 2474 overloads. Oct 8, 2016
@cesarsouza
Copy link
Member

cesarsouza commented Oct 12, 2016

Hi there,

Thanks for opening the issue. Indeed, it seems there are far too many overloads for the Elementwise functions right now... They were being automatically created by T4 templates in order to provide implementations for most C# numerical types, as unfortunately this cannot be done using generic parameters right now (i.e. dotnet/roslyn#2147, dotnet/roslyn#3255, dotnet/roslyn#3391).

However, it should be possible to cut the number of overloads at least by half by removing the overloads that do not include a 'result' parameter and making this parameter optional; as well as removing support for not-so-common types.

@hzawary
Copy link
Contributor

hzawary commented Nov 28, 2016

Ya, I have seen that the problem before :)

@cesarsouza
Copy link
Member

Hi everyone,

Thanks for the feedback regarding this issue. The number of overloads has been decreased in the latest releases; and also, it seems that VS2017 does a much better job at displaying all those overloads without much delay.

I will be closing this issue for now, but if anyone thinks this can still be a problem, please re-open it.

Regards,
Cesar

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

No branches or pull requests

3 participants