forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 7:39 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  [ 6 posts ] 
Author Message
 Post subject: vdotproduct in C# not implemented?
PostPosted: Tue Oct 25, 2011 6:14 pm 
Offline

Joined: Tue Oct 25, 2011 6:06 pm
Posts: 5
I've downloaded the alglib-3.4.0.csharp, but not able to find the vdotproduct function under alglib.

btw, I can see functions like rmatrixmv or rmatrixgemm.


Top
 Profile  
 
 Post subject: Re: vdotproduct in C# not implemented?
PostPosted: Tue Oct 25, 2011 7:41 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Yes, these functions (vdot/vmove/...) are C++ specific. They all are pointer-based, and you can't work with pointer from C#.

The idea is that there are two layers in ALGLIB - basic functions, which are language-specific (some functions can be used from C#, some from C++), and high-level functions which are 100% same in all languages.


Top
 Profile  
 
 Post subject: Re: vdotproduct in C# not implemented?
PostPosted: Tue Oct 25, 2011 8:02 pm 
Offline

Joined: Tue Oct 25, 2011 6:06 pm
Posts: 5
Thanks for the reply, Sergey.

AlgLib is great and I am gradually replacing our current math/stat implementation with this package. However simple manipulations such as dot product missing makes the transition incompletable. It would be nice to have this very basic operation in other language too - considering it already has other 'more complicated' operators in C#, such as matrix vector multiplications...


Top
 Profile  
 
 Post subject: Re: vdotproduct in C# not implemented?
PostPosted: Wed Oct 26, 2011 5:53 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Hmm, it would be good, but... do you have any idea how to implement dot product in C#, so it will work with both 1- and 2-dimensional rectangular arrays?

The problem is that in C++ you can just get pointer to a matrix row and pass it to the vdotproduct. And if you want to work with column, you can pass pointer to column with non-unit stride (step) equal to N. So you can handle both matrices and vectors within one function. But you can't do such things in C#. The only solution is to have many overloaded versions of vdotproduct: vdotproduct(array[,],array[]), vdotproduct(array[],array[]), ... And many overloads for other functions. Another solution is to use pointers (C# supports them), but it will make ALGLIB code unsafe.

Do you have any idea how to solve this issue? It is not rhetoric question :) I'd be glad to hear any suggestions.


Top
 Profile  
 
 Post subject: Re: vdotproduct in C# not implemented?
PostPosted: Wed Oct 26, 2011 6:43 pm 
Offline

Joined: Tue Oct 25, 2011 6:06 pm
Posts: 5
I just went through the cpp files, and yes, same thing can not be done in c#, at least I don't know:p Overloading in c# sounds like the correct implimentation, but i am not sure how annoying it will be for you since the codes are automatically generated. anyway, thanks for the good work!


Top
 Profile  
 
 Post subject: Re: vdotproduct in C# not implemented?
PostPosted: Thu Oct 27, 2011 5:56 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Now, when you popped up this issue, I begin to think that we may have to use overloading. In any case, this work (many overloaded versions of the same function) has to be done only once, so it may be worth the effort. I have to think on it for a day or two before coming up with decision :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 42 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