void printResults(Array<double>& results, Array<Array<char> >& sourcedata, Array<Array<char> >& templatedata) { int i; double value; cout << "**simil"; if (sequenceQ) { cout << "\t**seq"; } cout << endl; int len = templatedata.getSize(); for (i=0; i<results.getSize(); i++) { value = results[i]; if (normalize1(value, len) < threshold) { cout << "."; if (sequenceQ) { cout << "\t"; cout << "."; cout << "\n"; } else { cout << "\n"; } continue; } if (rawQ) { cout << value; } else if (scalingQ) { value = normalize1(value, len); value = int(value * 100.0 + 0.5) / 100.0; printf("%.2lf", value); } else { value = int(value * 100.0 + 0.5) / 100.0; value = normalize2(value, len); printf("%.2lf", value); } if (sequenceQ) { cout << "\t"; printSequence(sourcedata, i, templatedata.getSize(), spacesQ); } cout << "\n"; } int dots = templatedata.getSize() - 1; for (i=0; i<dots; i++) { cout << "."; if (sequenceQ) { cout << "\t."; } cout << "\n"; } cout << "*-"; if (sequenceQ) { cout << "\t*-"; } cout << endl; }
void MakeRR(RR& z, const ZZ& a, long e) { if (e >= NTL_OVFBND) ResourceError("MakeRR: e too big"); if (e <= -NTL_OVFBND) ResourceError("MakeRR: e too small"); normalize1(z, a, e, RR::prec, 0); }
void printResultsSubString(Array<Array<double> >& results, Array<Array<char> >& sourcedata, Array<Array<char> >& templatedata) { int i; double value; cout << "**simil\t**simxrf" << endl; int len = xlen; if (len <= 0) { len = templatedata.getSize(); } int maxi; for (i=0; i<results.getSize(); i++) { maxi = getMinIndex(results[i]); value = results[i][maxi]; if (rawQ) { cout << value; } else if (scalingQ) { value = normalize1(value, len); value = int(value * 100.0 + 0.5) / 100.0; printf("%.2lf", value); } else { value = int(value * 100.0 + 0.5) / 100.0; value = normalize2(value, len); printf("%.2lf", value); } cout << "\t"; printSubStringInfo(results[i], results[i][maxi]); cout << "\n"; } // int dots = templatedata.getSize() - 1; int dots = xlen - 1; for (i=0; i<dots; i++) { cout << ".\t.\n"; } cout << "*-\t*-" << endl; }
void normalize(RR& z, const RR& y, long residual = 0) { normalize1(z, y.x, y.e, RR::prec, residual); }
void conv(RR& z, const ZZ& a) { normalize1(z, a, 0, RR::prec, 0); }