1 /*
2 
3     Copyright (C) 2014, The University of Texas at Austin
4 
5     This file is part of libflame and is available under the 3-Clause
6     BSD license, which can be found in the LICENSE file at the top-level
7     directory, or at http://opensource.org/licenses/BSD-3-Clause
8 
9 */
10 
11 #include "FLAME.h"
12 
FLA_Conjugate(FLA_Obj A)13 FLA_Error FLA_Conjugate( FLA_Obj A )
14 {
15   FLA_Datatype datatype;
16   int          m_A, n_A;
17   int          rs_A, cs_A;
18 
19   if ( FLA_Check_error_level() >= FLA_MIN_ERROR_CHECKING )
20     FLA_Conjugate_check( A );
21 
22   if ( FLA_Obj_has_zero_dim( A ) ) return FLA_SUCCESS;
23 
24   if ( FLA_Obj_is_real( A ) ) return FLA_SUCCESS;
25 
26   datatype = FLA_Obj_datatype( A );
27 
28   m_A      = FLA_Obj_length( A );
29   n_A      = FLA_Obj_width( A );
30   rs_A     = FLA_Obj_row_stride( A );
31   cs_A     = FLA_Obj_col_stride( A );
32 
33 
34   switch ( datatype ){
35 
36   case FLA_COMPLEX:
37   {
38     scomplex *buff_A = ( scomplex * ) FLA_COMPLEX_PTR( A );
39 
40     bl1_cconjm( m_A,
41                 n_A,
42                 buff_A, rs_A, cs_A );
43 
44     break;
45   }
46 
47   case FLA_DOUBLE_COMPLEX:
48   {
49     dcomplex *buff_A = ( dcomplex * ) FLA_DOUBLE_COMPLEX_PTR( A );
50 
51     bl1_zconjm( m_A,
52                 n_A,
53                 buff_A, rs_A, cs_A );
54 
55     break;
56   }
57 
58   }
59 
60   return FLA_SUCCESS;
61 }
62 
63