twkie wrote:
As examples of 'C' only development environments:
Here's the link to the CUDA development page.
http://developer.nvidia.com/object/gpucomputing.htmlThis is the link to FPGA development.
http://www.directinsight.co.uk/products ... loper.htmlI've heard of CUDA. But, unfortunately, it has a lot of limitations, one of the biggests is "no recursion" rule. I think that it is impossible to use "general" library on CUDA, i.e. anyone has to reimplement wheel one more time, now in CUDA fashion. I've expected more from Intel Larrabee, but it is unclear when Intel will introduce it to market.
twkie wrote:
BTW, are you planning to put in some pseudo random number generator?
....
Also, have you looked at the Sandia's optimizer?
https://share.sandia.gov/news/resources ... /acro.html.
Thanks for the suggestions, I'll add them to issues tracker. I've always been interested in taking input from users.
As for my plans, in the near future I want to:
* add more optimization algorithms (optimization with general constraints, preconditioned optimization)
* add more interpolation/fitting algorithms (constrained Levenberg-Marquardt fitting, 2/3-dimensional interpolation/fitting)
* add support for parallel computations
* make better use of SSE instructions and low level assembly in general
I've already thought about pseudo-random numbers, although no specific algorithms were planned. But I think that such functionality will wait for the middle of 2011.
twkie wrote:
With plain C code - I make it a point NEVER to dynamically (re)allocate memory within core numerical code.
....
In this way, I can control memory usage (very critical) in some applications, and I can reuse memory for repeated calls etc. I work with very time critical/sensitive systems and I ensure, whenever possible, that dynamically allocated memory is all reserved at the start up and no spurious allocation/deallocation is performed during runs.
You have a point here. But it is impossible to completely avoid dynamic memory allocation by ALGLIB internals. ALGLIB is designed in such a way that it may allocate some memory inside solver (or another complex algorithm) and it is impossible to tell in advance how much memory it will need. It is not good decision to pass "large enough temporary array" for temporary allocations, because: 1) it is hard to tell what size is "large enough", and 2) it is hard to distinguish temporary allocations from non-temporary ones. Package have to be completely reimplemented in order to solve these problems.
twkie wrote:
If you use the ae_matrix, and some simple accessor functions like double *ae_at(ae_matrix, unsigned int, unsigned int) that looks in there and provides access, you can almost do a find/replace.
What do you think about another solution? Some "interface" matrix type, which will be mediator between user-allocated arrays and ALGLIB-manages arrays:
Code:
struct ae_interface_matrix
{
double **pp_items;
int rows, cols;
};
ae_interface_matrix matrix_from_pointer(double **, int rows, int cols);
....
double a[10][10];
int p[10];
alglib_rmatrixlu(matrix_from_pdouble(&a[0][0],10,10), 10, 10, vector_from_pint(p,10));
This type will represent user-managed array with additional information about size. It will be created before calls to ALGLIB functions, passed by value, but it will be lightweight, so I hope that performance penalty won't be too high. Benefits are: 1) no need to allocate/free ALGLIB-managed arrays (although complex structures still need alloc/free calls), arrays are managed by user alone, and 2) ability to check that user passed array which is large enough (i.e. to handle situation when we want to return 10 elements, and array has place only for 9 of them).
What do you think about such a solution?