Exemplo n.º 1
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zhsein( lapack_complex_double *w, lapack_complex_double *w_i,
                           lapack_complex_double *vl,
                           lapack_complex_double *vl_i,
                           lapack_complex_double *vr,
                           lapack_complex_double *vr_i, lapack_int m,
                           lapack_int m_i, lapack_int *ifaill,
                           lapack_int *ifaill_i, lapack_int *ifailr,
                           lapack_int *ifailr_i, lapack_int info,
                           lapack_int info_i, char job, lapack_int ldvl,
                           lapack_int ldvr, lapack_int mm, lapack_int n )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < n; i++ ) {
        failed += compare_complex_doubles(w[i],w_i[i]);
    }
    if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'l' ) ) {
        for( i = 0; i < ldvl*mm; i++ ) {
            failed += compare_complex_doubles(vl[i],vl_i[i]);
        }
    }
    if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'r' ) ) {
        for( i = 0; i < ldvr*mm; i++ ) {
            failed += compare_complex_doubles(vr[i],vr_i[i]);
        }
    }
    failed += (m == m_i) ? 0 : 1;
    if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'l' ) ) {
        for( i = 0; i < mm; i++ ) {
            failed += (ifaill[i] == ifaill_i[i]) ? 0 : 1;
        }
    }
    if( LAPACKE_lsame( job, 'b' ) || LAPACKE_lsame( job, 'r' ) ) {
        for( i = 0; i < mm; i++ ) {
            failed += (ifailr[i] == ifailr_i[i]) ? 0 : 1;
        }
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 2
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zgeqrf( lapack_complex_double *a, lapack_complex_double *a_i,
                           lapack_complex_double *tau,
                           lapack_complex_double *tau_i, lapack_int info,
                           lapack_int info_i, lapack_int lda, lapack_int m,
                           lapack_int n )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < lda*n; i++ ) {
        failed += compare_complex_doubles(a[i],a_i[i]);
    }
    for( i = 0; i < (MIN(m,n)); i++ ) {
        failed += compare_complex_doubles(tau[i],tau_i[i]);
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 3
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_ztrexc( lapack_complex_double *t, lapack_complex_double *t_i,
                           lapack_complex_double *q, lapack_complex_double *q_i,
                           lapack_int info, lapack_int info_i, char compq,
                           lapack_int ldq, lapack_int ldt, lapack_int n )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < ldt*n; i++ ) {
        failed += compare_complex_doubles(t[i],t_i[i]);
    }
    if( LAPACKE_lsame( compq, 'v' ) ) {
        for( i = 0; i < ldq*n; i++ ) {
            failed += compare_complex_doubles(q[i],q_i[i]);
        }
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 4
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zunmhr( lapack_complex_double *c, lapack_complex_double *c_i,
                           lapack_int info, lapack_int info_i, lapack_int ldc,
                           lapack_int n )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < ldc*n; i++ ) {
        failed += compare_complex_doubles(c[i],c_i[i]);
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 5
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zhptri( lapack_complex_double *ap,
                           lapack_complex_double *ap_i, lapack_int info,
                           lapack_int info_i, lapack_int n )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < (n*(n+1)/2); i++ ) {
        failed += compare_complex_doubles(ap[i],ap_i[i]);
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 6
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zhptrs( lapack_complex_double *b, lapack_complex_double *b_i,
                           lapack_int info, lapack_int info_i, lapack_int ldb,
                           lapack_int nrhs )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < ldb*nrhs; i++ ) {
        failed += compare_complex_doubles(b[i],b_i[i]);
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 7
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zgebak( lapack_complex_double *v, lapack_complex_double *v_i,
                           lapack_int info, lapack_int info_i, lapack_int ldv,
                           lapack_int m )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < ldv*m; i++ ) {
        failed += compare_complex_doubles(v[i],v_i[i]);
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 8
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zhetrf( lapack_complex_double *a, lapack_complex_double *a_i,
                           lapack_int *ipiv, lapack_int *ipiv_i,
                           lapack_int info, lapack_int info_i, lapack_int lda,
                           lapack_int n )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < lda*n; i++ ) {
        failed += compare_complex_doubles(a[i],a_i[i]);
    }
    for( i = 0; i < n; i++ ) {
        failed += (ipiv[i] == ipiv_i[i]) ? 0 : 1;
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}
Exemplo n.º 9
0
/* Return value: 0 - test is passed, non-zero - test is failed */
static int compare_zporfs( lapack_complex_double *x, lapack_complex_double *x_i,
                           double *ferr, double *ferr_i, double *berr,
                           double *berr_i, lapack_int info, lapack_int info_i,
                           lapack_int ldx, lapack_int nrhs )
{
    lapack_int i;
    int failed = 0;
    for( i = 0; i < ldx*nrhs; i++ ) {
        failed += compare_complex_doubles(x[i],x_i[i]);
    }
    for( i = 0; i < nrhs; i++ ) {
        failed += compare_doubles(ferr[i],ferr_i[i]);
    }
    for( i = 0; i < nrhs; i++ ) {
        failed += compare_doubles(berr[i],berr_i[i]);
    }
    failed += (info == info_i) ? 0 : 1;
    if( info != 0 || info_i != 0 ) {
        printf( "info=%d, info_i=%d\n",(int)info,(int)info_i );
    }

    return failed;
}