static void info (I) { iam (Thing); MelderInfo_writeLine2 (L"Object type: ", Thing_className (me)); MelderInfo_writeLine2 (L"Object name: ", my name ? my name : L"<no name>"); time_t today = time (NULL); MelderInfo_writeLine2 (L"Date: ", Melder_peekUtf8ToWcs (ctime (& today))); /* Includes a newline. */ }
static void info (I) { iam (RealTier); classFunction -> info (me); MelderInfo_writeLine2 (L"Number of points: ", Melder_integer (my points -> size)); MelderInfo_writeLine2 (L"Minimum value: ", Melder_double (RealTier_getMinimumValue (me))); MelderInfo_writeLine2 (L"Maximum value: ", Melder_double (RealTier_getMaximumValue (me))); }
void structWordList :: v_info () { structData :: v_info (); long n = WordList_count (this); if (! length) length = wcslen (string); MelderInfo_writeLine2 (L"Number of words: ", Melder_integer (n)); MelderInfo_writeLine2 (L"Number of characters: ", Melder_integer (length - n)); }
void structTube :: v_info () { structData :: v_info (); MelderInfo_writeLine5 (L"Time domain: ", Melder_double (xmin), L" to ", Melder_double (xmax), L" seconds"); MelderInfo_writeLine2 (L"Maximum number of segments: ", Melder_integer (maxnSegments)); MelderInfo_writeLine2 (L"Number of frames: ", Melder_integer (nx)); MelderInfo_writeLine3 (L"Time step: ", Melder_double (dx), L" seconds"); MelderInfo_writeLine3 (L"First frame at: ", Melder_double (x1), L" seconds"); }
static void info (I) { iam (CCA); classData -> info (me); MelderInfo_writeLine2 (L"Number of coefficients: ", Melder_integer (my numberOfCoefficients)); MelderInfo_writeLine2 (L"ny: ", Melder_integer (my y -> dimension)); MelderInfo_writeLine2 (L"nx: ", Melder_integer (my x -> dimension)); }
void structCC :: v_info () { structData :: v_info (); MelderInfo_writeLine5 (L"Time domain:", Melder_double (xmin), L" to ", Melder_double (xmax), L" seconds"); MelderInfo_writeLine2 (L"Number of frames: ", Melder_integer (nx)); MelderInfo_writeLine3 (L"Time step: ", Melder_double (dx), L" seconds"); MelderInfo_writeLine3 (L"First frame at: ", Melder_double (x1), L" seconds"); MelderInfo_writeLine2 (L"Number of coefficients: ", Melder_integer (maximumNumberOfCoefficients)); MelderInfo_writeLine3 (L"Minimum frequency: ", Melder_double (fmin), L" Hz"); MelderInfo_writeLine3 (L"Maximum frequency: ", Melder_double (fmax), L" Hz"); }
int Praat_tests (int itest, wchar_t *arg1, wchar_t *arg2, wchar_t *arg3, wchar_t *arg4) { long i, n = wcstol (arg1, NULL, 10); double x; (void) arg1; (void) arg2; (void) arg3; (void) arg4; Melder_clearInfo (); Melder_stopwatch (); switch (itest) { case kPraatTests_CHECK_RANDOM_1009_2009: { NUMrandomRestart (310952); for (i = 1; i <= 1009 * 2009 - 100 + 1; i ++) x = NUMrandomFraction (); MelderInfo_writeLine1 (Melder_double (x)); } break; case kPraatTests_TIME_RANDOM_FRACTION: { for (i = 1; i <= n; i ++) (void) NUMrandomFraction (); } break; case kPraatTests_TIME_SORT: { long m = wcstol (arg2, NULL, 10); long *array = NUMlvector (1, m); for (i = 1; i <= m; i ++) array [i] = NUMrandomInteger (1, 100); Melder_stopwatch (); for (i = 1; i <= n; i ++) NUMsort_l (m, array); NUMlvector_free (array, 1); } break; } MelderInfo_writeLine2 (Melder_single (Melder_stopwatch () / n * 1e9), L" nanoseconds"); MelderInfo_close (); return 1; }
void Thing_infoWithId (I, unsigned long id) { iam (Thing); Melder_clearInfo (); MelderInfo_open (); if (id != 0) MelderInfo_writeLine2 (L"Object id: ", Melder_integer (id)); our info (me); /* This calls a set of MelderInfo_writeXXX. */ MelderInfo_close (); }
void structSpectrumTier :: v_info () { structData :: v_info (); MelderInfo_writeLine1 (L"Frequency domain:"); MelderInfo_writeLine3 (L" Lowest frequency: ", Melder_double (xmin), L" Hz"); MelderInfo_writeLine3 (L" Highest frequency: ", Melder_double (xmax), L" Hz"); MelderInfo_writeLine3 (L" Total bandwidth: ", Melder_double (xmax - xmin), L" Hz"); MelderInfo_writeLine2 (L"Number of points: ", Melder_integer (points -> size)); MelderInfo_writeLine3 (L"Minimum power value: ", Melder_double (RealTier_getMinimumValue (this)), L" dB/Hz"); MelderInfo_writeLine3 (L"Maximum power value: ", Melder_double (RealTier_getMaximumValue (this)), L" dB/Hz"); }
void structPitchTier :: v_info () { structData :: v_info (); MelderInfo_writeLine1 (L"Time domain:"); MelderInfo_writeLine3 (L" Start time: ", Melder_double (xmin), L" seconds"); MelderInfo_writeLine3 (L" End time: ", Melder_double (xmax), L" seconds"); MelderInfo_writeLine3 (L" Total duration: ", Melder_double (xmax - xmin), L" seconds"); MelderInfo_writeLine2 (L"Number of points: ", Melder_integer (points -> size)); MelderInfo_writeLine3 (L"Minimum pitch value: ", Melder_double (RealTier_getMinimumValue (this)), L" Hz"); MelderInfo_writeLine3 (L"Maximum pitch value: ", Melder_double (RealTier_getMaximumValue (this)), L" Hz"); }
static void info (I) { iam (FFNet); classData -> info (me); MelderInfo_writeLine2 (L"Number of layers: ", Melder_integer (my nLayers)); MelderInfo_writeLine2 (L"Total number of units: ", Melder_integer (FFNet_getNumberOfUnits (me))); MelderInfo_writeLine4 (L" Number of units in layer ", Melder_integer (my nLayers), L" (output): ", Melder_integer (my nUnitsInLayer[my nLayers])); for (int i = my nLayers-1; i >= 1; i--) { MelderInfo_writeLine4 (L" Number of units in layer ", Melder_integer (i), L" (hidden): ", Melder_integer (my nUnitsInLayer[i])); } MelderInfo_writeLine2 (L" Number of units in layer 0 (input): ", Melder_integer (my nUnitsInLayer[0])); MelderInfo_writeLine2 (L"Outputs are linear: ", Melder_boolean (my outputsAreLinear)); MelderInfo_writeLine5 (L"Number of weights: ", Melder_integer (my nWeights), L" (", Melder_integer (FFNet_dimensionOfSearchSpace (me)), L" selected)"); MelderInfo_writeLine2 (L"Number of nodes: ", Melder_integer (my nNodes)); }
void structFormant :: v_info () { structData :: v_info (); MelderInfo_writeLine1 (L"Time domain:"); MelderInfo_writeLine3 (L" Start time: ", Melder_double (xmin), L" seconds"); MelderInfo_writeLine3 (L" End time: ", Melder_double (xmax), L" seconds"); MelderInfo_writeLine3 (L" Total duration: ", Melder_double (xmax - xmin), L" seconds"); MelderInfo_writeLine1 (L"Time sampling:"); MelderInfo_writeLine2 (L" Number of frames: ", Melder_integer (nx)); MelderInfo_writeLine3 (L" Time step: ", Melder_double (dx), L" seconds"); MelderInfo_writeLine3 (L" First frame centred at: ", Melder_double (x1), L" seconds"); }
void structRegression :: v_info () { Regression_Parent :: v_info (); MelderInfo_writeLine1 (L"Factors:"); MelderInfo_writeLine2 (L" Number of factors: ", Melder_integer (parameters -> size)); for (long ivar = 1; ivar <= parameters -> size; ivar ++) { RegressionParameter parm = static_cast<RegressionParameter> (parameters -> item [ivar]); MelderInfo_writeLine4 (L" Factor ", Melder_integer (ivar), L": ", parm -> label); } MelderInfo_writeLine1 (L"Fitted coefficients:"); MelderInfo_writeLine2 (L" Intercept: ", Melder_double (intercept)); for (long ivar = 1; ivar <= parameters -> size; ivar ++) { RegressionParameter parm = static_cast<RegressionParameter> (parameters -> item [ivar]); MelderInfo_writeLine4 (L" Coefficient of factor ", parm -> label, L": ", Melder_double (parm -> value)); } MelderInfo_writeLine1 (L"Ranges of values:"); for (long ivar = 1; ivar <= parameters -> size; ivar ++) { RegressionParameter parm = static_cast<RegressionParameter> (parameters -> item [ivar]); MelderInfo_writeLine6 (L" Range of factor ", parm -> label, L": minimum ", Melder_double (parm -> minimum), L", maximum ", Melder_double (parm -> maximum)); } }
void structLogisticRegression :: v_info () { LogisticRegression_Parent :: v_info (); MelderInfo_writeLine2 (L"Dependent 1: ", dependent1); MelderInfo_writeLine2 (L"Dependent 2: ", dependent2); MelderInfo_writeLine1 (L"Interpretation:"); MelderInfo_write6 (L" ln (P(", dependent2, L")/P(", dependent1, L")) " UNITEXT_ALMOST_EQUAL_TO L" ", Melder_fixed (intercept, 6)); for (long ivar = 1; ivar <= parameters -> size; ivar ++) { RegressionParameter parm = static_cast<RegressionParameter> (parameters -> item [ivar]); MelderInfo_write4 (parm -> value < 0.0 ? L" - " : L" + ", Melder_fixed (fabs (parm -> value), 6), L" * ", parm -> label); } MelderInfo_writeLine1 (NULL); MelderInfo_writeLine1 (L"Log odds ratios:"); for (long ivar = 1; ivar <= parameters -> size; ivar ++) { RegressionParameter parm = static_cast<RegressionParameter> (parameters -> item [ivar]); MelderInfo_writeLine4 (L" Log odds ratio of factor ", parm -> label, L": ", Melder_fixed ((parm -> maximum - parm -> minimum) * parm -> value, 6)); } MelderInfo_writeLine1 (L"Odds ratios:"); for (long ivar = 1; ivar <= parameters -> size; ivar ++) { RegressionParameter parm = static_cast<RegressionParameter> (parameters -> item [ivar]); MelderInfo_writeLine4 (L" Odds ratio of factor ", parm -> label, L": ", Melder_double (exp ((parm -> maximum - parm -> minimum) * parm -> value))); } }
void structLtas :: v_info () { double meanPowerDensity; structData :: v_info (); MelderInfo_writeLine1 (L"Frequency domain:"); MelderInfo_writeLine3 (L" Lowest frequency: ", Melder_double (xmin), L" Hz"); MelderInfo_writeLine3 (L" Highest frequency: ", Melder_double (xmax), L" Hz"); MelderInfo_writeLine3 (L" Total frequency domain: ", Melder_double (xmax - xmin), L" Hz"); MelderInfo_writeLine1 (L"Frequency sampling:"); MelderInfo_writeLine2 (L" Number of frequency bands: ", Melder_integer (nx)); MelderInfo_writeLine3 (L" Width of each band: ", Melder_double (dx), L" Hz"); MelderInfo_writeLine3 (L" First band centred at: ", Melder_double (x1), L" Hz"); meanPowerDensity = Sampled_getMean (this, xmin, xmax, 0, 1, FALSE); MelderInfo_writeLine3 (L"Total SPL: ", Melder_single (10.0 * log10 (meanPowerDensity * (xmax - xmin))), L" dB"); }
static void info (I) { iam (Ltas); double meanPowerDensity; classData -> info (me); MelderInfo_writeLine1 (L"Frequency domain:"); MelderInfo_writeLine3 (L" Lowest frequency: ", Melder_double (my xmin), L" Hz"); MelderInfo_writeLine3 (L" Highest frequency: ", Melder_double (my xmax), L" Hz"); MelderInfo_writeLine3 (L" Total frequency domain: ", Melder_double (my xmax - my xmin), L" Hz"); MelderInfo_writeLine1 (L"Frequency sampling:"); MelderInfo_writeLine2 (L" Number of frequency bands: ", Melder_integer (my nx)); MelderInfo_writeLine3 (L" Width of each band: ", Melder_double (my dx), L" Hz"); MelderInfo_writeLine3 (L" First band centred at: ", Melder_double (my x1), L" Hz"); meanPowerDensity = Sampled_getMean (me, my xmin, my xmax, 0, 1, FALSE); MelderInfo_writeLine3 (L"Total SPL: ", Melder_single (10 * log10 (meanPowerDensity * (my xmax - my xmin))), L" dB"); }
void structFileInMemory :: v_info () { structData :: v_info (); MelderInfo_writeLine2 (L"File name: ", d_path); MelderInfo_writeLine2 (L"Id: ", d_id); MelderInfo_writeLine2 (L"Number of bytes: ", Melder_integer (d_numberOfBytes)); }
static void info (I) { iam (Index); classData -> info (me); MelderInfo_writeLine2 (L"Number of elements: ", Melder_integer (my numberOfElements)); }
static void info (I) { iam (Sound); const double rho_c = 400; /* rho = 1.14 kg m-3; c = 353 m s-1; [rho c] = kg m-2 s-1 */ long numberOfSamples = my nx; double minimum = my z [1] [1], maximum = minimum; classData -> info (me); MelderInfo_writeLine3 (L"Number of channels: ", Melder_integer (my ny), my ny == 1 ? L" (mono)" : my ny == 2 ? L" (stereo)" : L""); MelderInfo_writeLine1 (L"Time domain:"); MelderInfo_writeLine3 (L" Start time: ", Melder_double (my xmin), L" seconds"); MelderInfo_writeLine3 (L" End time: ", Melder_double (my xmax), L" seconds"); MelderInfo_writeLine3 (L" Total duration: ", Melder_double (my xmax - my xmin), L" seconds"); MelderInfo_writeLine1 (L"Time sampling:"); MelderInfo_writeLine2 (L" Number of samples: ", Melder_integer (my nx)); MelderInfo_writeLine3 (L" Sampling period: ", Melder_double (my dx), L" seconds"); MelderInfo_writeLine3 (L" Sampling frequency: ", Melder_single (1.0 / my dx), L" Hz"); MelderInfo_writeLine3 (L" First sample centred at: ", Melder_double (my x1), L" seconds"); double sum = 0.0, sumOfSquares = 0.0; for (long channel = 1; channel <= my ny; channel ++) { double *amplitude = my z [channel]; for (long i = 1; i <= numberOfSamples; i ++) { double value = amplitude [i]; sum += value; sumOfSquares += value * value; if (value < minimum) minimum = value; if (value > maximum) maximum = value; } } MelderInfo_writeLine1 (L"Amplitude:"); MelderInfo_writeLine3 (L" Minimum: ", Melder_single (minimum), L" Pascal"); MelderInfo_writeLine3 (L" Maximum: ", Melder_single (maximum), L" Pascal"); double mean = sum / (my nx * my ny); MelderInfo_writeLine3 (L" Mean: ", Melder_single (mean), L" Pascal"); MelderInfo_writeLine3 (L" Root-mean-square: ", Melder_single (sqrt (sumOfSquares / (my nx * my ny))), L" Pascal"); double penergy = sumOfSquares * my dx / my ny; /* Pa2 s = kg2 m-2 s-3 */ MelderInfo_write3 (L"Total energy: ", Melder_single (penergy), L" Pascal\u00B2 sec"); double energy = penergy / rho_c; /* kg s-2 = Joule m-2 */ MelderInfo_writeLine3 (L" (energy in air: ", Melder_single (energy), L" Joule/m\u00B2)"); double power = energy / (my dx * my nx); /* kg s-3 = Watt/m2 */ MelderInfo_write3 (L"Mean power (intensity) in air: ", Melder_single (power), L" Watt/m\u00B2"); if (power != 0.0) { MelderInfo_writeLine3 (L" = ", Melder_half (10 * log10 (power / 1e-12)), L" dB"); } else { MelderInfo_writeLine1 (L""); } if (my nx > 1) { for (long channel = 1; channel <= my ny; channel ++) { double *amplitude = my z [channel]; double sum = 0.0; for (long i = 1; i <= numberOfSamples; i ++) { double value = amplitude [i]; sum += value; } double mean = sum / my nx, stdev = 0.0; for (long i = 1; i <= numberOfSamples; i ++) { double value = amplitude [i] - mean; stdev += value * value; } stdev = sqrt (stdev / (my nx - 1)); MelderInfo_writeLine5 (L"Standard deviation in channel ", Melder_integer (channel), L": ", Melder_single (stdev), L" Pascal"); } } }
void structOrderedOfString :: v_info () { structData :: v_info (); MelderInfo_writeLine2 (L"Number of strings: ", Melder_integer (size)); autoOrderedOfString uStrings = OrderedOfString_selectUniqueItems (this, 1); MelderInfo_writeLine2 (L"Number of unique categories: ", Melder_integer (uStrings -> size)); }
void structPermutation :: v_info () { structData :: v_info (); MelderInfo_writeLine2 (L"Number of elements: ", Melder_integer (numberOfElements)); }
void structConfiguration :: v_info () { structData :: v_info (); MelderInfo_writeLine2 (L"Number of points: ", Melder_integer (numberOfRows)); MelderInfo_writeLine2 (L"Number of dimensions: ", Melder_integer (numberOfColumns)); MelderInfo_writeLine2 (L"Metric: ", Melder_integer (metric)); }
void structTransition :: v_info () { structData :: v_info (); MelderInfo_writeLine2 (L"Number of states: ", Melder_integer (numberOfStates)); }