Felip Alàez Nadal | 30 Sep 09:06

C API: accessing to the elements of an array

Hello:

I'm adding a solveLinearEquations method to Math.Matrix, writting new code in matrix_code.h. There's something I don't know how to do.

Well, from inside solveLinearEquations I call the method which does the LU decompositon, by typing

static void solveLinearEquations ( INT32 args )
{
//SOme code to access to the parameters

matrixX(_lu) (0 ); // the lu decomposition doesn't need any parameters

//Here I need something to access to the elements of the array which matrixX(_lu) returns into pike.


//More code which solve the equations system
}

The matrixX(_lu) method pushes an array with for elements into the stack calling something similar to

push_object( L);
 push_object ( U);
 push_object ( Permutations );
 push_int ( Sign );
 f_aggregate (4); /* Make an array of the 4 top elements on the stack. */

Now I want to access those elements from solveLinearEquations in order to use the L and U matrices to solve a linear equations system. How can I "unaggregate" those elements, or pop the complete array and access Its individual elements?

Thanks you.

--
Felip Alàez Nadal

Gmane