libflame  revision_anchor
Functions
FLASH_Max_elemwise_diff.c File Reference

(r)

Functions

double FLASH_Max_elemwise_diff (FLA_Obj A, FLA_Obj B)
 

Function Documentation

◆ FLASH_Max_elemwise_diff()

double FLASH_Max_elemwise_diff ( FLA_Obj  A,
FLA_Obj  B 
)

References FLA_Max_elemwise_diff(), FLA_Obj_free(), FLA_Obj_has_zero_dim(), and FLASH_Obj_create_flat_copy_of_hier().

14 {
15  FLA_Obj A_flat, B_flat;
16  double max_diff;
17 
18  // Exit early if one dimension is zero.
19  if ( FLA_Obj_has_zero_dim( A ) ) return -1.0;
20 
21  // Create a temporary flat copy of the hierarchical objects.
24 
25  // Get the maximum element-wise diff.
26  max_diff = FLA_Max_elemwise_diff( A_flat, B_flat );
27 
28  // Free the temporary flat objects.
29  FLA_Obj_free( &A_flat );
30  FLA_Obj_free( &B_flat );
31 
32  return max_diff;
33 }
FLA_Error FLA_Obj_free(FLA_Obj *obj)
Definition: FLA_Obj.c:588
Definition: FLA_type_defs.h:158
double FLA_Max_elemwise_diff(FLA_Obj A, FLA_Obj B)
Definition: FLA_Max_elemwise_diff.c:13
FLA_Bool FLA_Obj_has_zero_dim(FLA_Obj A)
Definition: FLA_Query.c:400
FLA_Error FLASH_Obj_create_flat_copy_of_hier(FLA_Obj H, FLA_Obj *F)
Definition: FLASH_Obj.c:623