forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 7:48 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Thu May 20, 2010 3:28 am 
Offline

Joined: Thu May 20, 2010 3:20 am
Posts: 3
Hello,

ALGLIB looks very useful, and I would like to try it out with Microsoft Visual Studio and VB.NET. So I downloaded the C# version, thinking that I would set up a class library in C# that I could easily call from VB.NET. I was confused by the instructions regarding the .bat files. Is there a straight forward way of creating a class library in Microsoft Visual Studio that contains all of the ALGLIB subroutines?

Thank you for making what appears to be great code available to all,

Dylan


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Thu May 20, 2010 4:18 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Yes, you just have to add all *.cs files from /src directory to your project. However, there are 101 files in this directory. You may try either to pick what you need from them or to compile assembly by calling "build.bat csc" and to attach it to your project.


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Thu May 20, 2010 4:20 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
BTW, I am considering making one big alglib.cs from all units, so there will be just one file instead of 100+. Do you think it will be better than current situation?


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Thu May 20, 2010 3:38 pm 
Offline

Joined: Thu May 20, 2010 3:20 am
Posts: 3
Dear Sergey,

I think that the best way to do this is to create a single file in the form of a "class library." This allows other programs in Microsoft Visual Studio to call any of the subroutines in ALGLIB without actually having to load them into the program.

Best regards,

Dylan


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Sat May 22, 2010 1:11 pm 
Offline

Joined: Sun May 16, 2010 11:42 pm
Posts: 63
Dylan - I have just posted on my blog about linking Excel VBA to C++ using Microsoftg Visual Studio, which you might find useful:

http://newtonexcelbach.wordpress.com/20 ... excel-vba/

_________________
Doug Jenkins
http://newtonexcelbach.wordpress.com/


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Fri Jun 18, 2010 8:58 pm 
Offline

Joined: Fri Jun 18, 2010 7:17 pm
Posts: 4
Hi,
I think multiple files are fine. From a user standpoint, you can set up the class project such that when you compile, it produces 1 dll file in which you can refer from other project. I think what you set up now is very useful and easy to locate from the name of the file. It would probably need more documentation if you move everything into one single huge source file. Just my humble opinion.


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Sun Jun 20, 2010 12:01 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Quote:
From a user standpoint, you can set up the class project such that when you compile, it produces 1 dll file in which you can refer from other project.

Making Visual Studio project requires additional manual step in the ALGLIB release creation, so I don't think that I'll add something like that. There are exists tools like CMake which can generate Visual Studio project files. But as far as I know CMake doesn't support C# :(

Quote:
It would probably need more documentation if you move everything into one single huge source file. Just my humble opinion.

Original poster said about precompiled DLL distributed with ALGLIB source files, but I think that idea of one large .cs file has at least one benefit - it is much more easier to add to user's project. From the other side, alglib.cs will be about 3 Mbytes large. Such big file may be hard to debug or just to study.


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Wed Jun 23, 2010 10:53 pm 
Offline

Joined: Thu May 20, 2010 3:20 am
Posts: 3
I still think that a properly set up class library would be easier to use, even if it is large. Especially for those of us that are not expert in how to set these things up ourselves.


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Thu Jun 24, 2010 11:22 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Dylan Williams wrote:
I still think that a properly set up class library would be easier to use, even if it is large. Especially for those of us that are not expert in how to set these things up ourselves.

When you talk about class library you mean Visual Studio project shipped with ALGLIB which can be compiled to produce class library?


Top
 Profile  
 
 Post subject: Re: How to use ALGLIB with C# and Microsoft Visual Studio
PostPosted: Sat Oct 22, 2011 1:47 am 
Offline

Joined: Fri Oct 21, 2011 12:59 pm
Posts: 3
I tried to use interpolation file and FFT , with visual studio C# , but I got error says that COMPLEX name space id missing or not defined . How may I solve this ... thanks


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 29 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group