@@ -1831,4 +1831,68 @@ double get_quadratic_term(residual_mtxs_t *res_mtxs, u8 num_dds, double *hypothe
18311831 return quad_term ;
18321832}
18331833
1834+ void print_hyp (void * arg , element_t * elem )
1835+ {
1836+ u8 num_dds = * ( (u8 * ) arg );
1837+
1838+ hypothesis_t * hyp = (hypothesis_t * )elem ;
1839+ printf ("[" );
1840+ for (u8 i = 0 ; i < num_dds ; i ++ ) {
1841+ printf ("%" PRId32 ", " , hyp -> N [i ]);
1842+ }
1843+ printf ("]: %f\n" , hyp -> ll );
1844+ }
1845+
1846+ /** Prints a s64 valued matrix.
1847+ *
1848+ * \param m The number of rows to be printed in the matrices.
1849+ * \param n The number of columns in the matrix.
1850+ * \param mat1 The matrix to be printed.
1851+ */
1852+ static void print_s64_mtx (s64 * mat , u32 m , u32 n )
1853+ {
1854+ for (u32 i = 0 ; i < m ; i ++ ) {
1855+ for (u32 j = 0 ; j < n ; j ++ ) {
1856+ printf ("%" PRId64 ", " , mat [i * n + j ]);
1857+ }
1858+ printf ("\n" );
1859+ }
1860+ printf ("\n" );
1861+ }
1862+
1863+ /* Utilities for debugging inclusion algorithm in ambiguity_test.c */
1864+ static void print_Z (s8 label , u8 full_dim , u8 new_dim , z_t * Z )
1865+ {
1866+ printf ("Z %i:\n" , label );
1867+ print_s64_mtx (Z , full_dim , new_dim );
1868+ }
1869+
1870+ void print_intersection_state (intersection_count_t * x )
1871+ {
1872+ u8 full_dim = x -> old_dim + x -> new_dim ;
1873+
1874+ printf ("itr lower bounds:\n" );
1875+ for (u8 i = 0 ; i < x -> new_dim ; i ++ ) {
1876+ printf ("%" PRIi64 "\n" , x -> itr_lower_bounds [i ]);
1877+ }
1878+ printf ("itr upper bounds:\n" );
1879+ for (u8 i = 0 ; i < x -> new_dim ; i ++ ) {
1880+ printf ("%" PRIi64 "\n" , x -> itr_upper_bounds [i ]);
1881+ }
1882+ printf ("box lower bounds:\n" );
1883+ for (u8 i = 0 ; i < full_dim ; i ++ ) {
1884+ printf ("%" PRIi64 "\n" , x -> box_lower_bounds [i ]);
1885+ }
1886+ printf ("box upper bounds:\n" );
1887+ for (u8 i = 0 ; i < full_dim ; i ++ ) {
1888+ printf ("%" PRIi64 "\n" , x -> box_upper_bounds [i ]);
1889+ }
1890+ printf ("transformation matrix:\n" );
1891+ print_Z (68 , full_dim , x -> new_dim , x -> Z );
1892+ printf ("z1:\n" );
1893+ print_Z (0 , full_dim , full_dim , x -> Z1 );
1894+ printf ("z2_inv:\n" );
1895+ print_Z (0 , x -> new_dim , x -> new_dim , x -> Z2_inv );
1896+ }
1897+
18341898/** \} */
0 commit comments