本文整理汇总了C++中FLA_COMPLEX_PTR函数的典型用法代码示例。如果您正苦于以下问题:C++ FLA_COMPLEX_PTR函数的具体用法?C++ FLA_COMPLEX_PTR怎么用?C++ FLA_COMPLEX_PTR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FLA_COMPLEX_PTR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: FLA_Obj_create_complex_constant
FLA_Error FLA_Obj_create_complex_constant( double const_real, double const_imag, FLA_Obj *obj )
{
int* temp_i;
float* temp_s;
double* temp_d;
scomplex* temp_c;
dcomplex* temp_z;
if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
FLA_Obj_create_complex_constant_check( const_real, const_imag, obj );
FLA_Obj_create( FLA_CONSTANT, 1, 1, 0, 0, obj );
#ifdef FLA_ENABLE_SCC
if ( !FLA_is_owner() )
return FLA_SUCCESS;
#endif
temp_i = FLA_INT_PTR( *obj );
temp_s = FLA_FLOAT_PTR( *obj );
temp_d = FLA_DOUBLE_PTR( *obj );
temp_c = FLA_COMPLEX_PTR( *obj );
temp_z = FLA_DOUBLE_COMPLEX_PTR( *obj );
*temp_i = ( int ) const_real;
*temp_s = ( float ) const_real;
*temp_d = const_real;
temp_c->real = ( float ) const_real;
temp_c->imag = ( float ) const_imag;
temp_z->real = const_real;
temp_z->imag = const_imag;
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:34,代码来源:FLA_Obj.c
示例2: FLA_Trinv_lu_opc_var2
FLA_Error FLA_Trinv_lu_opc_var2( int mn_A,
scomplex* buff_A, int rs_A, int cs_A )
{
scomplex* buff_m1 = FLA_COMPLEX_PTR( FLA_MINUS_ONE );
int i;
for ( i = 0; i < mn_A; ++i )
{
scomplex* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
scomplex* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
int mn_ahead = mn_A - i - 1;
/*------------------------------------------------------------*/
// FLA_Trsv_external( FLA_LOWER_TRIANGULAR, FLA_NO_TRANSPOSE, FLA_UNIT_DIAG, A22, a21 );
bl1_ctrsv( BLIS1_LOWER_TRIANGULAR,
BLIS1_NO_TRANSPOSE,
BLIS1_UNIT_DIAG,
mn_ahead,
A22, rs_A, cs_A,
a21, rs_A );
// FLA_Scal_external( FLA_MINUS_ONE, a21 );
bl1_cscalv( BLIS1_NO_CONJUGATE,
mn_ahead,
buff_m1,
a21, rs_A );
/*------------------------------------------------------------*/
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:35,代码来源:FLA_Trinv_lu_opt_var2.c
示例3: FLA_Chol_u_opt_var3
FLA_Error FLA_Chol_u_opt_var3( FLA_Obj A )
{
FLA_Error r_val = FLA_SUCCESS;
FLA_Datatype datatype;
int mn_A;
int rs_A, cs_A;
datatype = FLA_Obj_datatype( A );
mn_A = FLA_Obj_length( A );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
switch ( datatype )
{
case FLA_FLOAT:
{
float* buff_A = FLA_FLOAT_PTR( A );
r_val = FLA_Chol_u_ops_var3( mn_A,
buff_A, rs_A, cs_A );
break;
}
case FLA_DOUBLE:
{
double* buff_A = FLA_DOUBLE_PTR( A );
r_val = FLA_Chol_u_opd_var3( mn_A,
buff_A, rs_A, cs_A );
break;
}
case FLA_COMPLEX:
{
scomplex* buff_A = FLA_COMPLEX_PTR( A );
r_val = FLA_Chol_u_opc_var3( mn_A,
buff_A, rs_A, cs_A );
break;
}
case FLA_DOUBLE_COMPLEX:
{
dcomplex* buff_A = FLA_DOUBLE_COMPLEX_PTR( A );
r_val = FLA_Chol_u_opz_var3( mn_A,
buff_A, rs_A, cs_A );
break;
}
}
return r_val;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:59,代码来源:FLA_Chol_u_opt_var3.c
示例4: FLA_Tevd_eigval_v_opt_var1
FLA_Error FLA_Tevd_eigval_v_opt_var1( FLA_Obj G, FLA_Obj d, FLA_Obj e, FLA_Obj k )
{
FLA_Datatype datatype;
int m_A, n_G;
int rs_G, cs_G;
int inc_d;
int inc_e;
datatype = FLA_Obj_datatype( d );
m_A = FLA_Obj_vector_dim( d );
n_G = FLA_Obj_width( G );
rs_G = FLA_Obj_row_stride( G );
cs_G = FLA_Obj_col_stride( G );
inc_d = FLA_Obj_vector_inc( d );
inc_e = FLA_Obj_vector_inc( e );
switch ( datatype )
{
case FLA_FLOAT:
{
scomplex* buff_G = FLA_COMPLEX_PTR( G );
float* buff_d = FLA_FLOAT_PTR( d );
float* buff_e = FLA_FLOAT_PTR( e );
int* buff_k = FLA_INT_PTR( k );
FLA_Tevd_eigval_v_ops_var1( m_A,
n_G,
buff_G, rs_G, cs_G,
buff_d, inc_d,
buff_e, inc_e,
buff_k );
break;
}
case FLA_DOUBLE:
{
dcomplex* buff_G = FLA_DOUBLE_COMPLEX_PTR( G );
double* buff_d = FLA_DOUBLE_PTR( d );
double* buff_e = FLA_DOUBLE_PTR( e );
int* buff_k = FLA_INT_PTR( k );
FLA_Tevd_eigval_v_opd_var1( m_A,
n_G,
buff_G, rs_G, cs_G,
buff_d, inc_d,
buff_e, inc_e,
buff_k );
break;
}
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:59,代码来源:FLA_Tevd_eigval_v_opt_var1.c
示例5: FLA_Absolute_value
FLA_Error FLA_Absolute_value( FLA_Obj alpha )
{
FLA_Datatype datatype;
if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
FLA_Absolute_value_check( alpha );
datatype = FLA_Obj_datatype( alpha );
switch ( datatype ){
case FLA_FLOAT:
{
float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
*buff_alpha = ( float ) fabs( ( double ) *buff_alpha );
break;
}
case FLA_DOUBLE:
{
double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
*buff_alpha = fabs( *buff_alpha );
break;
}
case FLA_COMPLEX:
{
scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
buff_alpha->real = ( float ) sqrt( ( double ) buff_alpha->real * buff_alpha->real +
buff_alpha->imag * buff_alpha->imag );
buff_alpha->imag = 0.0F;
break;
}
case FLA_DOUBLE_COMPLEX:
{
dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
buff_alpha->real = sqrt( buff_alpha->real * buff_alpha->real +
buff_alpha->imag * buff_alpha->imag );
buff_alpha->imag = 0.0;
break;
}
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:56,代码来源:FLA_Absolute_value.c
示例6: FLA_Trinv_lu_opc_var3
FLA_Error FLA_Trinv_lu_opc_var3( int mn_A,
scomplex* buff_A, int rs_A, int cs_A )
{
scomplex* buff_1 = FLA_COMPLEX_PTR( FLA_ONE );
scomplex* buff_m1 = FLA_COMPLEX_PTR( FLA_MINUS_ONE );
int i;
for ( i = 0; i < mn_A; ++i )
{
scomplex* a10t = buff_A + (0 )*cs_A + (i )*rs_A;
scomplex* A20 = buff_A + (0 )*cs_A + (i+1)*rs_A;
scomplex* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
int mn_ahead = mn_A - i - 1;
int mn_behind = i;
/*------------------------------------------------------------*/
// FLA_Scal_external( FLA_MINUS_ONE, a21 );
bl1_cscalv( BLIS1_NO_CONJUGATE,
mn_ahead,
buff_m1,
a21, rs_A );
// FLA_Ger_external( FLA_ONE, a21, a10t, A20 );
bl1_cger( BLIS1_NO_CONJUGATE,
BLIS1_NO_CONJUGATE,
mn_ahead,
mn_behind,
buff_1,
a21, rs_A,
a10t, cs_A,
A20, rs_A, cs_A );
/*------------------------------------------------------------*/
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:40,代码来源:FLA_Trinv_lu_opt_var3.c
示例7: FLA_Fused_Ahx_Ax_opc_var1
FLA_Error FLA_Fused_Ahx_Ax_opc_var1( int m_A,
int n_A,
scomplex* buff_A, int rs_A, int cs_A,
scomplex* buff_x, int inc_x,
scomplex* buff_v, int inc_v,
scomplex* buff_w, int inc_w )
{
scomplex* buff_0 = FLA_COMPLEX_PTR( FLA_ZERO );
int i;
bl1_csetv( m_A,
buff_0,
buff_w, inc_w );
for ( i = 0; i < n_A; ++i )
{
scomplex* a1 = buff_A + (i )*cs_A + (0 )*rs_A;
scomplex* nu1 = buff_v + (i )*inc_v;
scomplex* x = buff_x;
scomplex* chi1 = buff_x + (i )*inc_x;
scomplex* w = buff_w;
/*------------------------------------------------------------*/
bl1_cdot( BLIS1_CONJUGATE,
m_A,
a1, rs_A,
x, inc_x,
nu1 );
bl1_caxpyv( BLIS1_NO_CONJUGATE,
m_A,
chi1,
a1, rs_A,
w, inc_w );
/*
F77_caxpy( &m_A,
chi1,
a1, &rs_A,
w, &inc_w );
*/
/*------------------------------------------------------------*/
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:48,代码来源:FLA_Fused_Ahx_Ax_opt_var1.c
示例8: FLA_Ttmm_l_opc_var3
FLA_Error FLA_Ttmm_l_opc_var3( int mn_A,
scomplex* buff_A, int rs_A, int cs_A )
{
scomplex* buff_1 = FLA_COMPLEX_PTR( FLA_ONE );
int i;
for ( i = 0; i < mn_A; ++i )
{
scomplex* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
scomplex* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
scomplex* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
int mn_ahead = mn_A - i - 1;
/*------------------------------------------------------------*/
// FLA_Absolute_square( alpha11 );
bl1_cabsqr( alpha11 );
// FLA_Dotcs_external( FLA_CONJUGATE, FLA_ONE, a21, a21, FLA_ONE, alpha11 );
bl1_cdots( BLIS1_CONJUGATE,
mn_ahead,
buff_1,
a21, rs_A,
a21, rs_A,
buff_1,
alpha11 );
// FLA_Trmv_external( FLA_LOWER_TRIANGULAR, FLA_CONJ_TRANSPOSE, FLA_NONUNIT_DIAG, A22, a21 );
bl1_ctrmv( BLIS1_LOWER_TRIANGULAR,
BLIS1_CONJ_TRANSPOSE,
BLIS1_NONUNIT_DIAG,
mn_ahead,
A22, rs_A, cs_A,
a21, rs_A );
/*------------------------------------------------------------*/
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:42,代码来源:FLA_Ttmm_l_opt_var3.c
示例9: FLA_Househ3UD_UT_opc
FLA_Error FLA_Househ3UD_UT_opc( int m_x1,
int m_y2,
scomplex* chi_0,
scomplex* x1, int inc_x1,
scomplex* y2, int inc_y2,
scomplex* tau )
{
scomplex one_half = *FLA_COMPLEX_PTR( FLA_ONE_HALF );
scomplex alpha;
scomplex chi_0_minus_alpha;
scomplex neg_chi_0_minus_alpha;
float abs_chi_0;
float norm_x_1;
float norm_y_2;
float lambda;
float abs_sq_chi_0_minus_alpha;
int i_one = 1;
//
// Compute the 2-norms of x_1 and y_2:
//
// norm_x_1 := || x_1 ||_2
// norm_y_2 := || y_2 ||_2
//
bl1_cnrm2( m_x1,
x1, inc_x1,
&norm_x_1 );
bl1_cnrm2( m_y2,
y2, inc_y2,
&norm_y_2 );
//
// If 2-norms of x_1, y_2 are zero, then return with trivial tau, chi_0 values.
//
if ( norm_x_1 == 0.0F &&
norm_y_2 == 0.0F )
{
chi_0->real = -(chi_0->real);
chi_0->imag = -(chi_0->imag);
tau->real = one_half.real;
tau->imag = one_half.imag;
return FLA_SUCCESS;
}
//
// Compute the absolute value (magnitude) of chi_0, which equals the 2-norm
// of chi_0:
//
// abs_chi_0 := | chi_0 | = || chi_0 ||_2
//
bl1_cnrm2( i_one,
chi_0, i_one,
&abs_chi_0 );
//
// Compute lambda:
//
// lambda := sqrt( conj(chi0) chi0 + x1' x1 - y2' y2 )
//
lambda = ( float ) sqrt( abs_chi_0 * abs_chi_0 +
norm_x_1 * norm_x_1 -
norm_y_2 * norm_y_2 );
//
// Compute alpha:
//
// alpha := - lambda * chi_0 / | chi_0 |
//
alpha.real = -chi_0->real * lambda / abs_chi_0;
alpha.imag = -chi_0->imag * lambda / abs_chi_0;
//
// Overwrite x_1 and y_2 with u_1 and v_2, respectively:
//
// x_1 := x_1 / ( chi_0 - alpha )
// y_2 := y_2 / -( chi_0 - alpha )
//
chi_0_minus_alpha.real = chi_0->real - alpha.real;
chi_0_minus_alpha.imag = chi_0->imag - alpha.imag;
bl1_cinvscalv( BLIS1_NO_CONJUGATE,
m_x1,
&chi_0_minus_alpha,
x1, inc_x1 );
neg_chi_0_minus_alpha.real = -chi_0_minus_alpha.real;
neg_chi_0_minus_alpha.imag = -chi_0_minus_alpha.imag;
bl1_cinvscalv( BLIS1_NO_CONJUGATE,
m_y2,
&neg_chi_0_minus_alpha,
y2, inc_y2 );
//.........这里部分代码省略.........
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_Househ3UD_UT.c
示例10: FLA_LU_piv_opc_var5
FLA_Error FLA_LU_piv_opc_var5( int m_A,
int n_A,
scomplex* buff_A, int rs_A, int cs_A,
int* buff_p, int inc_p )
{
FLA_Error r_val = FLA_SUCCESS;
scomplex* buff_m1 = FLA_COMPLEX_PTR( FLA_MINUS_ONE );
int min_m_n = min( m_A, n_A );
int i;
for ( i = 0; i < min_m_n; ++i )
{
scomplex pivot_val = czero;
scomplex* a10t = buff_A + (0 )*cs_A + (i )*rs_A;
scomplex* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
scomplex* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
scomplex* a12t = buff_A + (i+1)*cs_A + (i )*rs_A;
scomplex* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
int* pi1 = buff_p + i*inc_p;
int m_ahead = m_A - i - 1;
int n_ahead = n_A - i - 1;
/*------------------------------------------------------------*/
// FLA_Merge_2x1( alpha11,
// a21, &aB1 );
// FLA_Amax_external( aB1, pi1 );
bl1_camax( m_ahead + 1,
alpha11, rs_A,
pi1 );
// If a null pivot is encountered, return the index.
pivot_val = *(alpha11 + *pi1);
if ( pivot_val.real == czero.real &&
pivot_val.imag == czero.imag ) r_val = ( r_val == FLA_SUCCESS ? i : r_val );
else
{
// FLA_Merge_1x2( ABL, ABR, &AB );
// FLA_Apply_pivots( FLA_LEFT, FLA_NO_TRANSPOSE, pi1, AB );
FLA_Apply_pivots_ln_opc_var1( n_A,
a10t, rs_A, cs_A,
0,
0,
pi1, inc_p );
// FLA_Inv_scal_external( alpha11, a21 );
bl1_cinvscalv( BLIS1_NO_CONJUGATE,
m_ahead,
alpha11,
a21, rs_A );
}
// FLA_Ger_external( FLA_MINUS_ONE, a21, a12t, A22 );
bl1_cger( BLIS1_NO_CONJUGATE,
BLIS1_NO_CONJUGATE,
m_ahead,
n_ahead,
buff_m1,
a21, rs_A,
a12t, cs_A,
A22, rs_A, cs_A );
/*------------------------------------------------------------*/
}
return r_val;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:72,代码来源:FLA_LU_piv_opt_var5.c
示例11: FLA_LU_piv_opt_var5
FLA_Error FLA_LU_piv_opt_var5( FLA_Obj A, FLA_Obj p )
{
FLA_Error r_val = FLA_SUCCESS;
FLA_Datatype datatype;
int m_A, n_A;
int rs_A, cs_A;
int inc_p;
datatype = FLA_Obj_datatype( A );
m_A = FLA_Obj_length( A );
n_A = FLA_Obj_width( A );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
inc_p = FLA_Obj_vector_inc( p );
switch ( datatype )
{
case FLA_FLOAT:
{
float* buff_A = FLA_FLOAT_PTR( A );
int* buff_p = FLA_INT_PTR( p );
r_val = FLA_LU_piv_ops_var5( m_A,
n_A,
buff_A, rs_A, cs_A,
buff_p, inc_p );
break;
}
case FLA_DOUBLE:
{
double* buff_A = FLA_DOUBLE_PTR( A );
int* buff_p = FLA_INT_PTR( p );
r_val = FLA_LU_piv_opd_var5( m_A,
n_A,
buff_A, rs_A, cs_A,
buff_p, inc_p );
break;
}
case FLA_COMPLEX:
{
scomplex* buff_A = FLA_COMPLEX_PTR( A );
int* buff_p = FLA_INT_PTR( p );
r_val = FLA_LU_piv_opc_var5( m_A,
n_A,
buff_A, rs_A, cs_A,
buff_p, inc_p );
break;
}
case FLA_DOUBLE_COMPLEX:
{
dcomplex* buff_A = FLA_DOUBLE_COMPLEX_PTR( A );
int* buff_p = FLA_INT_PTR( p );
r_val = FLA_LU_piv_opz_var5( m_A,
n_A,
buff_A, rs_A, cs_A,
buff_p, inc_p );
break;
}
}
return r_val;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:75,代码来源:FLA_LU_piv_opt_var5.c
示例12: FLA_Trmm_external_gpu
FLA_Error FLA_Trmm_external_gpu( FLA_Side side, FLA_Uplo uplo, FLA_Trans trans, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, void* A_gpu, FLA_Obj B, void* B_gpu )
{
FLA_Datatype datatype;
int m_B, n_B;
int ldim_A;
int ldim_B;
char blas_side;
char blas_uplo;
char blas_trans;
char blas_diag;
if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
FLA_Trmm_check( side, uplo, trans, diag, alpha, A, B );
if ( FLA_Obj_has_zero_dim( B ) ) return FLA_SUCCESS;
datatype = FLA_Obj_datatype( A );
ldim_A = FLA_Obj_length( A );
m_B = FLA_Obj_length( B );
n_B = FLA_Obj_width( B );
ldim_B = FLA_Obj_length( B );
FLA_Param_map_flame_to_netlib_side( side, &blas_side );
FLA_Param_map_flame_to_netlib_uplo( uplo, &blas_uplo );
FLA_Param_map_flame_to_netlib_trans( trans, &blas_trans );
FLA_Param_map_flame_to_netlib_diag( diag, &blas_diag );
switch( datatype ){
case FLA_FLOAT:
{
float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
cublasStrmm( blas_side,
blas_uplo,
blas_trans,
blas_diag,
m_B,
n_B,
*buff_alpha,
( float * ) A_gpu, ldim_A,
( float * ) B_gpu, ldim_B );
break;
}
case FLA_DOUBLE:
{
double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
cublasDtrmm( blas_side,
blas_uplo,
blas_trans,
blas_diag,
m_B,
n_B,
*buff_alpha,
( double * ) A_gpu, ldim_A,
( double * ) B_gpu, ldim_B );
break;
}
case FLA_COMPLEX:
{
cuComplex *buff_alpha = ( cuComplex * ) FLA_COMPLEX_PTR( alpha );
cublasCtrmm( blas_side,
blas_uplo,
blas_trans,
blas_diag,
m_B,
n_B,
*buff_alpha,
( cuComplex * ) A_gpu, ldim_A,
( cuComplex * ) B_gpu, ldim_B );
break;
}
case FLA_DOUBLE_COMPLEX:
{
cuDoubleComplex *buff_alpha = ( cuDoubleComplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha );
cublasZtrmm( blas_side,
blas_uplo,
blas_trans,
blas_diag,
m_B,
n_B,
*buff_alpha,
( cuDoubleComplex * ) A_gpu, ldim_A,
( cuDoubleComplex * ) B_gpu, ldim_B );
break;
}
//.........这里部分代码省略.........
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_Trmm_external_gpu.c
示例13: FLA_Hess_UT_step_opt_var4
FLA_Error FLA_Hess_UT_step_opt_var4( FLA_Obj A, FLA_Obj Y, FLA_Obj Z, FLA_Obj T )
{
FLA_Datatype datatype;
int m_A, m_T;
int rs_A, cs_A;
int rs_Y, cs_Y;
int rs_Z, cs_Z;
int rs_T, cs_T;
datatype = FLA_Obj_datatype( A );
m_A = FLA_Obj_length( A );
m_T = FLA_Obj_length( T );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
rs_Y = FLA_Obj_row_stride( Y );
cs_Y = FLA_Obj_col_stride( Y );
rs_Z = FLA_Obj_row_stride( Z );
cs_Z = FLA_Obj_col_stride( Z );
rs_T = FLA_Obj_row_stride( T );
cs_T = FLA_Obj_col_stride( T );
switch ( datatype )
{
case FLA_FLOAT:
{
float* buff_A = FLA_FLOAT_PTR( A );
float* buff_Y = FLA_FLOAT_PTR( Y );
float* buff_Z = FLA_FLOAT_PTR( Z );
float* buff_T = FLA_FLOAT_PTR( T );
FLA_Hess_UT_step_ops_var4( m_A,
m_T,
buff_A, rs_A, cs_A,
buff_Y, rs_Y, cs_Y,
buff_Z, rs_Z, cs_Z,
buff_T, rs_T, cs_T );
break;
}
case FLA_DOUBLE:
{
double* buff_A = FLA_DOUBLE_PTR( A );
double* buff_Y = FLA_DOUBLE_PTR( Y );
double* buff_Z = FLA_DOUBLE_PTR( Z );
double* buff_T = FLA_DOUBLE_PTR( T );
FLA_Hess_UT_step_opd_var4( m_A,
m_T,
buff_A, rs_A, cs_A,
buff_Y, rs_Y, cs_Y,
buff_Z, rs_Z, cs_Z,
buff_T, rs_T, cs_T );
break;
}
case FLA_COMPLEX:
{
scomplex* buff_A = FLA_COMPLEX_PTR( A );
scomplex* buff_Y = FLA_COMPLEX_PTR( Y );
scomplex* buff_Z = FLA_COMPLEX_PTR( Z );
scomplex* buff_T = FLA_COMPLEX_PTR( T );
FLA_Hess_UT_step_opc_var4( m_A,
m_T,
buff_A, rs_A, cs_A,
buff_Y, rs_Y, cs_Y,
buff_Z, rs_Z, cs_Z,
buff_T, rs_T, cs_T );
break;
}
case FLA_DOUBLE_COMPLEX:
{
dcomplex* buff_A = FLA_DOUBLE_COMPLEX_PTR( A );
dcomplex* buff_Y = FLA_DOUBLE_COMPLEX_PTR( Y );
dcomplex* buff_Z = FLA_DOUBLE_COMPLEX_PTR( Z );
dcomplex* buff_T = FLA_DOUBLE_COMPLEX_PTR( T );
FLA_Hess_UT_step_opz_var4( m_A,
m_T,
buff_A, rs_A, cs_A,
buff_Y, rs_Y, cs_Y,
buff_Z, rs_Z, cs_Z,
buff_T, rs_T, cs_T );
break;
}
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:100,代码来源:FLA_Hess_UT_opt_var4.c
示例14: FLA_Herc_external
FLA_Error FLA_Herc_external( FLA_Uplo uplo, FLA_Conj conj, FLA_Obj alpha, FLA_Obj x, FLA_Obj A )
{
FLA_Datatype datatype;
int m_A;
int rs_A, cs_A;
int inc_x;
uplo_t blis_uplo;
conj_t blis_conj;
if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
FLA_Herc_check( uplo, conj, alpha, x, A );
if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
datatype = FLA_Obj_datatype( A );
m_A = FLA_Obj_length( A );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
inc_x = FLA_Obj_vector_inc( x );
FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
FLA_Param_map_flame_to_blis_conj( conj, &blis_conj );
switch( datatype ){
case FLA_FLOAT:
{
float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
float *buff_x = ( float * ) FLA_FLOAT_PTR( x );
float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
bli_ssyr( blis_uplo,
m_A,
buff_alpha,
buff_x, inc_x,
buff_A, rs_A, cs_A );
break;
}
case FLA_DOUBLE:
{
double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
double *buff_x = ( double * ) FLA_DOUBLE_PTR( x );
double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
bli_dsyr( blis_uplo,
m_A,
buff_alpha,
buff_x, inc_x,
buff_A, rs_A, cs_A );
break;
}
case FLA_COMPLEX:
{
scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
scomplex *buff_x = ( scomplex * ) FLA_COMPLEX_PTR( x );
float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
bli_cher( blis_uplo,
blis_conj,
m_A,
buff_alpha,
buff_x, inc_x,
buff_A, rs_A, cs_A );
break;
}
case FLA_DOUBLE_COMPLEX:
{
dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
dcomplex *buff_x = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( x );
double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
bli_zher( blis_uplo,
blis_conj,
m_A,
buff_alpha,
buff_x, inc_x,
buff_A, rs_A, cs_A );
break;
}
}
return FLA_SUCCESS;
}
开发者ID:pgawron,项目名称:tlash,代码行数:92,代码来源:FLA_Herc_external.c
示例15: FLA_Symm_external
FLA_Error FLA_Symm_external( FLA_Side side, FLA_Uplo uplo, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
{
FLA_Datatype datatype;
int m_C, n_C;
int rs_A, cs_A;
int rs_B, cs_B;
int rs_C, cs_C;
side_t blis_side;
uplo_t blis_uplo;
if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
FLA_Symm_check( side, uplo, alpha, A, B, beta, C );
if ( FLA_Obj_has_zero_dim( C ) ) return FLA_SUCCESS;
datatype = FLA_Obj_datatype( A );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
rs_B = FLA_Obj_row_stride( B );
cs_B = FLA_Obj_col_stride( B );
m_C = FLA_Obj_length( C );
n_C = FLA_Obj_width( C );
rs_C = FLA_Obj_row_stride( C );
cs_C = FLA_Obj_col_stride( C );
FLA_Param_map_flame_to_blis_side( side, &blis_side );
FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo );
switch( datatype ){
case FLA_FLOAT:
{
float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
float *buff_C = ( float * ) FLA_FLOAT_PTR( C );
float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha );
float *buff_beta = ( float * ) FLA_FLOAT_PTR( beta );
bli_ssymm( blis_side,
blis_uplo,
m_C,
n_C,
buff_alpha,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B,
buff_beta,
buff_C, rs_C, cs_C );
break;
}
case FLA_DOUBLE:
{
double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
double *buff_C = ( double * ) FLA_DOUBLE_PTR( C );
double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha );
double *buff_beta = ( double * ) FLA_DOUBLE_PTR( beta );
bli_dsymm( blis_side,
blis_uplo,
m_C,
n_C,
buff_alpha,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B,
buff_beta,
buff_C, rs_C, cs_C );
break;
}
case FLA_COMPLEX:
{
scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
scomplex *buff_C = ( scomplex * ) FLA_COMPLEX_PTR( C );
scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha );
scomplex *buff_beta = ( scomplex * ) FLA_COMPLEX_PTR( beta );
bli_csymm( blis_side,
blis_uplo,
m_C,
n_C,
buff_alpha,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B,
buff_beta,
buff_C, rs_C, cs_C );
break;
}
case FLA_DOUBLE_COMPLEX:
{
dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
//.........这里部分代码省略.........
开发者ID:pgawron,项目名称:tlash,代码行数:101,代码来源:FLA_Symm_external.c
示例16: FLA_Obj_equals
FLA_Bool FLA_Obj_equals( FLA_Obj A, FLA_Obj B )
{
FLA_Datatype datatype_A;
FLA_Datatype datatype_B;
FLA_Datatype datatype;
dim_t m, n;
dim_t rs_A, cs_A;
dim_t rs_B, cs_B;
dim_t i, j;
if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
FLA_Obj_equals_check( A, B );
m = FLA_Obj_length( A );
n = FLA_Obj_width( A );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
rs_B = FLA_Obj_row_stride( B );
cs_B = FLA_Obj_col_stride( B );
datatype_A = FLA_Obj_datatype( A );
datatype_B = FLA_Obj_datatype( B );
// If A is a non-FLA_CONSTANT object, then we should proceed based on the
// value of datatype_A. In such a situation, either datatype_B is an exact
// match and we're fine, or datatype_B is FLA_CONSTANT, in which case we're
// also covered since FLA_CONSTANT encompassas all numerical types.
// If A is an FLA_CONSTANT object, then we should proceed based on the value
// of datatype_B. In this case, datatype_B is either a non-FLA_CONSTANT type,
// which mirrors the second sub-case above, or datatype_B is FLA_CONSTANT,
// in which case both types are FLA_CONSTANT and therefore we have to handle
// that case. Only if both are FLA_CONSTANTs does the FLA_CONSTANT case
// statement below execute.
if ( datatype_A != FLA_CONSTANT )
datatype = datatype_A;
else
datatype = datatype_B;
switch ( datatype )
{
case FLA_CONSTANT:
{
// We require ALL floating-point fields to be the same.
float* buffs_A = ( float * ) FLA_FLOAT_PTR( A );
float* buffs_B = ( float * ) FLA_FLOAT_PTR( B );
double* buffd_A = ( double * ) FLA_DOUBLE_PTR( A );
double* buffd_B = ( double * ) FLA_DOUBLE_PTR( B );
scomplex* buffc_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
scomplex* buffc_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
dcomplex* buffz_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
dcomplex* buffz_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
if ( *buffs_A != *buffs_B ||
*buffd_A != *buffd_B ||
buffc_A->real != buffc_B->real ||
buffc_A->imag != buffc_B->imag ||
buffz_A->real != buffz_B->real ||
buffz_A->imag != buffz_B->imag )
{
return FALSE;
}
break;
}
case FLA_INT:
{
int *buff_A = ( int * ) FLA_INT_PTR( A );
int *buff_B = ( int * ) FLA_INT_PTR( B );
for ( j = 0; j < n; j++ )
for ( i = 0; i < m; i++ )
if ( buff_A[ j * cs_A + i * rs_A ] !=
buff_B[ j * cs_B + i * rs_B ] )
{
return FALSE;
}
break;
}
case FLA_FLOAT:
{
float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
for ( j = 0; j < n; j++ )
for ( i = 0; i < m; i++ )
if ( buff_A[ j * cs_A + i * rs_A ] !=
buff_B[ j * cs_B + i * rs_B ] )
{
return FALSE;
}
break;
}
case FLA_DOUBLE:
{
double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
//.........这里部分代码省略.........
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_Query.c
示例17: FLA_Tridiag_UT_l_step_opc_var2
FLA_Error FLA_Tridiag_UT_l_step_opc_var2( int m_A,
int m_T,
scomplex* buff_A, int rs_A, int cs_A,
scomplex* buff_T, int rs_T, int cs_T )
{
scomplex* buff_2 = FLA_COMPLEX_PTR( FLA_TWO );
scomplex* buff_1 = FLA_COMPLEX_PTR( FLA_ONE );
scomplex* buff_0 = FLA_COMPLEX_PTR( FLA_ZERO );
scomplex* buff_m1 = FLA_COMPLEX_PTR( FLA_MINUS_ONE );
scomplex first_elem;
scomplex beta;
scomplex inv_tau11;
scomplex minus_inv_tau11;
scomplex minus_upsilon11, minus_conj_upsilon11;
scomplex minus_zeta11, minus_conj_zeta11;
int i;
// b_alg = FLA_Obj_length( T );
int b_alg = m_T;
// FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &u );
// FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &z );
// FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &w );
scomplex* buff_u = ( scomplex* ) FLA_malloc( m_A * sizeof( *buff_A ) );
scomplex* buff_z = ( scomplex* ) FLA_malloc( m_A * sizeof( *buff_A ) );
scomplex* buff_w = ( scomplex* ) FLA_malloc( m_A * sizeof( *buff_A ) );
int inc_u = 1;
int inc_z = 1;
int inc_w = 1;
// Initialize some variables (only to prevent compiler warnings).
first_elem = *buff_0;
minus_inv_tau11 = *buff_0;
for ( i = 0; i < b_alg; ++i )
{
scomplex* A20 = buff_A + (0 )*cs_A + (i+1)*rs_A;
scomplex* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
scomplex* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
scomplex* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
scomplex* t01 = buff_T + (i )*cs_T + (0 )*rs_T;
scomplex* tau11 = buff_T + (i )*cs_T + (i )*rs_T;
scomplex* upsilon11= buff_u + (i )*inc_u;
scomplex* u21 = buff_u + (i+1)*inc_u;
scomplex* zeta11 = buff_z + (i )*inc_z;
scomplex* z21 = buff_z + (i+1)*inc_z;
scomplex* w21 = buff_w + (i+1)*inc_w;
scomplex* a21_t = a21 + (0 )*cs_A + (0 )*rs_A;
scomplex* a21_b = a21 + (0 )*cs_A + (1 )*rs_A;
int m_ahead = m_A - i - 1;
int m_behind = i;
int n_behind = i;
/*------------------------------------------------------------*/
if ( m_behind > 0 )
{
// FLA_Copy( upsilon11, minus_upsilon11 );
// FLA_Scal( FLA_MINUS_ONE, minus_upsilon11 );
// FLA_Copy( minus_upsilon11, minus_conj_upsilon11 );
bl1_cmult3( buff_m1, upsilon11, &minus_upsilon11 );
bl1_ccopyconj( &minus_upsilon11, &minus_conj_upsilon11 );
// FLA_Copy( zeta11, minus_zeta11 );
// FLA_Scal( FLA_MINUS_ONE, minus_zeta11 );
// FLA_Copy( minus_zeta11, minus_conj_zeta11 );
bl1_cmult3( buff_m1, zeta11, &minus_zeta11 );
bl1_ccopyconj( &minus_zeta11, &minus_conj_zeta11 );
// FLA_Axpyt( FLA_CONJ_NO_TRANSPOSE, minus_upsilon11, zeta11, alpha11 );
// FLA_Axpyt( FLA_CONJ_NO_TRANSPOSE, minus_zeta11, upsilon11, alpha11 );
bl1_caxpyv( BLIS1_CONJUGATE,
1,
&minus_upsilon11,
zeta11, 1,
alpha11, 1 );
bl1_caxpyv( BLIS1_CONJUGATE,
1,
&minus_zeta11,
upsilon11, 1,
alpha11, 1 );
// FLA_Axpyt( FLA_NO_TRANSPOSE, minus_conj_zeta11, u21, a21 );
// FLA_Axpyt( FLA_NO_TRANSPOSE, minus_conj_upsilon11, z21, a21 );
bl1_caxpyv( BLIS1_NO_CONJUGATE,
m_ahead,
&minus_conj_zeta11,
u21, inc_u,
a21, rs_A );
bl1_caxpyv( BLIS1_NO_CONJUGATE,
m_ahead,
&minus_conj_upsilon11,
z21, inc_z,
//.........这里部分代码省略.........
开发者ID:alishakiba,项目名称:libflame,代码行数:101,代码来源:FLA_Tridiag_UT_l_opt_var2.c
示例18: FLA_Househ3UD_UT
FLA_Error FLA_Househ3UD_UT( FLA_Obj chi_0, FLA_Obj x1, FLA_Obj y2, FLA_Obj tau )
/*
Compute an up-and-downdating UT Householder transformation
/ / 1 0 0 \ / 1 0 0 \ / 1 \ ( 1 u1' v2' ) \
H = | | 0 I 0 | - inv(tau) | 0 I 0 | | u1 | |
\ \ 0 0 I / \ 0 0 -I / \ v2 / /
by computing tau, u1, and v2 such that the following is satisfied:
/ chi_0 \ / alpha \
H | x1 | = | 0 |
\ y2 / \ 0 /
where
alpha = - lambda * chi_0 / | chi_0 |
lambda = sqrt( conj(chi0) chi0 + x1' x1 - y2' y2 )
/ chi_0 \
x = | x1 |
\ y2 /
tau = ( 1 + u1' u1 - v2' v2 ) / 2
u1 = x1 / ( chi_0 - alpha )
v2 = -y2 / ( chi_0 - alpha )
Upon completion, alpha, u1, and v2 have overwritten objects chi_0, x1,
and y2, respectively.
-FGVZ
*/
{
FLA_Datatype datatype;
int m_x1;
int m_y2;
int inc_x1;
int inc_y2;
datatype = FLA_Obj_datatype( x1 );
m_x1 = FLA_Obj_vector_dim( x1 );
m_y2 = FLA_Obj_vector_dim( y2 );
inc_x1 = FLA_Obj_vector_inc( x1 );
inc_y2 = FLA_Obj_vector_inc( y2 );
if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
FLA_Househ3UD_UT_check( chi_0, x1, y2, tau );
switch ( datatype )
{
case FLA_FLOAT:
{
float* chi_0_p = ( float* ) FLA_FLOAT_PTR( chi_0 );
float* x1_p = ( float* ) FLA_FLOAT_PTR( x1 );
float* y2_p = ( float* ) FLA_FLOAT_PTR( y2 );
float* tau_p = ( float* ) FLA_FLOAT_PTR( tau );
FLA_Househ3UD_UT_ops( m_x1,
m_y2,
chi_0_p,
x1_p, inc_x1,
y2_p, inc_y2,
tau_p );
break;
}
case FLA_DOUBLE:
{
double* chi_0_p = ( double* ) FLA_DOUBLE_PTR( chi_0 );
double* x1_p = ( double* ) FLA_DOUBLE_PTR( x1 );
double* y2_p = ( double* ) FLA_DOUBLE_PTR( y2 );
double* tau_p = ( double* ) FLA_DOUBLE_PTR( tau );
FLA_Househ3UD_UT_opd( m_x1,
m_y2,
chi_0_p,
x1_p, inc_x1,
y2_p, inc_y2,
tau_p );
break;
}
case FLA_COMPLEX:
{
scomplex* chi_0_p = ( scomplex* ) FLA_COMPLEX_PTR( chi_0 );
scomplex* x1_p = ( scomplex* ) FLA_COMPLEX_PTR( x1 );
scomplex* y2_p = ( scomplex* ) FLA_COMPLEX_PTR( y2 );
scomplex* tau_p = ( scomplex* ) FLA_COMPLEX_PTR( tau );
FLA_Househ3UD_UT_opc( m_x1,
m_y2,
chi_0_p,
x1_p, inc_x1,
y2_p, inc_y2,
tau_p );
break;
//.........这里部分代码省略.........
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_Househ3UD_UT.c
示例19: FLA_Fused_Gerc2_opt_var1
FLA_Error FLA_Fused_Gerc2_opt_var1( FLA_Obj alpha, FLA_Obj u, FLA_Obj y, FLA_Obj z, FLA_Obj v, FLA_Obj A )
{
/*
Effective computation:
A = A + alpha * ( u * y' + z * v' );
*/
FLA_Datatype datatype;
int m_A, n_A;
int rs_A, cs_A;
int inc_u, inc_y, inc_z, inc_v;
datatype = FLA_Obj_datatype( A );
m_A = FLA_Obj_length( A );
n_A = FLA_Obj_width( A );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
inc_u = FLA_Obj_vector_inc( u );
inc_y = FLA_Obj_vector_inc( y );
inc_z = FLA_Obj_vector_inc( z );
inc_v = FLA_Obj_vector_inc( v );
switch ( datatype )
{
case FLA_FLOAT:
{
float* buff_A = FLA_FLOAT_PTR( A );
float* buff_u = FLA_FLOAT_PTR( u );
float* buff_y = FLA_FLOAT_PTR( y );
float* buff_z = FLA_FLOAT_PTR( z );
float* buff_v = FLA_FLOAT_PTR( v );
float* buff_alpha = FLA_FLOAT_PTR( alpha );
FLA_Fused_Gerc2_ops_var1( m_A,
n_A,
buff_alpha,
|
请发表评论