30 Sep 09:06
C API: accessing to the elements of an array
From: Felip Alàez Nadal <uu.nix.uu <at> gmail.com>
Subject: C API: accessing to the elements of an array
Newsgroups: gmane.comp.lang.pike.user
Date: 2008-09-30 07:08:33 GMT
Subject: C API: accessing to the elements of an array
Newsgroups: gmane.comp.lang.pike.user
Date: 2008-09-30 07:08:33 GMT
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
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
RSS Feed