Hi:
I need a way to keep the GUI alive while processing a EXTERNAL C routine:
Public Extern M8gauss(mfMatriz As Float[], vfX As Float[], vfTermns As
Float[], lOrder As Long) As Long
wich is a Gaussian ecuations system solver, and can take up to 10minutes
( 10^10 aritmetic operations).
Any help on doing this?
tnx in advance
I'll paste the actual C routine from the .SO
long M8gauss(double *matriz, double *x, double * ti, long n )
{
if(n == 0)return 1;
int i, i1, j, h, h1;
//long ok = -1;
//long contador = 0,i1,h1,h,i,j;
double c1;
// triangulacion
for (i = 0;i<n;i++)
{
i1=i*n;
if(matriz[i+i1] != 0)
{
for (j = (i + 1);j<n;j++)
{
if(matriz[j+i1] != 0)
{
c1 = -matriz[j+i1] / matriz[i+i1];
for(h = i; h<n ; h++)
{
h1=h*n;
matriz[j+h1] += c1 * matriz[i+h1];
}
ti[j] = ti[j] + c1 * ti[i];
}
}
}
else
// exit returning the position of 0 element
return i+i1;
}
// backward sustitucion
double p1;
x[n-1] = ti[n-1] / matriz[n* n-1];
for (i = n - 2;i>=0;i--)
{
p1 = 0;
for (j = i + 1;j<n;j++)
p1 += - x[j] * matriz[i+ j*n];
p1 += ti[i];
x[i] = p1 / matriz[i+i*n];
}
return -1;
}
------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable
security intelligence. It gives you real-time visual feedback on key
security issues and trends. Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user