forum.alglib.net
http://forum.alglib.net/

nleq with C# for nonlinear equations
http://forum.alglib.net/viewtopic.php?f=2&t=390
Page 1 of 1

Author:  Doug Jenkins [ Thu Jun 16, 2011 10:54 pm ]
Post subject:  Re: nleq with C#

Quote:
Since I can only give one value back at a time to Excel


You don't say how you are communicating between Excel and C#, but it is possible to return an array to Excel.

in VBA: Range("XLRange").Value = CSArray

Where CSArray is any array, and XLRange is a range address or range name with the same dimensions.

Author:  Doug Jenkins [ Sun Jun 19, 2011 1:13 am ]
Post subject:  Re: nleq with C# for nonlinear equations

Student - I haven't used Excel DNA, so I can't give any specifics, but I'm sure it's possible to return three values to Excel without runing the Alglib function three times. If your Excel routine is written as a sub you should be able to just write the values to the spreadsheet. If it is written as a user defined function you will need to return the values as a variant array, which can be entered as an array function, or you could use the Index function to access the values in the array.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/