T O P I C R E V I E W |
Frank_H |
Posted - 04/03/2006 : 1:09:53 PM Origin Version (Select Help-->About Origin): 7.5 SR6 Operating System: XP
Dear all
I want to use some routines from the NAG library. The problem is that the NAG functions are not prototyped to use matrix or vector but instead always use 1d arrays like double[]. I would expect that within the matrix or the vector object there is such an array, but I did not find any method which would allow me to get an appropiate pointer. But there has to be a better method than a nested loop copying each entry into a new array before calling the NAG function. Any ideas how to do it more efficiently and even better perhaps without creating an unnecessary copy of the data?
Cheers, Frank
|
4 L A T E S T R E P L I E S (Newest First) |
easwar |
Posted - 04/07/2006 : 09:05:03 AM Dear Frank,
Thanks for the additional comments. We will look into improving this in the next version.
Easwar OriginLab
|
Frank_H |
Posted - 04/07/2006 : 05:34:46 AM Dear Easwar
Thanks for pointing that out - I overlooked that part of the manual. One suggestion: Is it possible to add a small introduction also to the section level of Origin C Language Reference->Global Functions->NAG Functions (similar to the ones for the object reference) which then also could contain a hyperlink to the chapter in the Programming Guide? Also usefull would be a kind of index to the NAG pdfs or perhaps for the help entry of each NAG function a reference to the full name of the NAG pdf file - the names of the pdf files are a bit cryptic :-)
Cheers, Frank
|
easwar |
Posted - 04/06/2006 : 09:03:48 AM quote:
Origin developers, please add a brief introduction on using the NAG library into the help file which explains these possibility (and any limitations if present).
Dear Frank,
Thanks for the suggestion. We have a section in the Programming help file on calling NAG library, under the Programming Guide chapter, and we will work on adding more info to this section in the next version.
Easwar OriginLab
|
Frank_H |
Posted - 04/03/2006 : 1:19:57 PM I admit, I am guilty of not searching carefully enough: The solution is already in the forum http://www.originlab.com/forum/topic.asp?TOPIC_ID=1929 The following code was posted by easwar
void test_nag_real_lin_eqn() { int n = 3; matrix a = { {33, 16, 72}, {-24, -10, -57}, {-8, -4, -17} }; vector b = {-359, 281, 85}; vector x(3); nag_real_lin_eqn(n, a, n, b, x); printf("Solution\n"); for (int i=0; i<n; i++) printf("%9.4f\n",x[i]); }
So I can directly plug my matrix and vector into the NAG functions. Origin developers, please add a brief introduction on using the NAG library into the help file which explains these possibility (and any limitations if present).
Cheers, Frank
|
|
|