forum.alglib.net http://forum.alglib.net/ |
|
Setting up ALGLIB in C# solution http://forum.alglib.net/viewtopic.php?f=2&t=3944 |
Page 1 of 1 |
Author: | JonathanJohansen [ Wed Feb 20, 2019 3:54 am ] |
Post subject: | Setting up ALGLIB in C# solution |
Dear forum members, I'm a new C# developer who did applied maths at uni, and I would love to use ALGLIB in my C# project - but I can't get it to build. This is what I've done:
I have many questions about this:
|
Author: | Sergey.Bochkanov [ Thu Feb 21, 2019 1:05 pm ] |
Post subject: | Re: Setting up ALGLIB in C# solution |
Hi! 1) Can you elaborate on the specific errors reported at alglib_info.cs? It is very short .cs file, I simply do not know what can be wrong with it. 2) Generally, ALGLIB is expected to be simple to use. Either you compile .cs files (and they have to compile without additional changes) or you use precompiled assembly alglibnet2.dll. So, I'd be glad to hear what got wrong in your case in order to fix all possible issues. |
Author: | JonathanJohansen [ Wed Mar 06, 2019 11:06 pm ] | ||
Post subject: | Re: Setting up ALGLIB in C# solution | ||
To replicate this I created a Windows Console Project, C# .NET Framework 4.7.1 in Visual Studio Community 2017 Version 15.9.7. I created a small example project based on the above steps (example_minbleic_d_2) into a fresh .NET Framework Console project. I ran into two issues:
I now see what the problem is. If I make a new C# project and include all the AlgLib files (incl. alglib_info.cs) in a C# project, Visual Studio defines its own assembly info in Properties⇒AssemblyInfo.cs. That clashes with alglib_info.cs. I think this would be avoided if AlgLib distributed the C# with a VS project, or mentioned this in the documentation. I've attached the project (without some autogenerated stuff that should regenerate if you open the solution in Visual Studio) in a 7zip (had to to get it below 1MB) in case you want to refer to it. Code: alglib.minbleicoptguardsmoothness(state); alglib.minbleicoptguardgradient(state, 0.001); ... Code: alglib.optguardreport ogrep;
alglib.minbleicoptguardresults(state, out ogrep); System.Console.WriteLine("{0}", ogrep.badgradsuspected); // EXPECTED: false System.Console.WriteLine("{0}", ogrep.nonc0suspected); // EXPECTED: false System.Console.WriteLine("{0}", ogrep.nonc1suspected); // EXPECTED: false
|
Page 1 of 1 | All times are UTC |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |