GSL Error with for an "if ()" ???

A

Aleramo

I hope someone could say me where can i find the meaning of:

gsl: sinint.c:359: ERROR: domain error
Default GSL error handler invoked.
Aborted

or where i can find it.
I don't understand the meaning. I tried to find the error but it seems
inside an "if ()", and it's not a GSL instruction. The program was ok
since i addicted at the function:

if (fabs (j - j_esterno) == 1)
{
distanza_collinear = dist_adiacenti_collinear ;
}
else
{
distanza_collinear = (dist_adiacenti_collinear / fabs (j -
j_esterno)) + (lunghezza_dipolo / fabs (j_esterno - j - 1)) ;
}

Now the function is:


void onda_vert_piano_gp (gsl_matrix_complex *matrice_acc_dipoli,
gsl_vector *elementi_guasti_x, gsl_vector *elementi_guasti_y, int
guasti, int N, int M, int dist_adiacenti_side_by_side, int
dist_adiacenti_collinear, int lunghezza_dipolo, char *parassita)
{
int i, j, i_esterno, j_esterno, guasto = 0 ;
double distanza_collinear, distanza_side_by_side ;
gsl_complex accoppiamento, collinear_x, side_y ;

for (i_esterno = 0 ; i_esterno < M ; i_esterno++)
{
for (j_esterno = 0 ; j_esterno < N ; j_esterno++)
{
for (i = 0 ; i < M ; i++)
{
/* Lungo x sono collinear. */
// distanza_collinear = dist_adiacenti_collinear * fabs
(i_esterno - i) ;
distanza_side_by_side =
dist_adiacenti_side_by_side / fabs (i_esterno - i) ;
for (j = 0 ; j < N ; j++)
{
if ((i_esterno == i) && (j_esterno == j))
{
guasto = ricerca_guasto_piano
(elementi_guasti_x, elementi_guasti_y, guasti, i, j, i_esterno,
j_esterno) ;
if (guasto == 1)
{
if (strcmp (parassita, "ca") == 0)
{
GSL_SET_COMPLEX (&accoppiamento, 10e30,
0.0) ; /* Caso di ca. */
}
else
{
GSL_SET_COMPLEX (&accoppiamento, 0.0,
0.0) ; /* Caso di cc. */
}
guasto = 0 ;
}
else
{
auto_impedenza (&accoppiamento,
lunghezza_dipolo) ;
}
}
else
{
/* Lungo y sono side-by-side. */
if (fabs (j - j_esterno) == 1.0)
{
distanza_collinear = dist_adiacenti_collinear ;
}
else
{
distanza_collinear = (dist_adiacenti_collinear / fabs (j -
j_esterno)) + (lunghezza_dipolo / fabs (j_esterno - j - 1)) ;
}
guasto_piano_d_gp (distanza_collinear,
distanza_side_by_side, lunghezza_dipolo, &side_y, &collinear_x,
&accoppiamento) ;
}
gsl_matrix_complex_set (matrice_acc_dipoli, N *
i_esterno + j_esterno, N * i + j, accoppiamento) ;
}
}
}
}
}

Help Please!!!
 
B

Ben Pfaff

Aleramo said:
I hope someone could say me where can i find the meaning of:

gsl: sinint.c:359: ERROR: domain error
Default GSL error handler invoked.
Aborted

or where i can find it.

I would suggest asking questions about GSL in a GSL-specific
newsgroup. comp.lang.c is not a good place to ask.
 
M

Mark McIntyre

I hope someone could say me where can i find the meaning of:

gsl: sinint.c:359: ERROR: domain error
Default GSL error handler invoked.
Aborted

You are unlikely to get an answer in comp.lang.c, since GSL (whatever
that is ) is offtopic here. The domain error suggests you're either
dividing by zero, or overflowing a floating point value. Focus on
that, not the GSL message, since thats simply telling you that GSL
invoked its default error handler.
Mark McIntyre
 
T

TJW

Hello,

As others have mentioned, this is off-topic here. I have worked with the GNU
Scientific Library (GSL) some so I will make a comment that might help, but in
the future you might have better luck a GSL group.
gsl: sinint.c:359: ERROR: domain error
Default GSL error handler invoked.
Aborted

A quick look at lines 358-360 of file sinint.c reveals:
if(x <= 0.0) {
DOMAIN_ERROR(result);
}
This is in function int gsl_sf_Ci_e(const double x, gsl_sf_result * result);
which means that you are calling Ci(x) with x < 0, which is a domain error. As
I don't see a call to Ci(x) either explicitly or implicitly in the code you
posted, it seems that your error is elsewhere.

In case you deleted the GSL source or simply installed the packages, the
source for this function can be found here:
http://koders.com/c/fid5CD508768B20C663DA80E3ABF80E4373DD1F7E9F.aspx?s=Chebyshev

Good Luck,
TJW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,177
Messages
2,570,953
Members
47,507
Latest member
codeguru31

Latest Threads

Top