Code incorrectly nested in sineresponse.cc
The transfer matrix calculation iterates over the elements of two matrices, A and B. The iteration over columns of the B matrix is nested inside the iteration over columns of the A matrix. So for each element of the A matrix, a full row of the B matrix is computed again and again. (This doesn't affect the result, but is wasteful and confusing to read.)