libflame  revision_anchor
Functions
bli_free_saved_contigmsr.c File Reference

(r)

Functions

void bli_sfree_saved_contigmsr (side_t side, uplo_t uplo, int m, int n, float *a_save, int a_rs_save, int a_cs_save, float **a, int *a_rs, int *a_cs)
void bli_dfree_saved_contigmsr (side_t side, uplo_t uplo, int m, int n, double *a_save, int a_rs_save, int a_cs_save, double **a, int *a_rs, int *a_cs)
void bli_cfree_saved_contigmsr (side_t side, uplo_t uplo, int m, int n, scomplex *a_save, int a_rs_save, int a_cs_save, scomplex **a, int *a_rs, int *a_cs)
void bli_zfree_saved_contigmsr (side_t side, uplo_t uplo, int m, int n, dcomplex *a_save, int a_rs_save, int a_cs_save, dcomplex **a, int *a_rs, int *a_cs)

Function Documentation

void bli_cfree_saved_contigmsr ( side_t  side,
uplo_t  uplo,
int  m,
int  n,
scomplex a_save,
int  a_rs_save,
int  a_cs_save,
scomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bli_ccopymt(), bli_cfree(), bli_is_gen_storage(), and bli_is_left().

{
    int dim_a;

    // Choose the dimension of the matrix based on the side parameter.
    if ( bli_is_left( side ) ) dim_a = m;
    else                       dim_a = n;

    if ( bli_is_gen_storage( a_rs_save, a_cs_save ) )
    {
        // Copy the contents of the temporary matrix back to the original.
        bli_ccopymt( uplo,
                     dim_a,
                     dim_a,
                     *a,     *a_rs,     *a_cs,
                     a_save, a_rs_save, a_cs_save );

        // Free the temporary contiguous storage for the matrix.
        bli_cfree( *a );

        // Restore the original matrix address.
        *a = a_save;

        // Restore the original row and column strides.
        *a_rs = a_rs_save;
        *a_cs = a_cs_save;
    }
}
void bli_dfree_saved_contigmsr ( side_t  side,
uplo_t  uplo,
int  m,
int  n,
double *  a_save,
int  a_rs_save,
int  a_cs_save,
double **  a,
int *  a_rs,
int *  a_cs 
)

References bli_dcopymt(), bli_dfree(), bli_is_gen_storage(), and bli_is_left().

{
    int dim_a;

    // Choose the dimension of the matrix based on the side parameter.
    if ( bli_is_left( side ) ) dim_a = m;
    else                       dim_a = n;

    if ( bli_is_gen_storage( a_rs_save, a_cs_save ) )
    {
        // Copy the contents of the temporary matrix back to the original.
        bli_dcopymt( uplo,
                     dim_a,
                     dim_a,
                     *a,     *a_rs,     *a_cs,
                     a_save, a_rs_save, a_cs_save );

        // Free the temporary contiguous storage for the matrix.
        bli_dfree( *a );

        // Restore the original matrix address.
        *a = a_save;

        // Restore the original row and column strides.
        *a_rs = a_rs_save;
        *a_cs = a_cs_save;
    }
}
void bli_sfree_saved_contigmsr ( side_t  side,
uplo_t  uplo,
int  m,
int  n,
float *  a_save,
int  a_rs_save,
int  a_cs_save,
float **  a,
int *  a_rs,
int *  a_cs 
)

References bli_is_gen_storage(), bli_is_left(), bli_scopymt(), and bli_sfree().

{
    int dim_a;

    // Choose the dimension of the matrix based on the side parameter.
    if ( bli_is_left( side ) ) dim_a = m;
    else                       dim_a = n;

    if ( bli_is_gen_storage( a_rs_save, a_cs_save ) )
    {
        // Copy the contents of the temporary matrix back to the original.
        bli_scopymt( uplo,
                     dim_a,
                     dim_a,
                     *a,     *a_rs,     *a_cs,
                     a_save, a_rs_save, a_cs_save );

        // Free the temporary contiguous storage for the matrix.
        bli_sfree( *a );

        // Restore the original matrix address.
        *a = a_save;

        // Restore the original row and column strides.
        *a_rs = a_rs_save;
        *a_cs = a_cs_save;
    }
}
void bli_zfree_saved_contigmsr ( side_t  side,
uplo_t  uplo,
int  m,
int  n,
dcomplex a_save,
int  a_rs_save,
int  a_cs_save,
dcomplex **  a,
int *  a_rs,
int *  a_cs 
)

References bli_is_gen_storage(), bli_is_left(), bli_zcopymr(), and bli_zfree().

{
    int dim_a;

    // Choose the dimension of the matrix based on the side parameter.
    if ( bli_is_left( side ) ) dim_a = m;
    else                       dim_a = n;

    if ( bli_is_gen_storage( a_rs_save, a_cs_save ) )
    {
        // Copy the contents of the temporary matrix back to the original.
        bli_zcopymr( uplo,
                     dim_a,
                     dim_a,
                     *a,     *a_rs,     *a_cs,
                     a_save, a_rs_save, a_cs_save );

        // Free the temporary contiguous storage for the matrix.
        bli_zfree( *a );

        // Restore the original matrix address.
        *a = a_save;

        // Restore the original row and column strides.
        *a_rs = a_rs_save;
        *a_cs = a_cs_save;
    }
}