libflame  12600
Functions
bl1_dot.c File Reference

(r12600)

Functions

void bl1_sdot (conj1_t conj, int n, float *x, int incx, float *y, int incy, float *rho)
void bl1_ddot (conj1_t conj, int n, double *x, int incx, double *y, int incy, double *rho)
void bl1_cdot (conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy, scomplex *rho)
void bl1_zdot (conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy, dcomplex *rho)
void bl1_cdot_in (conj1_t conj, int n, scomplex *x, int incx, scomplex *y, int incy, scomplex *rho)
void bl1_zdot_in (conj1_t conj, int n, dcomplex *x, int incx, dcomplex *y, int incy, dcomplex *rho)

Function Documentation

void bl1_cdot ( conj1_t  conj,
int  n,
scomplex x,
int  incx,
scomplex y,
int  incy,
scomplex rho 
)
void bl1_cdot_in ( conj1_t  conj,
int  n,
scomplex x,
int  incx,
scomplex y,
int  incy,
scomplex rho 
)

References bl1_is_conj(), scomplex::imag, and scomplex::real.

Referenced by bl1_cdot().

{
    scomplex* xip;
    scomplex* yip;
    scomplex  xi;
    scomplex  yi;
    scomplex  rho_temp;
    int       i;

    rho_temp.real = 0.0F;
    rho_temp.imag = 0.0F;
        
    xip = x;
    yip = y;
        
    if ( bl1_is_conj( conj ) )
    {
        for ( i = 0; i < n; ++i )
        {
            xi.real = xip->real;
            xi.imag = xip->imag;
            yi.real = yip->real;
            yi.imag = yip->imag;
            
            rho_temp.real += xi.real * yi.real - -xi.imag * yi.imag;
            rho_temp.imag += xi.real * yi.imag + -xi.imag * yi.real;

            xip += incx;
            yip += incy;
        }
    }
    else // if ( !bl1_is_conj( conj ) )
    {
        for ( i = 0; i < n; ++i )
        {
            xi.real = xip->real;
            xi.imag = xip->imag;
            yi.real = yip->real;
            yi.imag = yip->imag;
            
            rho_temp.real += xi.real * yi.real - xi.imag * yi.imag;
            rho_temp.imag += xi.real * yi.imag + xi.imag * yi.real;

            xip += incx;
            yip += incy;
        }
    }
    
    rho->real = rho_temp.real;
    rho->imag = rho_temp.imag;
}
void bl1_ddot ( conj1_t  conj,
int  n,
double *  x,
int  incx,
double *  y,
int  incy,
double *  rho 
)
void bl1_sdot ( conj1_t  conj,
int  n,
float *  x,
int  incx,
float *  y,
int  incy,
float *  rho 
)
void bl1_zdot ( conj1_t  conj,
int  n,
dcomplex x,
int  incx,
dcomplex y,
int  incy,
dcomplex rho 
)
void bl1_zdot_in ( conj1_t  conj,
int  n,
dcomplex x,
int  incx,
dcomplex y,
int  incy,
dcomplex rho 
)

References bl1_is_conj(), dcomplex::imag, and dcomplex::real.

Referenced by bl1_zdot().

{
    dcomplex* xip;
    dcomplex* yip;
    dcomplex  xi;
    dcomplex  yi;
    dcomplex  rho_temp;
    int       i;

    rho_temp.real = 0.0;
    rho_temp.imag = 0.0;
        
    xip = x;
    yip = y;
        
    if ( bl1_is_conj( conj ) )
    {
        for ( i = 0; i < n; ++i )
        {
            xi.real = xip->real;
            xi.imag = xip->imag;
            yi.real = yip->real;
            yi.imag = yip->imag;
            
            rho_temp.real += xi.real * yi.real - -xi.imag * yi.imag;
            rho_temp.imag += xi.real * yi.imag + -xi.imag * yi.real;

            xip += incx;
            yip += incy;
        }
    }
    else // if ( !bl1_is_conj( conj ) )
    {
        for ( i = 0; i < n; ++i )
        {
            xi.real = xip->real;
            xi.imag = xip->imag;
            yi.real = yip->real;
            yi.imag = yip->imag;
            
            rho_temp.real += xi.real * yi.real - xi.imag * yi.imag;
            rho_temp.imag += xi.real * yi.imag + xi.imag * yi.real;

            xip += incx;
            yip += incy;
        }
    }
    
    rho->real = rho_temp.real;
    rho->imag = rho_temp.imag;
}