internal static Entry[] NativeEntries(Z3_context ctx, Z3_stats stats) { uint n = Native.Z3_stats_size(ctx, stats); Entry[] res = new Entry[n]; for (uint i = 0; i < n; i++) { Entry e; string k = Native.Z3_stats_get_key(ctx, stats, i); if (Native.Z3_stats_is_uint(ctx, stats, i) != 0) { e = new Entry(k, Native.Z3_stats_get_uint_value(ctx, stats, i)); } else if (Native.Z3_stats_is_double(ctx, stats, i) != 0) { e = new Entry(k, Native.Z3_stats_get_double_value(ctx, stats, i)); } else { throw new Z3Exception("Unknown data entry value"); } res[i] = e; } return(res); }
/// <summary> /// Retrieve statistics as an array of entries /// </summary> /// <param name="stats"></param> /// <returns></returns> public Statistics.Entry[] GetStatistics(Z3_stats stats) { Native.Z3_stats_inc_ref(nCtx, stats); var result = Statistics.NativeEntries(nCtx, stats); Native.Z3_stats_dec_ref(nCtx, stats); return(result); }
public static string Z3_stats_get_key(Z3_context a0, Z3_stats a1, uint a2) { IntPtr r = LIB.Z3_stats_get_key(a0, a1, a2); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); return Marshal.PtrToStringAnsi(r); }
public static double Z3_stats_get_double_value(Z3_context a0, Z3_stats a1, uint a2) { double r = LIB.Z3_stats_get_double_value(a0, a1, a2); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); return r; }
public static void Z3_stats_dec_ref(Z3_context a0, Z3_stats a1) { LIB.Z3_stats_dec_ref(a0, a1); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); }
public static uint Z3_stats_size(Z3_context a0, Z3_stats a1) { uint r = LIB.Z3_stats_size(a0, a1); Z3_error_code err = (Z3_error_code)LIB.Z3_get_error_code(a0); if (err != Z3_error_code.Z3_OK) throw new Z3Exception(Marshal.PtrToStringAnsi(LIB.Z3_get_error_msg_ex(a0, (uint)err))); return r; }
public extern static uint Z3_stats_get_uint_value(Z3_context a0, Z3_stats a1, uint a2);
public extern static double Z3_stats_get_double_value(Z3_context a0, Z3_stats a1, uint a2);
public extern static int Z3_stats_is_double(Z3_context a0, Z3_stats a1, uint a2);
public extern static IntPtr Z3_stats_get_key(Z3_context a0, Z3_stats a1, uint a2);
public extern static uint Z3_stats_size(Z3_context a0, Z3_stats a1);
public extern static void Z3_stats_dec_ref(Z3_context a0, Z3_stats a1);
public extern static IntPtr Z3_stats_to_string(Z3_context a0, Z3_stats a1);