libflame
revision_anchor
|
Go to the source code of this file.
FLA_Error FLA_Absolute_square | ( | FLA_Obj | alpha | ) |
References FLA_Absolute_square_check(), FLA_Check_error_level(), FLA_Obj_datatype(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.
Referenced by FLA_Ttmm_l_unb_var1(), FLA_Ttmm_l_unb_var2(), FLA_Ttmm_l_unb_var3(), FLA_Ttmm_u_unb_var1(), FLA_Ttmm_u_unb_var2(), and FLA_Ttmm_u_unb_var3().
{ FLA_Datatype datatype; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Absolute_square_check( alpha ); datatype = FLA_Obj_datatype( alpha ); switch ( datatype ){ case FLA_FLOAT: { float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); *buff_alpha = (*buff_alpha) * (*buff_alpha); break; } case FLA_DOUBLE: { double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); *buff_alpha = (*buff_alpha) * (*buff_alpha); break; } case FLA_COMPLEX: { scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); buff_alpha->real = 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 = buff_alpha->real * buff_alpha->real + buff_alpha->imag * buff_alpha->imag; buff_alpha->imag = 0.0; break; } } return FLA_SUCCESS; }
FLA_Error FLA_Absolute_square_check | ( | FLA_Obj | alpha | ) |
References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().
Referenced by FLA_Absolute_square().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Absolute_value | ( | FLA_Obj | alpha | ) |
References FLA_Absolute_value_check(), FLA_Check_error_level(), FLA_Obj_datatype(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.
Referenced by FLA_Bidiag_UT_l_realify_unb(), FLA_Bidiag_UT_u_realify_unb(), FLA_Tridiag_UT_l_realify_unb(), and FLA_Tridiag_UT_u_realify_unb().
{ 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; }
FLA_Error FLA_Absolute_value_check | ( | FLA_Obj | alpha | ) |
References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().
Referenced by FLA_Absolute_value().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Add_to_diag | ( | void * | diag_value, |
FLA_Obj | A | ||
) |
References FLA_Add_to_diag_check(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_min_dim(), FLA_Obj_row_stride(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.
{ FLA_Datatype datatype; dim_t j, min_m_n; dim_t rs, cs; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Add_to_diag_check( diag_value, A ); datatype = FLA_Obj_datatype( A ); min_m_n = FLA_Obj_min_dim( A ); rs = FLA_Obj_row_stride( A ); cs = FLA_Obj_col_stride( A ); switch ( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *value_ptr = ( float * ) diag_value; for ( j = 0; j < min_m_n; j++ ) buff_A[ j*cs + j*rs ] += *value_ptr; break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *value_ptr = ( double * ) diag_value; for ( j = 0; j < min_m_n; j++ ) buff_A[ j*cs + j*rs ] += *value_ptr; break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *value_ptr = ( scomplex * ) diag_value; for ( j = 0; j < min_m_n; j++ ) { buff_A[ j*cs + j*rs ].real += value_ptr->real; buff_A[ j*cs + j*rs ].imag += value_ptr->imag; } break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *value_ptr = ( dcomplex * ) diag_value; for ( j = 0; j < min_m_n; j++ ) { buff_A[ j*cs + j*rs ].real += value_ptr->real; buff_A[ j*cs + j*rs ].imag += value_ptr->imag; } break; } } return FLA_SUCCESS; }
FLA_Error FLA_Add_to_diag_check | ( | void * | diag_value, |
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_null_pointer().
Referenced by FLA_Add_to_diag().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_null_pointer( diag_value ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
double FLA_Clock | ( | void | ) |
References FLA_Clock_helper().
Referenced by FLASH_Queue_begin(), FLASH_Queue_end(), and FLASH_Queue_exec().
{ return FLA_Clock_helper(); }
References bli_cconjm(), bli_zconjm(), FLA_Check_error_level(), FLA_Conjugate_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_is_real(), FLA_Obj_length(), FLA_Obj_row_stride(), and FLA_Obj_width().
Referenced by FLA_Bidiag_UT_u_step_unb_var3(), and FLA_Bidiag_UT_u_step_unb_var4().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Conjugate_check( A ); if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS; if ( FLA_Obj_is_real( A ) ) return FLA_SUCCESS; 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 ); switch ( datatype ){ case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); bli_cconjm( m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); bli_zconjm( m_A, n_A, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
References FLA_Check_floating_object(), and FLA_Check_nonconstant_object().
Referenced by FLA_Conjugate().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Conjugate_r | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References bli_cconjmr(), bli_zconjmr(), FLA_Check_error_level(), FLA_Conjugate_r_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_is_real(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_uplo().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; uplo_t blis_uplo; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Conjugate_r_check( uplo, A ); if ( FLA_Obj_is_real( A ) ) return FLA_SUCCESS; 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 ); FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo ); switch ( datatype ){ case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); bli_cconjmr( blis_uplo, m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); bli_zconjmr( blis_uplo, m_A, n_A, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Conjugate_r_check | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_valid_uplo().
Referenced by FLA_Conjugate_r().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_cluster_dist | ( | FLA_Obj | n_clusters, |
FLA_Obj | cluster_width, | ||
FLA_Obj | x | ||
) |
References FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_cluster_dist_check(), FLA_Fill_with_linear_dist(), FLA_Fill_with_random_dist(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), FLA_Set(), FLA_Sort(), and FLA_ZERO.
{ FLA_Obj lT, l0, lB, l1, l2; FLA_Obj lT_rest, lT_last; FLA_Obj l, k; FLA_Datatype dt_real; dim_t n_x; int nc; int n_regions; int region_width; int leftover_width; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Fill_with_cluster_dist_check( n_clusters, cluster_width, x ); dt_real = FLA_Obj_datatype_proj_to_real( x ); n_x = FLA_Obj_vector_dim( x ); nc = *FLA_INT_PTR( n_clusters ); n_regions = 2 * nc; region_width = n_x / n_regions; leftover_width = n_x % n_regions; // Create a local counter to increment as we create the distribution. FLA_Obj_create( dt_real, 1, 1, 0, 0, &k ); // Create a local vector l. We will work with this vector, which is // the same length as x, so that we can use vertical partitioning. FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l ); // Initialize k to 1. FLA_Set( FLA_ZERO, k ); FLA_Part_2x1( l, &lT, &lB, 0, FLA_TOP ); while ( FLA_Obj_length( lT ) < n_regions * region_width ) { FLA_Repart_2x1_to_3x1( lT, &l0, /* ** */ /* ******* */ &l1, lB, &l2, region_width, FLA_BOTTOM ); /*------------------------------------------------------------*/ FLA_Fill_with_linear_dist( k, FLA_ONE, l1 ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &lT, l0, l1, /* ** */ /* ******* */ &lB, l2, FLA_TOP ); FLA_Part_2x1( lT, &lT_rest, &lT_last, 1, FLA_BOTTOM ); FLA_Copy( lT_last, k ); FLA_Repart_2x1_to_3x1( lT, &l0, /* ** */ /* ******* */ &l1, lB, &l2, region_width, FLA_BOTTOM ); /*------------------------------------------------------------*/ FLA_Fill_with_random_dist( k, cluster_width, l1 ); FLA_Sort( FLA_FORWARD, l1 ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &lT, l0, l1, /* ** */ /* ******* */ &lB, l2, FLA_TOP ); FLA_Part_2x1( lT, &lT_rest, &lT_last, 1, FLA_BOTTOM ); FLA_Copy( lT_last, k ); FLA_Mult_add( FLA_ONE, FLA_ONE, k ); } if ( leftover_width > 0 ) FLA_Fill_with_linear_dist( k, FLA_ONE, lB ); // Normalize by last element. //FLA_Part_2x1( l, &lT, // &lB, 1, FLA_BOTTOM ); //FLA_Inv_scal( lB, l ); // Overwrite x with the distribution we created in l. FLA_Copy( l, x ); FLA_Obj_free( &l ); FLA_Obj_free( &k ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_cluster_dist_check | ( | FLA_Obj | n_clusters, |
FLA_Obj | cluster_width, | ||
FLA_Obj | x | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_int_object(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Fill_with_cluster_dist().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_int_object( n_clusters ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( cluster_width ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( cluster_width, x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( n_clusters ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( cluster_width ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_vector( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_geometric_dist | ( | FLA_Obj | alpha, |
FLA_Obj | x | ||
) |
References FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_geometric_dist_check(), FLA_MINUS_ONE, FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Pow(), FLA_Repart_2x1_to_3x1(), FLA_Scal(), FLA_Set(), and FLA_ZERO.
{ FLA_Obj lT, l0, lB, lambda1, l2; FLA_Obj l, k, alpha2, temp; FLA_Datatype dt_real; dim_t n_x; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Fill_with_geometric_dist_check( alpha, x ); dt_real = FLA_Obj_datatype_proj_to_real( x ); n_x = FLA_Obj_vector_dim( x ); // Create a local counter to increment as we create the distribution. FLA_Obj_create( dt_real, 1, 1, 0, 0, &k ); // Create a local vector l. We will work with this vector, which is // the same length as x, so that we can use vertical partitioning. FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l ); // Create a local real scalar alpha2 of the same precision as // alpha. Then copy alpha to alpha2, which will convert the // complex value to real, if necessary (ie: if alpha is complex). FLA_Obj_create( dt_real, 1, 1, 0, 0, &alpha2 ); FLA_Copy( alpha, alpha2 ); // Create a temporary scalar. FLA_Obj_create( dt_real, 1, 1, 0, 0, &temp ); // Initialize k to 0. FLA_Set( FLA_ZERO, k ); FLA_Part_2x1( l, &lT, &lB, 0, FLA_TOP ); while ( FLA_Obj_length( lB ) > 0 ) { FLA_Repart_2x1_to_3x1( lT, &l0, /* ** */ /* ******* */ &lambda1, lB, &l2, 1, FLA_BOTTOM ); /*------------------------------------------------------------*/ // lambda1 = alpha * (1 - alpha)^k; FLA_Set( FLA_ONE, temp ); FLA_Mult_add( FLA_MINUS_ONE, alpha2, temp ); FLA_Pow( temp, k, lambda1 ); FLA_Scal( alpha2, lambda1 ); // k = k + 1; FLA_Mult_add( FLA_ONE, FLA_ONE, k ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &lT, l0, lambda1, /* ** */ /* ******* */ &lB, l2, FLA_TOP ); } // Normalize by first element. //FLA_Part_2x1( l, &lT, // &lB, 1, FLA_TOP ); //FLA_Inv_scal( lT, l ); // Overwrite x with the distribution we created in l. // If x is complex, then this is where the conversion between // datatypes happens. FLA_Copy( l, x ); FLA_Obj_free( &l ); FLA_Obj_free( &k ); FLA_Obj_free( &alpha2 ); FLA_Obj_free( &temp ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_geometric_dist_check | ( | FLA_Obj | alpha, |
FLA_Obj | x | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Fill_with_geometric_dist().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( x, alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_vector( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_inverse_dist | ( | FLA_Obj | alpha, |
FLA_Obj | x | ||
) |
References FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_inverse_dist_check(), FLA_Inv_scal(), FLA_Invert(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), and FLA_Set().
{ FLA_Obj lT, l0, lB, lambda1, l2; FLA_Obj l, k, alpha2; FLA_Datatype dt_real; dim_t n_x; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Fill_with_inverse_dist_check( alpha, x ); dt_real = FLA_Obj_datatype_proj_to_real( x ); n_x = FLA_Obj_vector_dim( x ); // Create a local counter to increment as we create the distribution. FLA_Obj_create( dt_real, 1, 1, 0, 0, &k ); // Create a local vector l. We will work with this vector, which is // the same length as x, so that we can use vertical partitioning. FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l ); // Create a local real scalar alpha2 of the same precision as // alpha. Then copy alpha to alpha2, which will convert the // complex value to real, if necessary (ie: if alpha is complex). FLA_Obj_create( dt_real, 1, 1, 0, 0, &alpha2 ); FLA_Copy( alpha, alpha2 ); // Initialize k to 1. FLA_Set( FLA_ONE, k ); FLA_Part_2x1( l, &lT, &lB, 0, FLA_TOP ); while ( FLA_Obj_length( lB ) > 0 ) { FLA_Repart_2x1_to_3x1( lT, &l0, /* ** */ /* ******* */ &lambda1, lB, &l2, 1, FLA_BOTTOM ); /*------------------------------------------------------------*/ // lambda1 = alpha2 / k; FLA_Copy( k, lambda1 ); FLA_Inv_scal( alpha2, lambda1 ); FLA_Invert( FLA_NO_CONJUGATE, lambda1 ); // k = k + 1; FLA_Mult_add( FLA_ONE, FLA_ONE, k ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &lT, l0, lambda1, /* ** */ /* ******* */ &lB, l2, FLA_TOP ); } // Overwrite x with the distribution we created in l. // If x is complex, then this is where the conversion between // datatypes happens. FLA_Copy( l, x ); FLA_Obj_free( &l ); FLA_Obj_free( &k ); FLA_Obj_free( &alpha2 ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_inverse_dist_check | ( | FLA_Obj | alpha, |
FLA_Obj | x | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Fill_with_inverse_dist().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( x, alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_vector( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_linear_dist | ( | FLA_Obj | shift, |
FLA_Obj | delta, | ||
FLA_Obj | x | ||
) |
References FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_linear_dist_check(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Repart_2x1_to_3x1(), and FLA_Set().
Referenced by FLA_Fill_with_cluster_dist().
{ FLA_Obj lT, l0, lB, lambda1, l2; FLA_Obj l, k, delta2; FLA_Datatype dt_real; dim_t n_x; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Fill_with_linear_dist_check( shift, delta, x ); dt_real = FLA_Obj_datatype_proj_to_real( x ); n_x = FLA_Obj_vector_dim( x ); // Create a local counter to increment as we create the distribution. FLA_Obj_create( dt_real, 1, 1, 0, 0, &k ); // Create a local vector l. We will work with this vector, which is // the same length as x, so that we can use vertical partitioning. FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l ); // Create a local real scalar alpha2 of the same precision as // alpha. Then copy alpha to alpha2, which will convert the // complex value to real, if necessary (ie: if alpha is complex). FLA_Obj_create( dt_real, 1, 1, 0, 0, &delta2 ); FLA_Copy( delta, delta2 ); // Initialize k to shift + delta2. FLA_Set( shift, k ); FLA_Mult_add( FLA_ONE, delta2, k ); FLA_Part_2x1( l, &lT, &lB, 0, FLA_TOP ); while ( FLA_Obj_length( lB ) > 0 ) { FLA_Repart_2x1_to_3x1( lT, &l0, /* ** */ /* ******* */ &lambda1, lB, &l2, 1, FLA_BOTTOM ); /*------------------------------------------------------------*/ // lambda1 = k; FLA_Copy( k, lambda1 ); // k = k + delta2; FLA_Mult_add( FLA_ONE, delta2, k ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &lT, l0, lambda1, /* ** */ /* ******* */ &lB, l2, FLA_TOP ); } // Normalize by last element. //FLA_Part_2x1( l, &lT, // &lB, 1, FLA_BOTTOM ); //FLA_Inv_scal( lB, l ); // Overwrite x with the distribution we created in l. // If x is complex, then this is where the conversion between // datatypes happens. FLA_Copy( l, x ); FLA_Obj_free( &l ); FLA_Obj_free( &k ); FLA_Obj_free( &delta2 ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_linear_dist_check | ( | FLA_Obj | shift, |
FLA_Obj | delta, | ||
FLA_Obj | x | ||
) |
References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Fill_with_linear_dist().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( shift ); FLA_Check_error_code( e_val ); e_val = FLA_Check_consistent_object_datatype( shift, delta ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( x, delta ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( shift ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( delta ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_vector( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_logarithmic_dist | ( | FLA_Obj | max, |
FLA_Obj | x | ||
) |
References FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Copy(), FLA_Fill_with_logarithmic_dist_check(), FLA_Inv_scal(), FLA_Mult_add(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_length(), FLA_Obj_vector_dim(), FLA_ONE, FLA_Part_2x1(), FLA_Pow(), FLA_Repart_2x1_to_3x1(), FLA_Set(), and FLA_ZERO.
{ FLA_Obj lT, l0, lB, lambda1, l2; FLA_Obj l, k, alpha2; FLA_Datatype dt_real; dim_t n_x; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Fill_with_logarithmic_dist_check( alpha, x ); dt_real = FLA_Obj_datatype_proj_to_real( x ); n_x = FLA_Obj_vector_dim( x ); // Create a local counter to increment as we create the distribution. FLA_Obj_create( dt_real, 1, 1, 0, 0, &k ); // Create a local vector l. We will work with this vector, which is // the same length as x, so that we can use vertical partitioning. FLA_Obj_create( dt_real, n_x, 1, 0, 0, &l ); // Create a local real scalar alpha2 of the same precision as // alpha. Then copy alpha to alpha2, which will convert the // complex value to real, if necessary (ie: if alpha is complex). FLA_Obj_create( dt_real, 1, 1, 0, 0, &alpha2 ); FLA_Copy( alpha, alpha2 ); // Initialize k to 0. FLA_Set( FLA_ZERO, k ); FLA_Part_2x1( l, &lT, &lB, 0, FLA_TOP ); while ( FLA_Obj_length( lB ) > 0 ) { FLA_Repart_2x1_to_3x1( lT, &l0, /* ** */ /* ******* */ &lambda1, lB, &l2, 1, FLA_BOTTOM ); /*------------------------------------------------------------*/ // lambda1 = alpha^k; FLA_Pow( alpha2, k, lambda1 ); // k = k + 1; FLA_Mult_add( FLA_ONE, FLA_ONE, k ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &lT, l0, lambda1, /* ** */ /* ******* */ &lB, l2, FLA_TOP ); } // Normalize by last element. FLA_Part_2x1( l, &lT, &lB, 1, FLA_BOTTOM ); FLA_Inv_scal( lB, l ); // Overwrite x with the distribution we created in l. FLA_Copy( l, x ); FLA_Obj_free( &l ); FLA_Obj_free( &k ); FLA_Obj_free( &alpha2 ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_logarithmic_dist_check | ( | FLA_Obj | alpha, |
FLA_Obj | x | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Fill_with_logarithmic_dist().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( x, alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_vector( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_random_dist | ( | FLA_Obj | shift, |
FLA_Obj | max, | ||
FLA_Obj | x | ||
) |
References FLA_Axpy(), FLA_Check_error_level(), FLA_Copy(), FLA_Fill_with_random_dist_check(), FLA_Obj_create(), FLA_Obj_datatype_proj_to_real(), FLA_Obj_free(), FLA_Obj_vector_dim(), FLA_ONE, FLA_ONE_HALF, FLA_Random_matrix(), FLA_Scal(), and FLA_Set().
Referenced by FLA_Fill_with_cluster_dist().
{ FLA_Obj r, y; FLA_Datatype dt_real; dim_t n_x; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Fill_with_random_dist_check( shift, max, x ); dt_real = FLA_Obj_datatype_proj_to_real( x ); n_x = FLA_Obj_vector_dim( x ); FLA_Obj_create( dt_real, n_x, 1, 0, 0, &r ); FLA_Obj_create( dt_real, n_x, 1, 0, 0, &y ); FLA_Random_matrix( r ); FLA_Set( FLA_ONE, y ); FLA_Axpy( FLA_ONE, r, y ); FLA_Scal( FLA_ONE_HALF, y ); FLA_Scal( max, y ); FLA_Set( shift, r ); FLA_Axpy( FLA_ONE, y, r ); // Overwrite x with the distribution we created in l. // If x is complex, then this is where the conversion between // datatypes happens. FLA_Copy( r, x ); FLA_Obj_free( &r ); FLA_Obj_free( &y ); return FLA_SUCCESS; }
FLA_Error FLA_Fill_with_random_dist_check | ( | FLA_Obj | shift, |
FLA_Obj | max, | ||
FLA_Obj | x | ||
) |
References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Fill_with_random_dist().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( shift ); FLA_Check_error_code( e_val ); e_val = FLA_Check_consistent_object_datatype( shift, max ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( x, max ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( shift ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( max ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_vector( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Hermitianize | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References bli_csymmize(), bli_dsymmize(), bli_ssymmize(), bli_zsymmize(), FLA_Check_error_level(), FLA_Hermitianize_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), and FLA_Param_map_flame_to_blis_uplo().
Referenced by FLA_Random_herm_matrix(), and FLASH_Hermitianize().
{ FLA_Datatype datatype; dim_t n_A; dim_t rs_A, cs_A; conj_t blis_conj; uplo_t blis_uplo; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Hermitianize_check( uplo, A ); datatype = FLA_Obj_datatype( A ); n_A = FLA_Obj_width( A ); rs_A = FLA_Obj_row_stride( A ); cs_A = FLA_Obj_col_stride( A ); FLA_Param_map_flame_to_blis_conj( FLA_CONJUGATE, &blis_conj ); FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo ); switch ( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); bli_ssymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); bli_dsymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); bli_csymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); bli_zsymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Hermitianize_check | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().
Referenced by FLA_Hermitianize().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_square( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Inv_scal_elemwise | ( | FLA_Trans | trans, |
FLA_Obj | A, | ||
FLA_Obj | B | ||
) |
References bli_cewinvscalmt(), bli_dewinvscalmt(), bli_sewinvscalmt(), bli_zewinvscalmt(), FLA_Check_error_level(), FLA_Inv_scal_elemwise_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_trans().
{ FLA_Datatype datatype; 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_Inv_scal_elemwise_check( trans, A, B ); if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS; datatype = FLA_Obj_datatype( A ); 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 ); FLA_Param_map_flame_to_blis_trans( trans, &blis_trans ); switch ( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_B = ( float * ) FLA_FLOAT_PTR( B ); bli_sewinvscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_B = ( double * ) FLA_DOUBLE_PTR( B ); bli_dewinvscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B ); bli_cewinvscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B ); bli_zewinvscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Inv_scal_elemwise_check | ( | FLA_Trans | trans, |
FLA_Obj | A, | ||
FLA_Obj | B | ||
) |
References FLA_Check_conformal_dims(), FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), FLA_Check_nonconstant_object(), and FLA_Check_valid_trans().
Referenced by FLA_Inv_scal_elemwise().
{ FLA_Error e_val; e_val = FLA_Check_valid_trans( trans ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_datatype( A, B ); FLA_Check_error_code( e_val ); e_val = FLA_Check_conformal_dims( trans, A, B ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Invert | ( | FLA_Conj | conj, |
FLA_Obj | x | ||
) |
References bli_cinvertv(), bli_dinvertv(), bli_sinvertv(), bli_zinvertv(), FLA_Check_error_level(), FLA_Invert_check(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_vector_dim(), FLA_Obj_vector_inc(), and FLA_Param_map_flame_to_blis_conj().
Referenced by FLA_Fill_with_inverse_dist(), FLA_Hevd_compute_scaling(), FLA_Svd_compute_scaling(), FLA_Trinv_ln_unb_var1(), FLA_Trinv_ln_unb_var2(), FLA_Trinv_ln_unb_var3(), FLA_Trinv_ln_unb_var4(), FLA_Trinv_un_unb_var1(), FLA_Trinv_un_unb_var2(), FLA_Trinv_un_unb_var3(), and FLA_Trinv_un_unb_var4().
{ FLA_Datatype datatype; int n_elem; int inc_x; conj_t blis_conj; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Invert_check( conj, x ); if ( FLA_Obj_has_zero_dim( x ) ) return FLA_SUCCESS; datatype = FLA_Obj_datatype( x ); n_elem = FLA_Obj_vector_dim( x ); inc_x = FLA_Obj_vector_inc( x ); FLA_Param_map_flame_to_blis_conj( conj, &blis_conj ); switch ( datatype ){ case FLA_FLOAT: { float *buff_x = ( float * ) FLA_FLOAT_PTR( x ); bli_sinvertv( blis_conj, n_elem, buff_x, inc_x ); break; } case FLA_DOUBLE: { double *buff_x = ( double * ) FLA_DOUBLE_PTR( x ); bli_dinvertv( blis_conj, n_elem, buff_x, inc_x ); break; } case FLA_COMPLEX: { scomplex *buff_x = ( scomplex * ) FLA_COMPLEX_PTR( x ); bli_cinvertv( blis_conj, n_elem, buff_x, inc_x ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_x = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( x ); bli_zinvertv( blis_conj, n_elem, buff_x, inc_x ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Invert_check | ( | FLA_Conj | conj, |
FLA_Obj | x | ||
) |
References FLA_Check_floating_object(), FLA_Check_if_vector(), FLA_Check_nonconstant_object(), and FLA_Check_valid_conj().
Referenced by FLA_Invert().
{ FLA_Error e_val; e_val = FLA_Check_valid_conj( conj ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_vector( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Max_abs_value | ( | FLA_Obj | A, |
FLA_Obj | amax | ||
) |
References bli_cmaxabsm(), bli_dmaxabsm(), bli_smaxabsm(), bli_zmaxabsm(), FLA_Check_error_level(), FLA_Max_abs_value_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.
Referenced by FLA_Norm1(), FLA_Norm_inf(), and FLA_Svd_compute_scaling().
{ FLA_Datatype datatype; FLA_Datatype dt_maxabs; dim_t m_A, n_A; dim_t rs_A, cs_A; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Max_abs_value_check( A, maxabs ); datatype = FLA_Obj_datatype( A ); dt_maxabs = FLA_Obj_datatype( maxabs ); 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 ); switch ( datatype ){ case FLA_FLOAT: { float* buff_A = ( float * ) FLA_FLOAT_PTR( A ); float* buff_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs ); bli_smaxabsm( m_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); break; } case FLA_DOUBLE: { double* buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double* buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs ); bli_dmaxabsm( m_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); break; } case FLA_COMPLEX: { if ( dt_maxabs == FLA_FLOAT ) { scomplex* buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); float* buff_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs ); bli_cmaxabsm( m_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); } else { scomplex* buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex* buff_maxabs = ( scomplex * ) FLA_COMPLEX_PTR( maxabs ); bli_cmaxabsm( m_A, n_A, buff_A, rs_A, cs_A, &(buff_maxabs->real) ); buff_maxabs->imag = 0.0; } break; } case FLA_DOUBLE_COMPLEX: { if ( dt_maxabs == FLA_DOUBLE ) { dcomplex* buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); double* buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs ); bli_zmaxabsm( m_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); } else { dcomplex* buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex* buff_maxabs = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( maxabs ); bli_zmaxabsm( m_A, n_A, buff_A, rs_A, cs_A, &(buff_maxabs->real) ); buff_maxabs->imag = 0.0; } break; } } return FLA_SUCCESS; }
FLA_Error FLA_Max_abs_value_check | ( | FLA_Obj | A, |
FLA_Obj | amax | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().
Referenced by FLA_Max_abs_value().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); // e_val = FLA_Check_real_object( amax ); // FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( A, amax ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( amax ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Max_abs_value_herm | ( | FLA_Uplo | uplo, |
FLA_Obj | A, | ||
FLA_Obj | maxabs | ||
) |
References bli_cmaxabsmr(), bli_dmaxabsmr(), bli_smaxabsmr(), bli_zmaxabsmr(), FLA_Check_error_level(), FLA_Max_abs_value_herm_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Param_map_flame_to_blis_uplo().
Referenced by FLA_Hevd_compute_scaling().
{ FLA_Datatype datatype; dim_t n_A; dim_t rs_A, cs_A; uplo_t blis_uplo; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Max_abs_value_herm_check( uplo, A, maxabs ); datatype = FLA_Obj_datatype( A ); n_A = FLA_Obj_width( A ); rs_A = FLA_Obj_row_stride( A ); cs_A = FLA_Obj_col_stride( A ); 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_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs ); bli_smaxabsmr( blis_uplo, n_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); break; } case FLA_DOUBLE: { double* buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double* buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs ); bli_dmaxabsmr( blis_uplo, n_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); float *buff_maxabs = ( float * ) FLA_FLOAT_PTR( maxabs ); bli_cmaxabsmr( blis_uplo, n_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); double *buff_maxabs = ( double * ) FLA_DOUBLE_PTR( maxabs ); bli_zmaxabsmr( blis_uplo, n_A, n_A, buff_A, rs_A, cs_A, buff_maxabs ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Max_abs_value_herm_check | ( | FLA_Uplo | uplo, |
FLA_Obj | A, | ||
FLA_Obj | maxabs | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), FLA_Check_real_object(), and FLA_Check_valid_uplo().
Referenced by FLA_Max_abs_value_herm().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( maxabs ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( maxabs ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( A, maxabs ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( maxabs ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
double FLA_Max_elemwise_diff | ( | FLA_Obj | A, |
FLA_Obj | B | ||
) |
References FLA_Check_error_level(), FLA_Max_elemwise_diff_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), and FLA_Obj_width().
Referenced by FLASH_Max_elemwise_diff().
{ FLA_Datatype datatype; dim_t i, j; dim_t m_A, n_A; dim_t rs_A, cs_A; dim_t rs_B, cs_B; double diff; double d_max = 0.0; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Max_elemwise_diff_check( A, B ); 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 ); rs_B = FLA_Obj_row_stride( B ); cs_B = FLA_Obj_col_stride( B ); switch ( datatype ){ case FLA_FLOAT: { float *buff_a = ( float * ) FLA_FLOAT_PTR( A ); float *buff_b = ( float * ) FLA_FLOAT_PTR( B ); for( j = 0; j < n_A; j++ ) { for( i = 0; i < m_A; i++ ) { diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ] - buff_b[ j*cs_B + i*rs_B ] ); if( fabs(diff) > d_max ) d_max = fabs(diff); } } break; } case FLA_DOUBLE: { double *buff_a = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_b = ( double * ) FLA_DOUBLE_PTR( B ); for( j = 0; j < n_A; j++ ) { for( i = 0; i < m_A; i++ ) { diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ] - buff_b[ j*cs_B + i*rs_B ] ); if( fabs(diff) > d_max ) d_max = fabs(diff); } } break; } case FLA_COMPLEX: { scomplex *buff_a = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_b = ( scomplex * ) FLA_COMPLEX_PTR( B ); for( j = 0; j < n_A; j++ ) { for( i = 0; i < m_A; i++ ) { diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].real - buff_b[ j*cs_B + i*rs_B ].real ); if( fabs(diff) > d_max ) d_max = fabs(diff); diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].imag - buff_b[ j*cs_B + i*rs_B ].imag ); if( fabs(diff) > d_max ) d_max = fabs(diff); } } break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_a = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_b = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B ); for( j = 0; j < n_A; j++ ) { for( i = 0; i < m_A; i++ ) { diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].real - buff_b[ j*cs_B + i*rs_B ].real ); if( fabs(diff) > d_max ) d_max = fabs(diff); diff = ( double ) ( buff_a[ j*cs_A + i*rs_A ].imag - buff_b[ j*cs_B + i*rs_B ].imag ); if( fabs(diff) > d_max ) d_max = fabs(diff); } } break; } } return d_max; }
References FLA_Check_conformal_dims(), FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), and FLA_Check_nonconstant_object().
Referenced by FLA_Max_elemwise_diff().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_datatype( A, B ); FLA_Check_error_code( e_val ); e_val = FLA_Check_conformal_dims( FLA_NO_TRANSPOSE, A, B ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Mult_add | ( | FLA_Obj | alpha, |
FLA_Obj | beta, | ||
FLA_Obj | gamma | ||
) |
References FLA_Check_error_level(), FLA_Mult_add_check(), FLA_Obj_datatype(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.
Referenced by FLA_Bidiag_UT_u_step_unb_var3(), FLA_Bidiag_UT_u_step_unb_var4(), FLA_Fill_with_cluster_dist(), FLA_Fill_with_geometric_dist(), FLA_Fill_with_inverse_dist(), FLA_Fill_with_linear_dist(), FLA_Fill_with_logarithmic_dist(), FLA_Lyap_h_unb_var1(), FLA_Lyap_h_unb_var2(), FLA_Lyap_h_unb_var3(), FLA_Lyap_h_unb_var4(), FLA_Lyap_n_unb_var1(), FLA_Lyap_n_unb_var2(), FLA_Lyap_n_unb_var3(), and FLA_Lyap_n_unb_var4().
{ FLA_Datatype datatype; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Mult_add_check( alpha, beta, gamma ); datatype = FLA_Obj_datatype( gamma ); switch ( datatype ){ case FLA_FLOAT: { float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); float *buff_beta = ( float * ) FLA_FLOAT_PTR( beta ); float *buff_gamma = ( float * ) FLA_FLOAT_PTR( gamma ); *buff_gamma = *buff_gamma + *buff_alpha * *buff_beta; break; } case FLA_DOUBLE: { double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); double *buff_beta = ( double * ) FLA_DOUBLE_PTR( beta ); double *buff_gamma = ( double * ) FLA_DOUBLE_PTR( gamma ); *buff_gamma = *buff_gamma + *buff_alpha * *buff_beta; break; } case FLA_COMPLEX: { scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); scomplex *buff_beta = ( scomplex * ) FLA_COMPLEX_PTR( beta ); scomplex *buff_gamma = ( scomplex * ) FLA_COMPLEX_PTR( gamma ); scomplex alphabeta; alphabeta.real = buff_alpha->real * buff_beta->real - buff_alpha->imag * buff_beta->imag; alphabeta.imag = buff_alpha->real * buff_beta->imag + buff_alpha->imag * buff_beta->real; buff_gamma->real = buff_gamma->real + alphabeta.real; buff_gamma->imag = buff_gamma->imag + alphabeta.imag; break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha ); dcomplex *buff_beta = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( beta ); dcomplex *buff_gamma = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( gamma ); dcomplex alphabeta; alphabeta.real = buff_alpha->real * buff_beta->real - buff_alpha->imag * buff_beta->imag; alphabeta.imag = buff_alpha->real * buff_beta->imag + buff_alpha->imag * buff_beta->real; buff_gamma->real = buff_gamma->real + alphabeta.real; buff_gamma->imag = buff_gamma->imag + alphabeta.imag; break; } } return FLA_SUCCESS; }
FLA_Error FLA_Mult_add_check | ( | FLA_Obj | alpha, |
FLA_Obj | beta, | ||
FLA_Obj | gamma | ||
) |
References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().
Referenced by FLA_Mult_add().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( beta ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( gamma ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( beta ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( gamma ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( gamma ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Negate | ( | FLA_Obj | x | ) |
References FLA_Check_error_level(), FLA_MINUS_ONE, FLA_Negate_check(), and FLA_Scal().
{ if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Negate_check( x ); return FLA_Scal( FLA_MINUS_ONE, x ); }
References FLA_Check_floating_object(), and FLA_Check_nonconstant_object().
Referenced by FLA_Negate().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References FLA_Asum(), FLA_Check_error_level(), FLA_Cont_with_1x3_to_1x2(), FLA_Max_abs_value(), FLA_Norm1_check(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_width(), FLA_Part_1x2(), and FLA_Repart_1x2_to_1x3().
Referenced by FLASH_Norm1().
{ FLA_Obj AL, AR, A0, a1, A2; FLA_Obj b; FLA_Obj bL, bR, b0, beta1, b2; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Norm1_check( A, norm ); FLA_Obj_create( FLA_Obj_datatype( A ), 1, FLA_Obj_width( A ), 0, 0, &b ); FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT ); FLA_Part_1x2( b, &bL, &bR, 0, FLA_LEFT ); while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){ FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &a1, &A2, 1, FLA_RIGHT ); FLA_Repart_1x2_to_1x3( bL, /**/ bR, &b0, /**/ &beta1, &b2, 1, FLA_RIGHT ); /*------------------------------------------------------------*/ FLA_Asum( a1, beta1 ); /*------------------------------------------------------------*/ FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, a1, /**/ A2, FLA_LEFT ); FLA_Cont_with_1x3_to_1x2( &bL, /**/ &bR, b0, beta1, /**/ b2, FLA_LEFT ); } FLA_Max_abs_value( b, norm ); FLA_Obj_free( &b ); return FLA_SUCCESS; }
FLA_Error FLA_Norm1_check | ( | FLA_Obj | A, |
FLA_Obj | norm | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().
Referenced by FLA_Norm1().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( A, norm ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( norm ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Norm_frob | ( | FLA_Obj | A, |
FLA_Obj | norm | ||
) |
References bli_cfnorm(), bli_dfnorm(), bli_sfnorm(), bli_zfnorm(), FLA_Check_error_level(), FLA_Norm_frob_check(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), and FLA_Obj_width().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Norm_frob_check( A, norm ); 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 ); switch ( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_norm = ( float * ) FLA_FLOAT_PTR( norm ); bli_sfnorm( m_A, n_A, buff_A, rs_A, cs_A, buff_norm ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_norm = ( double * ) FLA_DOUBLE_PTR( norm ); bli_dfnorm( m_A, n_A, buff_A, rs_A, cs_A, buff_norm ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); float *buff_norm = ( float * ) FLA_FLOAT_PTR( norm ); bli_cfnorm( m_A, n_A, buff_A, rs_A, cs_A, buff_norm ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); double *buff_norm = ( double * ) FLA_DOUBLE_PTR( norm ); bli_zfnorm( m_A, n_A, buff_A, rs_A, cs_A, buff_norm ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Norm_frob_check | ( | FLA_Obj | A, |
FLA_Obj | norm | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Norm_frob().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( norm ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( A, norm ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( norm ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Norm_inf | ( | FLA_Obj | A, |
FLA_Obj | norm | ||
) |
References FLA_Asum(), FLA_Check_error_level(), FLA_Cont_with_3x1_to_2x1(), FLA_Max_abs_value(), FLA_Norm_inf_check(), FLA_Obj_create(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_length(), FLA_Part_2x1(), and FLA_Repart_2x1_to_3x1().
{ FLA_Obj AT, A0, AB, a1t, A2; FLA_Obj bT, b0, bB, beta1, b2; FLA_Obj b; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Norm_inf_check( A, norm ); FLA_Obj_create( FLA_Obj_datatype( A ), FLA_Obj_length( A ), 1, 0, 0, &b ); FLA_Part_2x1( A, &AT, &AB, 0, FLA_TOP ); FLA_Part_2x1( b, &bT, &bB, 0, FLA_TOP ); while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) ){ FLA_Repart_2x1_to_3x1( AT, &A0, /* ** */ /* *** */ &a1t, AB, &A2, 1, FLA_BOTTOM ); FLA_Repart_2x1_to_3x1( bT, &b0, /* ** */ /* ***** */ &beta1, bB, &b2, 1, FLA_BOTTOM ); /*------------------------------------------------------------*/ FLA_Asum( a1t, beta1 ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &AT, A0, a1t, /* ** */ /* *** */ &AB, A2, FLA_TOP ); FLA_Cont_with_3x1_to_2x1( &bT, b0, beta1, /* ** */ /* ***** */ &bB, b2, FLA_TOP ); } FLA_Max_abs_value( b, norm ); FLA_Obj_free( &b ); return FLA_SUCCESS; }
FLA_Error FLA_Norm_inf_check | ( | FLA_Obj | A, |
FLA_Obj | norm | ||
) |
References FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_real_object().
Referenced by FLA_Norm_inf().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_real_object( norm ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_precision( A, norm ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( norm ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References FLA_Check_error_level(), FLA_Obj_datatype(), FLA_Pow_check(), scomplex::imag, dcomplex::imag, scomplex::real, and dcomplex::real.
Referenced by FLA_Fill_with_geometric_dist(), and FLA_Fill_with_logarithmic_dist().
{ FLA_Datatype datatype; int r_val = FLA_SUCCESS; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Pow_check( base, exp, btoe ); datatype = FLA_Obj_datatype( base ); switch ( datatype ){ case FLA_FLOAT: { float *buff_base = ( float * ) FLA_FLOAT_PTR( base ); float *buff_exp = ( float * ) FLA_FLOAT_PTR( exp ); float *buff_btoe = ( float * ) FLA_FLOAT_PTR( btoe ); *buff_btoe = ( float ) pow( *buff_base, *buff_exp ); break; } case FLA_DOUBLE: { double *buff_base = ( double * ) FLA_DOUBLE_PTR( base ); double *buff_exp = ( double * ) FLA_DOUBLE_PTR( exp ); double *buff_btoe = ( double * ) FLA_DOUBLE_PTR( btoe ); *buff_btoe = ( double ) pow( *buff_base, *buff_exp ); break; } case FLA_COMPLEX: { scomplex *buff_base = ( scomplex * ) FLA_COMPLEX_PTR( base ); scomplex *buff_exp = ( scomplex * ) FLA_COMPLEX_PTR( exp ); scomplex *buff_btoe = ( scomplex * ) FLA_COMPLEX_PTR( btoe ); buff_btoe->real = ( float ) pow( buff_base->real, buff_exp->real ); buff_btoe->imag = 0.0; break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_base = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( base ); dcomplex *buff_exp = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( exp ); dcomplex *buff_btoe = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( btoe ); buff_btoe->real = ( double ) pow( buff_base->real, buff_exp->real ); buff_btoe->imag = 0.0; break; } } return r_val; }
FLA_Error FLA_Pow_check | ( | FLA_Obj | base, |
FLA_Obj | exp, | ||
FLA_Obj | btoe | ||
) |
References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().
Referenced by FLA_Pow().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( base ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( exp ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( btoe ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( base ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( exp ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( btoe ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( btoe ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
dcomplex FLA_random_dcomplex | ( | void | ) |
References FLA_random_double(), dcomplex::imag, and dcomplex::real.
{ dcomplex z; z.real = FLA_random_double(); z.imag = FLA_random_double(); return z; }
double FLA_random_double | ( | void | ) |
Referenced by FLA_random_dcomplex().
{ return ( ( double ) rand() / ( double ) RAND_MAX ) * 2.0 - 1.0; }
float FLA_random_float | ( | void | ) |
Referenced by FLA_random_scomplex().
{ return ( float )( ( ( double ) rand() / ( double ) RAND_MAX ) * 2.0 - 1.0 ); }
FLA_Error FLA_Random_herm_matrix | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_error_level(), FLA_Hermitianize(), FLA_Random_herm_matrix_check(), and FLA_Random_tri_matrix().
{ if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Random_herm_matrix_check( uplo, A ); FLA_Random_tri_matrix( uplo, FLA_NONUNIT_DIAG, A ); FLA_Hermitianize( uplo, A ); return FLA_SUCCESS; }
FLA_Error FLA_Random_herm_matrix_check | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().
Referenced by FLA_Random_herm_matrix().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_square( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References bli_crandm(), bli_drandm(), bli_srandm(), bli_zrandm(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Random_matrix_check().
Referenced by FLA_Fill_with_random_dist(), FLA_Random_unitary_matrix(), and FLASH_Random_matrix().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Random_matrix_check( A ); 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 ); switch( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); bli_srandm( m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); bli_drandm( m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); bli_crandm( m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); bli_zrandm( m_A, n_A, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
References FLA_Check_floating_object(), and FLA_Check_nonconstant_object().
Referenced by FLA_Random_matrix().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
scomplex FLA_random_scomplex | ( | void | ) |
References FLA_random_float(), scomplex::imag, and scomplex::real.
{ scomplex z; z.real = FLA_random_float(); z.imag = FLA_random_float(); return z; }
FLA_Error FLA_Random_spd_matrix | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_error_level(), FLA_Herk_external(), FLA_Obj_create_conf_to(), FLA_Obj_free(), FLA_ONE, FLA_Random_spd_matrix_check(), FLA_Random_tri_matrix(), and FLA_ZERO.
Referenced by FLASH_Random_spd_matrix().
{ FLA_Obj R; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Random_spd_matrix_check( uplo, A ); // Create a temporary object R conformal to A. FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, A, &R ); // Randomize R to be an uplo-triangular matrix. Note that the diagonal of R // needs to be positive to ensure that R * R' is SPD/HPD. FLA_Random_tri_matrix( uplo, FLA_NONUNIT_DIAG, R ); if ( uplo == FLA_LOWER_TRIANGULAR ) { // A = R * R'; FLA_Herk_external( uplo, FLA_NO_TRANSPOSE, FLA_ONE, R, FLA_ZERO, A ); } else // if ( uplo == FLA_UPPER_TRIANGULAR ) { // A = R' * R; FLA_Herk_external( uplo, FLA_CONJ_TRANSPOSE, FLA_ONE, R, FLA_ZERO, A ); } // Free R. FLA_Obj_free( &R ); return FLA_SUCCESS; }
FLA_Error FLA_Random_spd_matrix_check | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().
Referenced by FLA_Random_spd_matrix().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_square( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Random_symm_matrix | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_error_level(), FLA_Random_symm_matrix_check(), FLA_Random_tri_matrix(), and FLA_Symmetrize().
{ if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Random_symm_matrix_check( uplo, A ); FLA_Random_tri_matrix( uplo, FLA_NONUNIT_DIAG, A ); FLA_Symmetrize( uplo, A ); return FLA_SUCCESS; }
FLA_Error FLA_Random_symm_matrix_check | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().
Referenced by FLA_Random_symm_matrix().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_square( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Random_tri_matrix | ( | FLA_Uplo | uplo, |
FLA_Diag | diag, | ||
FLA_Obj | A | ||
) |
References bli_crandmr(), bli_drandmr(), bli_srandmr(), bli_zrandmr(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_diag(), FLA_Param_map_flame_to_blis_uplo(), and FLA_Random_tri_matrix_check().
Referenced by FLA_Random_herm_matrix(), FLA_Random_spd_matrix(), and FLA_Random_symm_matrix().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; uplo_t blis_uplo; diag_t blis_diag; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Random_tri_matrix_check( uplo, diag, A ); 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 ); FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo ); FLA_Param_map_flame_to_blis_diag( diag, &blis_diag ); switch( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); bli_srandmr( blis_uplo, blis_diag, m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); bli_drandmr( blis_uplo, blis_diag, m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); bli_crandmr( blis_uplo, blis_diag, m_A, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); bli_zrandmr( blis_uplo, blis_diag, m_A, n_A, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Random_tri_matrix_check | ( | FLA_Uplo | uplo, |
FLA_Diag | diag, | ||
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_valid_diag(), and FLA_Check_valid_uplo().
Referenced by FLA_Random_tri_matrix().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_valid_diag( diag ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References FLA_Check_error_level(), FLA_Obj_create_conf_to(), FLA_Obj_free(), FLA_QR_UT(), FLA_QR_UT_create_T(), FLA_QR_UT_form_Q(), FLA_Random_matrix(), and FLA_Random_unitary_matrix_check().
{ FLA_Obj B, T; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Random_unitary_matrix_check( A ); FLA_Obj_create_conf_to( FLA_NO_TRANSPOSE, A, &B ); FLA_Random_matrix( B ); FLA_QR_UT_create_T( B, &T ); FLA_QR_UT( B, T ); FLA_QR_UT_form_Q( B, T, A ); //FLA_Apply_Q_UT_create_workspace( A, T, &W ); //FLA_Apply_Q_UT( FLA_LEFT, FLA_NO_TRANSPOSE, FLA_FORWARD, FLA_COLUMNWISE, B, T, W, A ); //FLA_Obj_free( &W ); FLA_Obj_free( &T ); FLA_Obj_free( &B ); /* FLA_Datatype datatype; FLA_Obj v, tau; FLA_Obj aT, AB; int i, mn; int k; datatype = FLA_Obj_datatype( A ); mn = FLA_Obj_length( A ); k = 1; FLA_Obj_create( datatype, mn-1, 1, 0, 0, &v ); FLA_Obj_create( datatype, 1, 1, 0, 0, &tau ); FLA_Obj_set_to_identity( A ); FLA_Part_2x1( A, &aT, &AB, 1, FLA_TOP ); for ( i = 0; i < k; ++i ) { FLA_Random_matrix( tau ); FLA_Random_matrix( v ); FLA_Apply_H2_UT( FLA_LEFT, tau, v, aT, AB ); } FLA_Obj_free( &tau ); FLA_Obj_free( &v ); */ return FLA_SUCCESS; }
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_square().
Referenced by FLA_Random_unitary_matrix().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_square( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Scal_elemwise | ( | FLA_Trans | trans, |
FLA_Obj | A, | ||
FLA_Obj | B | ||
) |
References bli_cewscalmt(), bli_dewscalmt(), bli_sewscalmt(), bli_zewscalmt(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_trans(), and FLA_Scal_elemwise_check().
{ FLA_Datatype datatype; 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_Scal_elemwise_check( trans, A, B ); if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS; datatype = FLA_Obj_datatype( A ); 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 ); FLA_Param_map_flame_to_blis_trans( trans, &blis_trans ); switch ( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_B = ( float * ) FLA_FLOAT_PTR( B ); bli_sewscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_B = ( double * ) FLA_DOUBLE_PTR( B ); bli_dewscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_B = ( scomplex * ) FLA_COMPLEX_PTR( B ); bli_cewscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_B = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( B ); bli_zewscalmt( blis_trans, m_B, n_B, buff_A, rs_A, cs_A, buff_B, rs_B, cs_B ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Scal_elemwise_check | ( | FLA_Trans | trans, |
FLA_Obj | A, | ||
FLA_Obj | B | ||
) |
References FLA_Check_conformal_dims(), FLA_Check_floating_object(), FLA_Check_identical_object_datatype(), FLA_Check_nonconstant_object(), and FLA_Check_valid_trans().
Referenced by FLA_Scal_elemwise().
{ FLA_Error e_val; e_val = FLA_Check_valid_trans( trans ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_identical_object_datatype( A, B ); FLA_Check_error_code( e_val ); e_val = FLA_Check_conformal_dims( trans, A, B ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Scale_diag | ( | FLA_Conj | conj, |
FLA_Obj | alpha, | ||
FLA_Obj | A | ||
) |
References bli_cscalediag(), bli_csscalediag(), bli_dscalediag(), bli_sscalediag(), bli_zdscalediag(), bli_zscalediag(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), and FLA_Scale_diag_check().
Referenced by FLA_UDdate_UT_unb_var1().
{ FLA_Datatype datatype_A; FLA_Datatype datatype_alpha; dim_t m_A, n_A; dim_t rs_A, cs_A; conj_t blis_conj; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Scale_diag_check( conj, alpha, A ); datatype_A = FLA_Obj_datatype( A ); datatype_alpha = FLA_Obj_datatype( alpha ); 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 ); FLA_Param_map_flame_to_blis_conj( conj, &blis_conj ); switch( datatype_A ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); bli_sscalediag( blis_conj, 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); bli_dscalediag( blis_conj, 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { if ( datatype_alpha == FLA_COMPLEX ) { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); bli_cscalediag( blis_conj, 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); } else { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); bli_csscalediag( blis_conj, 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); } break; } case FLA_DOUBLE_COMPLEX: { if ( datatype_alpha == FLA_DOUBLE_COMPLEX ) { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha ); bli_zscalediag( blis_conj, 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); } else { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); bli_zdscalediag( blis_conj, 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); } break; } } return FLA_SUCCESS; }
FLA_Error FLA_Scale_diag_check | ( | FLA_Conj | conj, |
FLA_Obj | alpha, | ||
FLA_Obj | A | ||
) |
References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), FLA_Check_valid_conj(), and FLA_Obj_is_real().
Referenced by FLA_Scale_diag().
{ FLA_Error e_val; e_val = FLA_Check_valid_conj( conj ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); if ( FLA_Obj_is_real( A ) ) { e_val = FLA_Check_consistent_object_datatype( A, alpha ); FLA_Check_error_code( e_val ); } else { e_val = FLA_Check_identical_object_precision( A, alpha ); FLA_Check_error_code( e_val ); } e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References bli_csetm(), bli_dsetm(), bli_isetm(), bli_ssetm(), bli_zsetm(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Set_check().
Referenced by FLA_Asum_external(), FLA_Bidiag_UT_form_U(), FLA_Bidiag_UT_form_V(), FLA_Bidiag_UT_l_realify_unb(), FLA_Bidiag_UT_realify(), FLA_Bidiag_UT_u_blf_var4(), FLA_Bidiag_UT_u_blk_var4(), FLA_Bidiag_UT_u_blk_var5(), FLA_Bidiag_UT_u_realify_unb(), FLA_Bidiag_UT_u_step_unb_var1(), FLA_Bidiag_UT_u_step_unb_var2(), FLA_Bidiag_UT_u_step_unb_var4(), FLA_Bidiag_UT_u_step_unb_var5(), FLA_Fill_with_cluster_dist(), FLA_Fill_with_geometric_dist(), FLA_Fill_with_inverse_dist(), FLA_Fill_with_linear_dist(), FLA_Fill_with_logarithmic_dist(), FLA_Fill_with_random_dist(), FLA_Hess_UT_blf_var2(), FLA_Hess_UT_blf_var3(), FLA_Hess_UT_blf_var4(), FLA_Hess_UT_blk_var1(), FLA_Hess_UT_blk_var2(), FLA_Hess_UT_blk_var3(), FLA_Hess_UT_blk_var4(), FLA_Hess_UT_step_unb_var1(), FLA_Hess_UT_step_unb_var2(), FLA_Hess_UT_step_unb_var3(), FLA_Hess_UT_step_unb_var4(), FLA_Hess_UT_step_unb_var5(), FLA_Hevd_lv_unb_var1(), FLA_Hevd_lv_unb_var2(), FLA_LQ_UT_solve(), FLA_Nrm2_external(), FLA_Obj_create_buffer_task(), FLA_Obj_extract_imag_part(), FLA_Scal_external(), FLA_Scalc_external(), FLA_Set_to_identity(), FLA_Sylv_unb_external(), FLA_Tridiag_UT_l_blf_var3(), FLA_Tridiag_UT_l_blk_var3(), FLA_Tridiag_UT_l_realify_unb(), FLA_Tridiag_UT_l_step_unb_var1(), FLA_Tridiag_UT_l_step_unb_var2(), FLA_Tridiag_UT_l_step_unb_var3(), FLA_Tridiag_UT_realify(), FLA_Tridiag_UT_u_realify_unb(), FLASH_Norm1(), and FLASH_Set().
{ FLA_Datatype datatype; dim_t m_A, n_A; dim_t rs_A, cs_A; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Set_check( alpha, A ); 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 ); switch ( datatype ){ case FLA_INT: { int *buff_A = ( int * ) FLA_INT_PTR( A ); int *buff_alpha = ( int * ) FLA_INT_PTR( alpha ); bli_isetm( m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); bli_ssetm( m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); bli_dsetm( m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); bli_csetm( m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha ); bli_zsetm( m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Set_check | ( | FLA_Obj | alpha, |
FLA_Obj | A | ||
) |
References FLA_Check_consistent_object_datatype(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_valid_object_datatype().
Referenced by FLA_Set().
{ FLA_Error e_val; e_val = FLA_Check_valid_object_datatype( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_consistent_object_datatype( A, alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Set_diag | ( | FLA_Obj | alpha, |
FLA_Obj | A | ||
) |
References bli_csetdiag(), bli_dsetdiag(), bli_isetdiag(), bli_ssetdiag(), bli_zsetdiag(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), and FLA_Set_diag_check().
Referenced by FLA_LQ_UT_form_Q(), FLA_QR_UT_form_Q(), and FLA_Set_to_identity().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Set_diag_check( alpha, A ); 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 ); switch ( datatype ){ case FLA_INT: { int *buff_A = ( int * ) FLA_INT_PTR( A ); int *buff_alpha = ( int * ) FLA_INT_PTR( alpha ); bli_isetdiag( 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); bli_ssetdiag( 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); bli_dsetdiag( 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); bli_csetdiag( 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha ); bli_zsetdiag( 0, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Set_diag_check | ( | FLA_Obj | alpha, |
FLA_Obj | A | ||
) |
References FLA_Check_consistent_object_datatype(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), and FLA_Check_valid_object_datatype().
Referenced by FLA_Set_diag().
{ FLA_Error e_val; e_val = FLA_Check_valid_object_datatype( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_consistent_object_datatype( A, alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Set_offdiag | ( | int | offset, |
FLA_Obj | alpha, | ||
FLA_Obj | A | ||
) |
References bli_csetdiag(), bli_dsetdiag(), bli_isetdiag(), bli_ssetdiag(), bli_zsetdiag(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), and FLA_Obj_width().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; //if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) // FLA_Set_diag_check( alpha, A ); 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 ); switch ( datatype ){ case FLA_INT: { int *buff_A = ( int * ) FLA_INT_PTR( A ); int *buff_alpha = ( int * ) FLA_INT_PTR( alpha ); bli_isetdiag( offset, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); bli_ssetdiag( offset, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); bli_dsetdiag( offset, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); bli_csetdiag( offset, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha ); bli_zsetdiag( offset, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
References FLA_Check_error_level(), FLA_ONE, FLA_Set(), FLA_Set_diag(), FLA_Set_to_identity_check(), and FLA_ZERO.
Referenced by FLA_Form_perm_matrix(), FLA_Svd_uv_unb_var1(), FLA_Svd_uv_unb_var2(), and FLA_UDdate_UT_unb_var1().
{ if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Set_to_identity_check( A ); FLA_Set( FLA_ZERO, A ); FLA_Set_diag( FLA_ONE, A ); return FLA_SUCCESS; }
References FLA_Check_nonconstant_object(), and FLA_Check_valid_object_datatype().
Referenced by FLA_Set_to_identity().
{ FLA_Error e_val; e_val = FLA_Check_valid_object_datatype( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References bli_csetmr(), bli_dsetmr(), bli_ssetmr(), bli_zsetmr(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_has_zero_dim(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_uplo(), and FLA_Setr_check().
Referenced by FLA_LQ_UT_form_Q(), FLA_QR_UT_form_Q(), FLA_Svd_uv_unb_var1(), and FLA_Svd_uv_unb_var2().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; uplo_t blis_uplo; if ( FLA_Check_error_level() == FLA_FULL_ERROR_CHECKING ) FLA_Setr_check( uplo, alpha, A ); if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS; 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 ); FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo ); switch ( datatype ){ case FLA_FLOAT: { float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); bli_ssetmr( blis_uplo, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); bli_dsetmr( blis_uplo, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); bli_csetmr( blis_uplo, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha ); dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); bli_zsetmr( blis_uplo, m_A, n_A, buff_alpha, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Setr_check | ( | FLA_Uplo | uplo, |
FLA_Obj | alpha, | ||
FLA_Obj | A | ||
) |
References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_valid_uplo().
Referenced by FLA_Setr().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_consistent_object_datatype( alpha, A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Shift_diag | ( | FLA_Conj | conj, |
FLA_Obj | sigma, | ||
FLA_Obj | A | ||
) |
References bli_cshiftdiag(), bli_csshiftdiag(), bli_dshiftdiag(), bli_sshiftdiag(), bli_zdshiftdiag(), bli_zshiftdiag(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), and FLA_Shift_diag_check().
Referenced by FLA_Lyap_h_unb_var1(), FLA_Lyap_h_unb_var2(), FLA_Lyap_h_unb_var3(), FLA_Lyap_h_unb_var4(), FLA_Lyap_n_unb_var1(), FLA_Lyap_n_unb_var2(), FLA_Lyap_n_unb_var3(), FLA_Lyap_n_unb_var4(), and FLASH_Shift_diag().
{ FLA_Datatype datatype_A; FLA_Datatype datatype_sigma; dim_t m_A, n_A; dim_t rs_A, cs_A; conj_t blis_conj; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Shift_diag_check( conj, sigma, A ); datatype_A = FLA_Obj_datatype( A ); datatype_sigma = FLA_Obj_datatype( sigma ); 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 ); FLA_Param_map_flame_to_blis_conj( conj, &blis_conj ); switch( datatype_A ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); float *buff_sigma = ( float * ) FLA_FLOAT_PTR( sigma ); bli_sshiftdiag( blis_conj, 0, m_A, n_A, buff_sigma, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_sigma = ( double * ) FLA_DOUBLE_PTR( sigma ); bli_dshiftdiag( blis_conj, 0, m_A, n_A, buff_sigma, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { if ( datatype_sigma == FLA_COMPLEX ) { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_sigma = ( scomplex * ) FLA_COMPLEX_PTR( sigma ); bli_cshiftdiag( blis_conj, 0, m_A, n_A, buff_sigma, buff_A, rs_A, cs_A ); } else { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); float *buff_sigma = ( float * ) FLA_FLOAT_PTR( sigma ); bli_csshiftdiag( blis_conj, 0, m_A, n_A, buff_sigma, buff_A, rs_A, cs_A ); } break; } case FLA_DOUBLE_COMPLEX: { if ( datatype_sigma == FLA_DOUBLE_COMPLEX ) { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_sigma = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( sigma ); bli_zshiftdiag( blis_conj, 0, m_A, n_A, buff_sigma, buff_A, rs_A, cs_A ); } else { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); double *buff_sigma = ( double * ) FLA_DOUBLE_PTR( sigma ); bli_zdshiftdiag( blis_conj, 0, m_A, n_A, buff_sigma, buff_A, rs_A, cs_A ); } break; } } return FLA_SUCCESS; }
FLA_Error FLA_Shift_diag_check | ( | FLA_Conj | conj, |
FLA_Obj | sigma, | ||
FLA_Obj | A | ||
) |
References FLA_Check_consistent_object_datatype(), FLA_Check_floating_object(), FLA_Check_identical_object_precision(), FLA_Check_if_scalar(), FLA_Check_nonconstant_object(), FLA_Check_valid_conj(), and FLA_Obj_is_real().
Referenced by FLA_Shift_diag().
{ FLA_Error e_val; e_val = FLA_Check_valid_conj( conj ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); if ( FLA_Obj_is_real( A ) ) { e_val = FLA_Check_consistent_object_datatype( A, sigma ); FLA_Check_error_code( e_val ); } else { e_val = FLA_Check_identical_object_precision( A, sigma ); FLA_Check_error_code( e_val ); } e_val = FLA_Check_if_scalar( sigma ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Shift_pivots_to_check | ( | FLA_Pivot_type | ptype, |
FLA_Obj | p | ||
) |
{ FLA_Error e_val; e_val = FLA_Check_valid_pivot_type( ptype ); FLA_Check_error_code( e_val ); e_val = FLA_Check_int_object( p ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( p ); FLA_Check_error_code( e_val ); e_val = FLA_Check_col_vector( p ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Sort | ( | FLA_Direct | direct, |
FLA_Obj | x | ||
) |
References FLA_Check_error_level(), FLA_Copy(), FLA_Obj_create_copy_of(), FLA_Obj_datatype(), FLA_Obj_free(), FLA_Obj_vector_dim(), FLA_Obj_vector_inc(), FLA_Sort_b_opd(), FLA_Sort_b_ops(), FLA_Sort_check(), FLA_Sort_f_opd(), and FLA_Sort_f_ops().
Referenced by FLA_Fill_with_cluster_dist().
{ 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; }
FLA_Error FLA_Sort_b_opd | ( | int | m_x, |
double * | x, | ||
int | inc_x | ||
) |
References fla_dcomp_b().
Referenced by FLA_Sort().
{ qsort( x, m_x, sizeof( double ), fla_dcomp_b ); return FLA_SUCCESS; }
FLA_Error FLA_Sort_b_ops | ( | int | m_x, |
float * | x, | ||
int | inc_x | ||
) |
References fla_scomp_b().
Referenced by FLA_Sort().
{ qsort( x, m_x, sizeof( float ), fla_scomp_b ); return FLA_SUCCESS; }
FLA_Error FLA_Sort_check | ( | FLA_Direct | direct, |
FLA_Obj | x | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_valid_direct().
Referenced by FLA_Sort().
{ FLA_Error e_val; e_val = FLA_Check_valid_direct( direct ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( x ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( x ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Sort_f_opd | ( | int | m_x, |
double * | x, | ||
int | inc_x | ||
) |
References fla_dcomp_f().
Referenced by FLA_Sort().
{ qsort( x, m_x, sizeof( double ), fla_dcomp_f ); return FLA_SUCCESS; }
FLA_Error FLA_Sort_f_ops | ( | int | m_x, |
float * | x, | ||
int | inc_x | ||
) |
References fla_scomp_f().
Referenced by FLA_Sort().
{ qsort( x, m_x, sizeof( float ), fla_scomp_f ); return FLA_SUCCESS; }
References FLA_Check_error_level(), FLA_Obj_datatype(), FLA_Sqrt_check(), scomplex::real, and dcomplex::real.
Referenced by FLA_Chol_l_unb_var1(), FLA_Chol_l_unb_var2(), FLA_Chol_l_unb_var3(), FLA_Chol_u_unb_var1(), FLA_Chol_u_unb_var2(), FLA_Chol_u_unb_var3(), FLA_Hevd_compute_scaling(), and FLA_Svd_compute_scaling().
{ FLA_Datatype datatype; int r_val = FLA_SUCCESS; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Sqrt_check( alpha ); datatype = FLA_Obj_datatype( alpha ); switch ( datatype ){ case FLA_FLOAT: { float *buff_alpha = ( float * ) FLA_FLOAT_PTR( alpha ); if ( *buff_alpha < 0.0F ) r_val = FLA_FAILURE; else *buff_alpha = ( float ) sqrt( *buff_alpha ); break; } case FLA_DOUBLE: { double *buff_alpha = ( double * ) FLA_DOUBLE_PTR( alpha ); if ( *buff_alpha < 0.0 ) r_val = FLA_FAILURE; else *buff_alpha = ( double ) sqrt( *buff_alpha ); break; } case FLA_COMPLEX: { scomplex *buff_alpha = ( scomplex * ) FLA_COMPLEX_PTR( alpha ); if ( buff_alpha->real < 0.0F ) r_val = FLA_FAILURE; else buff_alpha->real = ( float ) sqrt( buff_alpha->real ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_alpha = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( alpha ); if ( buff_alpha->real < 0.0 ) r_val = FLA_FAILURE; else buff_alpha->real = ( double ) sqrt( buff_alpha->real ); break; } } return r_val; }
FLA_Error FLA_Sqrt_check | ( | FLA_Obj | alpha | ) |
References FLA_Check_floating_object(), FLA_Check_if_scalar(), and FLA_Check_nonconstant_object().
Referenced by FLA_Sqrt().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( alpha ); FLA_Check_error_code( e_val ); e_val = FLA_Check_if_scalar( alpha ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
FLA_Error FLA_Swap_t_blk_var1 | ( | FLA_Obj | A, |
FLA_Obj | B, | ||
fla_swap_t * | cntl | ||
) |
References FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Obj_width(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), and FLA_Swapt_external().
Referenced by FLA_Transpose_blk_var1().
{ FLA_Obj AL, AR, A0, A1, A2; FLA_Obj BT, B0, BB, B1, B2; dim_t b; FLA_Part_1x2( A, &AL, &AR, 0, FLA_LEFT ); FLA_Part_2x1( B, &BT, &BB, 0, FLA_TOP ); while ( FLA_Obj_width( AL ) < FLA_Obj_width( A ) ){ b = FLA_Determine_blocksize( AR, FLA_RIGHT, FLA_Cntl_blocksize( cntl ) ); FLA_Repart_1x2_to_1x3( AL, /**/ AR, &A0, /**/ &A1, &A2, b, FLA_RIGHT ); FLA_Repart_2x1_to_3x1( BT, &B0, /* ** */ /* ** */ &B1, BB, &B2, b, FLA_BOTTOM ); /*------------------------------------------------------------*/ FLA_Swapt_external( FLA_TRANSPOSE, A1, B1 ); /*------------------------------------------------------------*/ FLA_Cont_with_1x3_to_1x2( &AL, /**/ &AR, A0, A1, /**/ A2, FLA_LEFT ); FLA_Cont_with_3x1_to_2x1( &BT, B0, B1, /* ** */ /* ** */ &BB, B2, FLA_TOP ); } return FLA_SUCCESS; }
FLA_Error FLA_Swap_t_blk_var2 | ( | FLA_Obj | A, |
FLA_Obj | B, | ||
fla_swap_t * | cntl | ||
) |
References FLA_Cont_with_1x3_to_1x2(), FLA_Cont_with_3x1_to_2x1(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_1x2(), FLA_Part_2x1(), FLA_Repart_1x2_to_1x3(), FLA_Repart_2x1_to_3x1(), and FLA_Swapt_external().
Referenced by FLA_Transpose_blk_var2().
{ FLA_Obj AT, A0, AB, A1, A2; FLA_Obj BL, BR, B0, B1, B2; dim_t b; FLA_Part_2x1( A, &AT, &AB, 0, FLA_TOP ); FLA_Part_1x2( B, &BL, &BR, 0, FLA_LEFT ); while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) ){ b = FLA_Determine_blocksize( AB, FLA_BOTTOM, FLA_Cntl_blocksize( cntl ) ); FLA_Repart_2x1_to_3x1( AT, &A0, /* ** */ /* ** */ &A1, AB, &A2, b, FLA_BOTTOM ); FLA_Repart_1x2_to_1x3( BL, /**/ BR, &B0, /**/ &B1, &B2, b, FLA_RIGHT ); /*------------------------------------------------------------*/ FLA_Swapt_external( FLA_TRANSPOSE, A1, B1 ); /*------------------------------------------------------------*/ FLA_Cont_with_3x1_to_2x1( &AT, A0, A1, /* ** */ /* ** */ &AB, A2, FLA_TOP ); FLA_Cont_with_1x3_to_1x2( &BL, /**/ &BR, B0, B1, /**/ B2, FLA_LEFT ); } return FLA_SUCCESS; }
FLA_Error FLA_Symmetrize | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References bli_csymmize(), bli_dsymmize(), bli_ssymmize(), bli_zsymmize(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_Param_map_flame_to_blis_conj(), FLA_Param_map_flame_to_blis_uplo(), and FLA_Symmetrize_check().
Referenced by FLA_Random_symm_matrix().
{ FLA_Datatype datatype; dim_t n_A; dim_t rs_A, cs_A; conj_t blis_conj; uplo_t blis_uplo; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Symmetrize_check( uplo, A ); datatype = FLA_Obj_datatype( A ); n_A = FLA_Obj_width( A ); rs_A = FLA_Obj_row_stride( A ); cs_A = FLA_Obj_col_stride( A ); FLA_Param_map_flame_to_blis_conj( FLA_NO_CONJUGATE, &blis_conj ); FLA_Param_map_flame_to_blis_uplo( uplo, &blis_uplo ); switch ( datatype ){ case FLA_FLOAT: { float *buff_A = ( float * ) FLA_FLOAT_PTR( A ); bli_ssymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); bli_dsymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); bli_csymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); bli_zsymmize( blis_conj, blis_uplo, n_A, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Symmetrize_check | ( | FLA_Uplo | uplo, |
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_square(), and FLA_Check_valid_uplo().
Referenced by FLA_Symmetrize().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_square( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References FLA_Check_error_level(), FLA_Transpose_blk_var2(), and FLA_Transpose_check().
{ FLA_Error r_val; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Transpose_check( A ); r_val = FLA_Transpose_blk_var2( A, fla_tpose_cntl ); return r_val; }
FLA_Error FLA_Transpose_blk_var1 | ( | FLA_Obj | A, |
fla_tpose_t * | cntl | ||
) |
References FLA_Cont_with_3x3_to_2x2(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), FLA_Swap_t_blk_var1(), and FLA_Transpose_unb_var1().
{ FLA_Obj ATL, ATR, A00, A01, A02, ABL, ABR, A10, A11, A12, A20, A21, A22; dim_t b; FLA_Part_2x2( A, &ATL, &ATR, &ABL, &ABR, 0, 0, FLA_TL ); while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){ b = FLA_Determine_blocksize( ABR, FLA_BR, FLA_Cntl_blocksize( cntl ) ); FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02, /* ************* */ /* ******************** */ &A10, /**/ &A11, &A12, ABL, /**/ ABR, &A20, /**/ &A21, &A22, b, b, FLA_BR ); /*------------------------------------------------------------*/ FLA_Transpose_unb_var1( A11 ); FLA_Swap_t_blk_var1( A10, A01, FLA_Cntl_sub_swap( cntl ) ); /*------------------------------------------------------------*/ FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02, A10, A11, /**/ A12, /* ************** */ /* ****************** */ &ABL, /**/ &ABR, A20, A21, /**/ A22, FLA_TL ); } return FLA_SUCCESS; }
FLA_Error FLA_Transpose_blk_var2 | ( | FLA_Obj | A, |
fla_tpose_t * | cntl | ||
) |
References FLA_Cont_with_3x3_to_2x2(), FLA_Determine_blocksize(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), FLA_Swap_t_blk_var2(), and FLA_Transpose_unb_var2().
Referenced by FLA_Transpose().
{ FLA_Obj ATL, ATR, A00, A01, A02, ABL, ABR, A10, A11, A12, A20, A21, A22; dim_t b; FLA_Part_2x2( A, &ATL, &ATR, &ABL, &ABR, 0, 0, FLA_TL ); while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){ b = FLA_Determine_blocksize( ABR, FLA_BR, FLA_Cntl_blocksize( cntl ) ); FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &A01, &A02, /* ************* */ /* ******************** */ &A10, /**/ &A11, &A12, ABL, /**/ ABR, &A20, /**/ &A21, &A22, b, b, FLA_BR ); /*------------------------------------------------------------*/ FLA_Transpose_unb_var2( A11 ); FLA_Swap_t_blk_var2( A21, A12, FLA_Cntl_sub_swap( cntl ) ); /*------------------------------------------------------------*/ FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, A01, /**/ A02, A10, A11, /**/ A12, /* ************** */ /* ****************** */ &ABL, /**/ &ABR, A20, A21, /**/ A22, FLA_TL ); } return FLA_SUCCESS; }
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), and FLA_Check_square().
Referenced by FLA_Transpose().
{ FLA_Error e_val; e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_square( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }
References FLA_Cont_with_3x3_to_2x2(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), and FLA_Swapt_external().
Referenced by FLA_Transpose_blk_var1().
{ FLA_Obj ATL, ATR, A00, a01, A02, ABL, ABR, a10t, alpha11, a12t, A20, a21, A22; FLA_Part_2x2( A, &ATL, &ATR, &ABL, &ABR, 0, 0, FLA_TL ); while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){ FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02, /* ************* */ /* ************************** */ &a10t, /**/ &alpha11, &a12t, ABL, /**/ ABR, &A20, /**/ &a21, &A22, 1, 1, FLA_BR ); /*------------------------------------------------------------*/ FLA_Swapt_external( FLA_TRANSPOSE, a10t, a01 ); /*------------------------------------------------------------*/ FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02, a10t, alpha11, /**/ a12t, /* ************** */ /* ************************ */ &ABL, /**/ &ABR, A20, a21, /**/ A22, FLA_TL ); } return FLA_SUCCESS; }
References FLA_Cont_with_3x3_to_2x2(), FLA_Obj_length(), FLA_Part_2x2(), FLA_Repart_2x2_to_3x3(), and FLA_Swapt_external().
Referenced by FLA_Transpose_blk_var2().
{ FLA_Obj ATL, ATR, A00, a01, A02, ABL, ABR, a10t, alpha11, a12t, A20, a21, A22; FLA_Part_2x2( A, &ATL, &ATR, &ABL, &ABR, 0, 0, FLA_TL ); while ( FLA_Obj_length( ATL ) < FLA_Obj_length( A ) ){ FLA_Repart_2x2_to_3x3( ATL, /**/ ATR, &A00, /**/ &a01, &A02, /* ************* */ /* ************************** */ &a10t, /**/ &alpha11, &a12t, ABL, /**/ ABR, &A20, /**/ &a21, &A22, 1, 1, FLA_BR ); /*------------------------------------------------------------*/ FLA_Swapt_external( FLA_TRANSPOSE, a21, a12t ); /*------------------------------------------------------------*/ FLA_Cont_with_3x3_to_2x2( &ATL, /**/ &ATR, A00, a01, /**/ A02, a10t, alpha11, /**/ a12t, /* ************** */ /* ************************ */ &ABL, /**/ &ABR, A20, a21, /**/ A22, FLA_TL ); } return FLA_SUCCESS; }
FLA_Error FLA_Triangularize | ( | FLA_Uplo | uplo, |
FLA_Diag | diag, | ||
FLA_Obj | A | ||
) |
References bli_csetdiag(), bli_csetmr(), bli_dsetdiag(), bli_dsetmr(), bli_ssetdiag(), bli_ssetmr(), bli_zsetdiag(), bli_zsetmr(), FLA_Check_error_level(), FLA_Obj_col_stride(), FLA_Obj_datatype(), FLA_Obj_length(), FLA_Obj_row_stride(), FLA_Obj_width(), FLA_ONE, FLA_Param_map_flame_to_blis_uplo(), FLA_Triangularize_check(), and FLA_ZERO.
Referenced by FLA_Bidiag_UT_u_blf_var4(), FLA_Bidiag_UT_u_blk_var4(), FLA_Bidiag_UT_u_blk_var5(), FLA_Hess_UT_blf_var2(), FLA_Hess_UT_blf_var3(), FLA_Hess_UT_blf_var4(), FLA_Hess_UT_blk_var1(), FLA_Hess_UT_blk_var2(), FLA_Hess_UT_blk_var3(), FLA_Hess_UT_blk_var4(), FLA_SA_LU_unb(), FLA_Tridiag_UT_l_blf_var3(), FLA_Tridiag_UT_l_blk_var3(), and FLASH_Triangularize().
{ FLA_Datatype datatype; int m_A, n_A; int rs_A, cs_A; uplo_t blis_uplo; if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING ) FLA_Triangularize_check( uplo, diag, A ); 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 ); // We have to toggle the uplo parameter because we will use it to specify // which triangle to zero out. if ( uplo == FLA_LOWER_TRIANGULAR ) uplo = FLA_UPPER_TRIANGULAR; else uplo = FLA_LOWER_TRIANGULAR; 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_0 = ( float * ) FLA_FLOAT_PTR( FLA_ZERO ); float *buff_1 = ( float * ) FLA_FLOAT_PTR( FLA_ONE ); bli_ssetmr( blis_uplo, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); if ( diag == FLA_UNIT_DIAG ) bli_ssetdiag( 0, m_A, n_A, buff_1, buff_A, rs_A, cs_A ); else if ( diag == FLA_ZERO_DIAG ) bli_ssetdiag( 0, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE: { double *buff_A = ( double * ) FLA_DOUBLE_PTR( A ); double *buff_0 = ( double * ) FLA_DOUBLE_PTR( FLA_ZERO ); double *buff_1 = ( double * ) FLA_DOUBLE_PTR( FLA_ONE ); bli_dsetmr( blis_uplo, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); if ( diag == FLA_UNIT_DIAG ) bli_dsetdiag( 0, m_A, n_A, buff_1, buff_A, rs_A, cs_A ); else if ( diag == FLA_ZERO_DIAG ) bli_dsetdiag( 0, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); break; } case FLA_COMPLEX: { scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A ); scomplex *buff_0 = ( scomplex * ) FLA_COMPLEX_PTR( FLA_ZERO ); scomplex *buff_1 = ( scomplex * ) FLA_COMPLEX_PTR( FLA_ONE ); bli_csetmr( blis_uplo, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); if ( diag == FLA_UNIT_DIAG ) bli_csetdiag( 0, m_A, n_A, buff_1, buff_A, rs_A, cs_A ); else if ( diag == FLA_ZERO_DIAG ) bli_csetdiag( 0, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); break; } case FLA_DOUBLE_COMPLEX: { dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A ); dcomplex *buff_0 = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( FLA_ZERO ); dcomplex *buff_1 = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( FLA_ONE ); bli_zsetmr( blis_uplo, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); if ( diag == FLA_UNIT_DIAG ) bli_zsetdiag( 0, m_A, n_A, buff_1, buff_A, rs_A, cs_A ); else if ( diag == FLA_ZERO_DIAG ) bli_zsetdiag( 0, m_A, n_A, buff_0, buff_A, rs_A, cs_A ); break; } } return FLA_SUCCESS; }
FLA_Error FLA_Triangularize_check | ( | FLA_Uplo | uplo, |
FLA_Diag | diag, | ||
FLA_Obj | A | ||
) |
References FLA_Check_floating_object(), FLA_Check_nonconstant_object(), FLA_Check_valid_diag(), and FLA_Check_valid_uplo().
Referenced by FLA_Triangularize().
{ FLA_Error e_val; e_val = FLA_Check_valid_uplo( uplo ); FLA_Check_error_code( e_val ); e_val = FLA_Check_valid_diag( diag ); FLA_Check_error_code( e_val ); e_val = FLA_Check_floating_object( A ); FLA_Check_error_code( e_val ); e_val = FLA_Check_nonconstant_object( A ); FLA_Check_error_code( e_val ); return FLA_SUCCESS; }