FLA_Error FLA_Apply_Q_UT_internal_check( FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj A, FLA_Obj T, FLA_Obj W, FLA_Obj B, fla_apqut_t* cntl )
{
	FLA_Error e_val;

	// Abort if the control structure is NULL.
	e_val = FLA_Check_null_pointer( ( void* ) cntl );
	FLA_Check_error_code( e_val );

	// Verify that the object element types are identical.
	e_val = FLA_Check_identical_object_elemtype( A, T );
	FLA_Check_error_code( e_val );

	e_val = FLA_Check_identical_object_elemtype( A, W );
	FLA_Check_error_code( e_val );

	e_val = FLA_Check_identical_object_elemtype( A, B );
	FLA_Check_error_code( e_val );

	// Verify conformality between all the objects. This check works regardless
	// of whether the element type is FLA_MATRIX or FLA_SCALAR because the
	// element length and width are used instead of scalar length and width.
	if ( side == FLA_LEFT )
	{
		if ( storev == FLA_COLUMNWISE )
		{
			e_val = FLA_Check_object_length_equals( A, FLA_Obj_length( B ) );
			FLA_Check_error_code( e_val );
		}
		else // if ( storev == FLA_ROWWISE )
		{
			e_val = FLA_Check_object_width_equals( A, FLA_Obj_length( B ) );
			FLA_Check_error_code( e_val );
		}
	}
	else // if ( side == FLA_RIGHT )
	{
		if ( storev == FLA_COLUMNWISE )
		{
			e_val = FLA_Check_object_length_equals( A, FLA_Obj_width( B ) );
			FLA_Check_error_code( e_val );
		}
		else // if ( storev == FLA_ROWWISE )
		{
			e_val = FLA_Check_object_width_equals( A, FLA_Obj_width( B ) );
			FLA_Check_error_code( e_val );
		}
	}

	return FLA_SUCCESS;
}
Example #2
0
FLA_Error FLA_Trsm_internal_check( FLA_Side side, FLA_Uplo uplo, FLA_Trans transa, FLA_Diag diag, FLA_Obj alpha, FLA_Obj A, FLA_Obj B, fla_trsm_t* cntl )
{
	FLA_Error e_val;

	// Abort if the control structure is NULL.
	e_val = FLA_Check_null_pointer( ( void* ) cntl );
	FLA_Check_error_code( e_val );

	// Verify that the object element types are identical.
	e_val = FLA_Check_identical_object_elemtype( A, B );
	FLA_Check_error_code( e_val );

	// Verify conformality between all the objects. This check works regardless
	// of whether the element type is FLA_MATRIX or FLA_SCALAR because the
	// element length and width are used instead of scalar length and width.
	if ( side == FLA_LEFT )
	{
		//e_val = FLA_Check_matrix_matrix_dims( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE, A, B, B );
		//FLA_Check_error_code( e_val );
		e_val = FLA_Check_object_length_equals( A, FLA_Obj_length( B ) );
		FLA_Check_error_code( e_val );
	}
	else
	{
		e_val = FLA_Check_matrix_matrix_dims( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE, B, A, B );
		FLA_Check_error_code( e_val );
	}

	return FLA_SUCCESS;
}
FLA_Error FLA_Apply_CAQ_UT_inc_check( FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj A, FLA_Obj ATW, FLA_Obj R, FLA_Obj RTW, FLA_Obj W, FLA_Obj B )
{
  FLA_Error e_val;

  e_val = FLA_Check_valid_leftright_side( side );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_valid_trans( trans );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_valid_direct( direct );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_valid_storev( storev );
  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, ATW );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_identical_object_datatype( A, R );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_identical_object_datatype( A, RTW );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_identical_object_datatype( A, W );
  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, ATW );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_conformal_dims( FLA_NO_TRANSPOSE, A, R );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_conformal_dims( FLA_NO_TRANSPOSE, A, RTW );
  FLA_Check_error_code( e_val );

  if ( side == FLA_LEFT )
  {
    e_val = FLA_Check_object_length_equals( B, FLA_Obj_length( A ) );
    FLA_Check_error_code( e_val );
  }
  else
  {
    FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
  }

  return FLA_SUCCESS;
}
FLA_Error FLA_Bidiag_UT_form_U_check( FLA_Obj A, FLA_Obj T, FLA_Obj U )
{
  FLA_Error e_val;
  dim_t     m_A, n_A;

  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, T );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_identical_object_datatype( A, U );
  FLA_Check_error_code( e_val );

  // U is not necessary to be square.
  // e_val = FLA_Check_square( U );
  // FLA_Check_error_code( e_val );

  m_A = FLA_Obj_length( A );
  n_A = FLA_Obj_width( A );

  // Form U has no problem in overwriting on A which contains house holder vectors
  // on the lower triangular of the diagonal or subdiagonal.
  if ( m_A >= n_A ) 
  {
      e_val = FLA_Check_object_width_equals( T, n_A );
      FLA_Check_error_code( e_val );

      e_val = FLA_Check_object_length_equals( U, m_A );
      FLA_Check_error_code( e_val );
  }
  else
  {
      e_val = FLA_Check_object_width_equals( T, m_A );
      FLA_Check_error_code( e_val );

      e_val = FLA_Check_object_length_equals( U, m_A );
      FLA_Check_error_code( e_val );
  }

  return FLA_SUCCESS;
}
FLA_Error FLA_Apply_CAQ2_UT_internal_check( FLA_Side side, FLA_Trans trans, FLA_Direct direct, FLA_Store storev, FLA_Obj D, FLA_Obj T, FLA_Obj W, FLA_Obj C, FLA_Obj E, fla_apcaq2ut_t* cntl )
{
	FLA_Error e_val;

	// Abort if the control structure is NULL.
	e_val = FLA_Check_null_pointer( ( void* ) cntl );
	FLA_Check_error_code( e_val );

	// Verify that the object element types are identical.
	e_val = FLA_Check_identical_object_elemtype( D, T );
	FLA_Check_error_code( e_val );

	e_val = FLA_Check_identical_object_elemtype( D, W );
	FLA_Check_error_code( e_val );

	e_val = FLA_Check_identical_object_elemtype( D, C );
	FLA_Check_error_code( e_val );

	e_val = FLA_Check_identical_object_elemtype( D, E );
	FLA_Check_error_code( e_val );

	// Verify conformality between all the objects.
	if ( side == FLA_LEFT )
	{
		if ( FLA_Obj_elemtype( D ) == FLA_MATRIX )
		{
			e_val = FLA_Check_conformal_dims( FLA_NO_TRANSPOSE, D, T );
			FLA_Check_error_code( e_val );

			e_val = FLA_Check_conformal_dims( FLA_NO_TRANSPOSE, C, W );
			FLA_Check_error_code( e_val );
		}
		else // if ( FLA_Obj_elemtype( D ) == FLA_SCALAR )
		{
			//e_val = FLA_Check_matrix_matrix_dims( FLA_NO_TRANSPOSE, FLA_TRANSPOSE, E, C, D );
			//FLA_Check_error_code( e_val );

			e_val = FLA_Check_object_width_equals( C, FLA_Obj_width( E ) );
			FLA_Check_error_code( e_val );

			e_val = FLA_Check_object_length_equals( D, FLA_Obj_length( E ) );
			FLA_Check_error_code( e_val );
		}

		//e_val = FLA_Check_matrix_matrix_dims( FLA_NO_TRANSPOSE, FLA_NO_TRANSPOSE, D, C, E );
		//FLA_Check_error_code( e_val );

	}
	else
	{
		FLA_Check_error_code( FLA_NOT_YET_IMPLEMENTED );
	}

	return FLA_SUCCESS;
}
Example #6
0
FLA_Error FLA_Apply_G_check( FLA_Side side, FLA_Direct direct, FLA_Obj G, FLA_Obj A )
{
  FLA_Error e_val;

  e_val = FLA_Check_valid_leftright_side( side );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_valid_direct( direct );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_nonconstant_object( G );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_complex_object( G );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_nonconstant_object( A );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_floating_object( A );
  FLA_Check_error_code( e_val );

  e_val = FLA_Check_identical_object_precision( G, A );
  FLA_Check_error_code( e_val );

  if ( side == FLA_LEFT )
  {
    e_val = FLA_Check_object_length_equals( G, FLA_Obj_length( A ) - 1 );
    FLA_Check_error_code( e_val );
  }
  else // if ( side == FLA_RIGHT )
  {
    e_val = FLA_Check_object_length_equals( G, FLA_Obj_width( A ) - 1 );
    FLA_Check_error_code( e_val );
  }

  return FLA_SUCCESS;
}