Commit a7de3793 authored by Patrick Godwin's avatar Patrick Godwin
Browse files

gstlal_matrixmixer.c: fix incorrect mixing for complex data types, prevent lock-ups for N to 1 case

parent e5866b4f
Pipeline #202562 failed with stages
in 3 minutes and 13 seconds
......@@ -170,11 +170,9 @@ static int num_output_channels(const GSTLALMatrixMixer *element, enum gstlal_mat
switch(data_type) {
case GSTLAL_MATRIXMIXER_FLOAT:
case GSTLAL_MATRIXMIXER_DOUBLE:
return element->mixmatrix_d->size2;
case GSTLAL_MATRIXMIXER_COMPLEX_FLOAT:
case GSTLAL_MATRIXMIXER_COMPLEX_DOUBLE:
return element->mixmatrix_d->size2 / 2;
return element->mixmatrix_d->size2;
default:
g_assert_not_reached();
......@@ -515,10 +513,8 @@ static void set_property(GObject *object, enum property prop_id, const GValue *v
for(i = 0; i < element->mixmatrix_d->size1; i++) for(j = 0; j < element->mixmatrix_d->size2; j++)
gsl_matrix_float_set(element->mixmatrix_s, i, j, gsl_matrix_get(element->mixmatrix_d, i, j));
}
if(element->mixmatrix_d->size2 >= 2) {
element->mixmatrix_cd = gsl_matrix_complex_view_array(element->mixmatrix_d->data, element->mixmatrix_d->size1, element->mixmatrix_d->size2 / 2);
element->mixmatrix_cs = gsl_matrix_complex_float_view_array(element->mixmatrix_s->data, element->mixmatrix_s->size1, element->mixmatrix_s->size2 / 2);
}
element->mixmatrix_cd = gsl_matrix_complex_view_array(element->mixmatrix_d->data, element->mixmatrix_d->size1, element->mixmatrix_d->size2);
element->mixmatrix_cs = gsl_matrix_complex_float_view_array(element->mixmatrix_s->data, element->mixmatrix_s->size1, element->mixmatrix_s->size2);
/*
* if the number of channels has changed, force a caps
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment