本文整理汇总了C++中FLA_FLOAT_PTR函数的典型用法代码示例。如果您正苦于以下问题:C++ FLA_FLOAT_PTR函数的具体用法?C++ FLA_FLOAT_PTR怎么用?C++ FLA_FLOAT_PTR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FLA_FLOAT_PTR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: 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
示例2: FLA_Trinv_lu_ops_var2
FLA_Error FLA_Trinv_lu_ops_var2( int mn_A,
float* buff_A, int rs_A, int cs_A )
{
float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
int i;
for ( i = 0; i < mn_A; ++i )
{
float* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
float* 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_strsv( 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_sscalv( 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_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
示例4: 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
示例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_Fused_Ahx_Ax_ops_var1
FLA_Error FLA_Fused_Ahx_Ax_ops_var1( int m_A,
int n_A,
float* buff_A, int rs_A, int cs_A,
float* buff_x, int inc_x,
float* buff_v, int inc_v,
float* buff_w, int inc_w )
{
float* buff_0 = FLA_FLOAT_PTR( FLA_ZERO );
int i;
bl1_ssetv( m_A,
buff_0,
buff_w, inc_w );
for ( i = 0; i < n_A; ++i )
{
float* a1 = buff_A + (i )*cs_A + (0 )*rs_A;
float* nu1 = buff_v + (i )*inc_v;
float* x = buff_x;
float* chi1 = buff_x + (i )*inc_x;
float* w = buff_w;
/*------------------------------------------------------------*/
bl1_sdot( BLIS1_CONJUGATE,
m_A,
a1, rs_A,
x, inc_x,
nu1 );
/*
*nu1 = F77_sdot( &m_A,
a1, &rs_A,
x, &inc_x );
*/
bl1_saxpyv( BLIS1_NO_CONJUGATE,
m_A,
chi1,
a1, rs_A,
w, inc_w );
/*
F77_saxpy( &m_A,
chi1,
a1, &rs_A,
w, &inc_w );
*/
/*------------------------------------------------------------*/
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:54,代码来源:FLA_Fused_Ahx_Ax_opt_var1.c
示例7: FLA_Trinv_lu_ops_var3
FLA_Error FLA_Trinv_lu_ops_var3( int mn_A,
float* buff_A, int rs_A, int cs_A )
{
float* buff_1 = FLA_FLOAT_PTR( FLA_ONE );
float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
int i;
for ( i = 0; i < mn_A; ++i )
{
float* a10t = buff_A + (0 )*cs_A + (i )*rs_A;
float* A20 = buff_A + (0 )*cs_A + (i+1)*rs_A;
float* 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_sscalv( BLIS1_NO_CONJUGATE,
mn_ahead,
buff_m1,
a21, rs_A );
// FLA_Ger_external( FLA_ONE, a21, a10t, A20 );
bl1_sger( 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
示例8: FLA_Chol_u_opc_var3
FLA_Error FLA_Chol_u_opc_var3( int mn_A,
scomplex* buff_A, int rs_A, int cs_A )
{
float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
int i;
FLA_Error e_val;
for ( i = 0; i < mn_A; ++i )
{
scomplex* alpha11 = buff_A + (i )*cs_A + (i )*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 mn_ahead = mn_A - i - 1;
int mn_behind = i;
/*------------------------------------------------------------*/
// r_val = FLA_Sqrt( alpha11 );
// if ( r_val != FLA_SUCCESS )
// return ( FLA_Obj_length( A00 ) + 1 );
bl1_csqrte( alpha11, &e_val );
if ( e_val != FLA_SUCCESS ) return mn_behind;
// FLA_Inv_scal_external( alpha11, a12t );
bl1_cinvscalv( BLIS1_NO_CONJUGATE,
mn_ahead,
alpha11,
a12t, cs_A );
// FLA_Herc_external( FLA_UPPER_TRIANGULAR, FLA_MINUS_ONE, a12t, A22 );
bl1_cher( BLIS1_UPPER_TRIANGULAR,
BLIS1_CONJUGATE,
mn_ahead,
buff_m1,
a12t, cs_A,
A22, rs_A, cs_A );
/*------------------------------------------------------------*/
}
return FLA_SUCCESS;
}
开发者ID:anaptyxis,项目名称:libflame,代码行数:44,代码来源:FLA_Chol_u_opt_var3.c
示例9: FLA_Ttmm_l_ops_var3
FLA_Error FLA_Ttmm_l_ops_var3( int mn_A,
float* buff_A, int rs_A, int cs_A )
{
float* buff_1 = FLA_FLOAT_PTR( FLA_ONE );
int i;
for ( i = 0; i < mn_A; ++i )
{
float* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
float* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
float* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
int mn_ahead = mn_A - i - 1;
/*------------------------------------------------------------*/
// FLA_Absolute_square( alpha11 );
bl1_sabsqr( alpha11 );
// FLA_Dotcs_external( FLA_CONJUGATE, FLA_ONE, a21, a21, FLA_ONE, alpha11 );
bl1_sdots( 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_strmv( 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
示例10: FLA_Copy_external
FLA_Error FLA_Copy_external( FLA_Obj A, FLA_Obj B )
{
FLA_Datatype dt_A;
FLA_Datatype dt_B;
int m_B, n_B;
int rs_A, cs_A;
int rs_B, cs_B;
trans_t blis_trans;
if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING )
FLA_Copy_check( A, B );
if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
dt_A = FLA_Obj_datatype( A );
dt_B = FLA_Obj_datatype( B );
rs_A = FLA_Obj_row_stride( A );
cs_A = FLA_Obj_col_stride( A );
m_B = FLA_Obj_length( B );
n_B = FLA_Obj_width( B );
rs_B = FLA_Obj_row_stride( B );
cs_B = FLA_Obj_col_stride( B );
if ( FLA_Obj_is_conformal_to( FLA_NO_TRANSPOSE, A, B ) )
FLA_Param_map_flame_to_blis_trans( FLA_NO_TRANSPOSE, &blis_trans );
else // if ( FLA_Obj_is_conformal_to( FLA_TRANSPOSE, A, B ) )
FLA_Param_map_flame_to_blis_trans( FLA_TRANSPOSE, &blis_trans );
// If A is of type FLA_CONSTANT, then we have to proceed based on the
// datatype of B.
if ( dt_A == FLA_CONSTANT )
{
if ( dt_B == FLA_FLOAT )
{
float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
bli_scopymt( blis_trans,
m_B,
n_B,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B );
}
else if ( dt_B == FLA_DOUBLE )
{
double *buff_A = ( double * ) FLA_DOUBLE_PTR( A );
double *buff_B = ( double * ) FLA_DOUBLE_PTR( B );
bli_dcopymt( blis_trans,
m_B,
n_B,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B );
}
else if ( dt_B == FLA_COMPLEX )
{
scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B );
bli_ccopymt( blis_trans,
m_B,
n_B,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B );
}
else if ( dt_B == FLA_DOUBLE_COMPLEX )
{
dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B );
bli_zcopymt( blis_trans,
m_B,
n_B,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B );
}
}
else if ( dt_A == FLA_INT )
{
int* buff_A = ( int * ) FLA_INT_PTR( A );
int* buff_B = ( int * ) FLA_INT_PTR( B );
bli_icopymt( blis_trans,
m_B,
n_B,
buff_A, rs_A, cs_A,
buff_B, rs_B, cs_B );
}
else if ( dt_A == FLA_FLOAT )
{
float *buff_A = ( float * ) FLA_FLOAT_PTR( A );
if ( dt_B == FLA_FLOAT )
{
float *buff_B = ( float * ) FLA_FLOAT_PTR( B );
bli_scopymt( blis_trans,
m_B,
//.........这里部分代码省略.........
开发者ID:pgawron,项目名称:tlash,代码行数:101,代码来源:FLA_Copy_external.c
示例11: FLA_LU_piv_ops_var5
FLA_Error FLA_LU_piv_ops_var5( int m_A,
int n_A,
float* buff_A, int rs_A, int cs_A,
int* buff_p, int inc_p )
{
FLA_Error r_val = FLA_SUCCESS;
float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
int min_m_n = min( m_A, n_A );
int i;
for ( i = 0; i < min_m_n; ++i )
{
float pivot_val = fzero;
float* a10t = buff_A + (0 )*cs_A + (i )*rs_A;
float* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
float* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
float* a12t = buff_A + (i+1)*cs_A + (i )*rs_A;
float* 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_samax( m_ahead + 1,
alpha11, rs_A,
pi1 );
// If a null pivot is encountered, return the index.
pivot_val = *(alpha11 + *pi1);
if ( pivot_val == fzero ) 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_ops_var1( n_A,
a10t, rs_A, cs_A,
0,
0,
pi1, inc_p );
// FLA_Inv_scal_external( alpha11, a21 );
bl1_sinvscalv( BLIS1_NO_CONJUGATE,
m_ahead,
alpha11,
a21, rs_A );
}
// FLA_Ger_external( FLA_MINUS_ONE, a21, a12t, A22 );
bl1_sger( 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,代码行数:71,代码来源:FLA_LU_piv_opt_var5.c
示例12: 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
示例13: FLA_Sort
FLA_Error FLA_Sort( FLA_Direct direct, FLA_Obj x )
{
FLA_Datatype datatype;
FLA_Obj x_use;
dim_t m_x;
dim_t inc_x;
if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
FLA_Sort_check( direct, x );
datatype = FLA_Obj_datatype( x );
m_x = FLA_Obj_vector_dim( x );
inc_x = FLA_Obj_vector_inc( x );
// If the vector does not have unit stride, copy it to a temporary vector
// that does have unit stride.
if ( inc_x != 1 )
{
FLA_Obj_create_copy_of( FLA_NO_TRANSPOSE, x, &x_use );
inc_x = FLA_Obj_vector_inc( x_use );
}
else
{
x_use = x;
}
switch ( datatype )
{
case FLA_FLOAT:
{
float* x_p = ( float* ) FLA_FLOAT_PTR( x_use );
if ( direct == FLA_FORWARD )
FLA_Sort_f_ops( m_x,
x_p, inc_x );
else // if ( direct == FLA_BACKWARD )
FLA_Sort_b_ops( m_x,
x_p, inc_x );
break;
}
case FLA_DOUBLE:
{
double* x_p = ( double* ) FLA_DOUBLE_PTR( x_use );
if ( direct == FLA_FORWARD )
FLA_Sort_f_opd( m_x,
x_p, inc_x );
else // if ( direct == FLA_BACKWARD )
FLA_Sort_b_opd( m_x,
x_p, inc_x );
break;
}
}
if ( inc_x != 1 )
{
FLA_Copy( x_use, x );
FLA_Obj_free( &x_use );
}
return FLA_SUCCESS;
}
开发者ID:pgawron,项目名称:tlash,代码行数:67,代码来源:FLA_Sort.c
示例14: FLA_Hess_UT_step_ops_var4
FLA_Error FLA_Hess_UT_step_ops_var4( int m_A,
int m_T,
float* buff_A, int rs_A, int cs_A,
float* buff_Y, int rs_Y, int cs_Y,
float* buff_Z, int rs_Z, int cs_Z,
float* buff_T, int rs_T, int cs_T )
{
float* buff_2 = FLA_FLOAT_PTR( FLA_TWO );
float* buff_1 = FLA_FLOAT_PTR( FLA_ONE );
float* buff_0 = FLA_FLOAT_PTR( FLA_ZERO );
float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
float first_elem, last_elem;
float dot_product;
float beta, conj_beta;
float inv_tau11;
float minus_inv_tau11;
int i;
// b_alg = FLA_Obj_length( T );
int b_alg = m_T;
// FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &d );
// FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &e );
// FLA_Obj_create( datatype_A, m_A, 1, 0, 0, &f );
float* buff_d = ( float* ) FLA_malloc( m_A * sizeof( *buff_A ) );
float* buff_e = ( float* ) FLA_malloc( m_A * sizeof( *buff_A ) );
float* buff_f = ( float* ) FLA_malloc( m_A * sizeof( *buff_A ) );
int inc_d = 1;
int inc_e = 1;
int inc_f = 1;
// FLA_Set( FLA_ZERO, Y );
// FLA_Set( FLA_ZERO, Z );
bl1_ssetm( m_A,
b_alg,
buff_0,
buff_Y, rs_Y, cs_Y );
bl1_ssetm( m_A,
b_alg,
buff_0,
buff_Z, rs_Z, cs_Z );
for ( i = 0; i < b_alg; ++i )
{
float* a10t = buff_A + (0 )*cs_A + (i )*rs_A;
float* A20 = buff_A + (0 )*cs_A + (i+1)*rs_A;
float* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
float* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
float* A02 = buff_A + (i+1)*cs_A + (0 )*rs_A;
float* a12t = buff_A + (i+1)*cs_A + (i )*rs_A;
float* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
float* y10t = buff_Y + (0 )*cs_Y + (i )*rs_Y;
float* Y20 = buff_Y + (0 )*cs_Y + (i+1)*rs_Y;
float* y21 = buff_Y + (i )*cs_Y + (i+1)*rs_Y;
float* z10t = buff_Z + (0 )*cs_Z + (i )*rs_Z;
float* Z20 = buff_Z + (0 )*cs_Z + (i+1)*rs_Z;
float* z21 = buff_Z + (i )*cs_Z + (i+1)*rs_Z;
float* t01 = buff_T + (i )*cs_T + (0 )*rs_T;
float* tau11 = buff_T + (i )*cs_T + (i )*rs_T;
float* d0 = buff_d + (0 )*inc_d;
float* e0 = buff_e + (0 )*inc_e;
float* f0 = buff_f + (0 )*inc_f;
float* a10t_r = a10t + (i-1)*cs_A + (0 )*rs_A;
float* a21_t = a21 + (0 )*cs_A + (0 )*rs_A;
float* a21_b = a21 + (0 )*cs_A + (1 )*rs_A;
float* ABL = a10t;
float* ZBL = z10t;
float* a2 = alpha11;
int m_ahead = m_A - i - 1;
int n_ahead = m_A - i - 1;
int m_behind = i;
int n_behind = i;
/*------------------------------------------------------------*/
if ( m_behind > 0 )
{
// FLA_Copy( a10t_r, last_elem );
// FLA_Set( FLA_ONE, a10t_r );
last_elem = *a10t_r;
*a10t_r = *buff_1;
}
// FLA_Gemvc( FLA_NO_TRANSPOSE, FLA_CONJUGATE, FLA_MINUS_ONE, ABL, y10t, FLA_ONE, a2 );
// FLA_Gemvc( FLA_NO_TRANSPOSE, FLA_CONJUGATE, FLA_MINUS_ONE, ZBL, a10t, FLA_ONE, a2 );
bl1_sgemv( BLIS1_NO_TRANSPOSE,
BLIS1_CONJUGATE,
m_ahead + 1,
//.........这里部分代码省略.........
开发者ID:anaptyxis,项目名称:libflame,代码行数:101,代码来源:FLA_Hess_UT_opt_var4.c
示例15: 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
示例16: 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
示例17: 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
示例18: FLA_Tridiag_UT_l_step_ops_var2
FLA_Error FLA_Tridiag_UT_l_step_ops_var2( int m_A,
int m_T,
float* buff_A, int rs_A, int cs_A,
float* buff_T, int rs_T, int cs_T )
{
float* buff_2 = FLA_FLOAT_PTR( FLA_TWO );
float* buff_1 = FLA_FLOAT_PTR( FLA_ONE );
float* buff_0 = FLA_FLOAT_PTR( FLA_ZERO );
float* buff_m1 = FLA_FLOAT_PTR( FLA_MINUS_ONE );
float first_elem;
float beta;
float inv_tau11;
float minus_inv_tau11;
float minus_upsilon11, minus_conj_upsilon11;
float 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 );
float* buff_u = ( float* ) FLA_malloc( m_A * sizeof( *buff_A ) );
float* buff_z = ( float* ) FLA_malloc( m_A * sizeof( *buff_A ) );
float* buff_w = ( float* ) 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 )
{
float* A20 = buff_A + (0 )*cs_A + (i+1)*rs_A;
float* alpha11 = buff_A + (i )*cs_A + (i )*rs_A;
float* a21 = buff_A + (i )*cs_A + (i+1)*rs_A;
float* A22 = buff_A + (i+1)*cs_A + (i+1)*rs_A;
float* t01 = buff_T + (i )*cs_T + (0 )*rs_T;
float* tau11 = buff_T + (i )*cs_T + (i )*rs_T;
float* upsilon11= buff_u + (i )*inc_u;
float* u21 = buff_u + (i+1)*inc_u;
float* zeta11 = buff_z + (i )*inc_z;
float* z21 = buff_z + (i+1)*inc_z;
float* w21 = buff_w + (i+1)*inc_w;
float* a21_t = a21 + (0 )*cs_A + (0 )*rs_A;
float* 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_smult3( buff_m1, upsilon11, &minus_upsilon11 );
bl1_scopyconj( &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_smult3( buff_m1, zeta11, &minus_zeta11 );
bl1_scopyconj( &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_saxpyv( BLIS1_CONJUGATE,
1,
&minus_upsilon11,
zeta11, 1,
alpha11, 1 );
bl1_saxpyv( 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_saxpyv( BLIS1_NO_CONJUGATE,
m_ahead,
&minus_conj_zeta11,
u21, inc_u,
a21, rs_A );
bl1_saxpyv( BLIS1_NO_CONJUGATE,
m_ahead,
&minus_conj_upsilon11,
z21, inc_z,
//.........这里部分代码省略.........
开发者ID:alishakiba,项目名称:libflame,代码行数:101,代码来源:FLA_Tridiag_UT_l_opt_var2.c
示例19: 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,
|
请发表评论