diff --git a/pub/lib/opr.cpp b/pub/lib/opr.cpp index fabae83fd1dc0b20fac1f8f96b753579715bf4ff..97cc46ce2ef325bbbb6d5cd60f83d2740ee04e38 100644 --- a/pub/lib/opr.cpp +++ b/pub/lib/opr.cpp @@ -283,9 +283,9 @@ void NOperate::Integral() else fout = POld((dynamic_cast<const COld*>(fin))->new_POld()); fout->log_action("oi " + expr); - fout->ZCo.pop_back(); fout->xco = fin->ZCo.back(); fout->yco = T->node_coord(k); + fout->ZCo.pop_back(); sout = PSpec(new CSpec); sout->z = fin->V[0]->z; sout->z.pop_back(); @@ -300,14 +300,14 @@ void NOperate::Integral() cout << "result: " << res->to_s() << "\n"; continue; } - xval = fin->V[j]->z[nz - 1]->to_r(); + xval = fin->V[j]->z[nz-1]->to_r(); sout->push_xyd(xval, res->to_r(), res->to_dr()); - if (nz >= 2) { // new spectrum if jump in other z values - double zval = fin->V[j]->z[nz - 2]->to_r(); - if (j + 1 < fin->nJ() && fin->V[j + 1]->z[nz - 2]->to_r() != zval) { + if (nz > 1) { // new spectrum if jump in other z values + if (j+1 < fin->nJ() + && fin->V[j+1]->z[nz-2]->to_r() != fin->V[j]->z[nz-2]->to_r()) { fout->V.push_back(move(sout)); sout = PSpec(new CSpec); - sout->z = fin->V[j + 1]->z; + sout->z = fin->V[j+1]->z; sout->z.pop_back(); } } @@ -350,22 +350,22 @@ void NOperate::IntXY(string mode) if (icold < 0) return; } - xco = CCoord("x", ""); - yco = CCoord("y", ""); while (const COld* fin = fiter.nextD()) { - int nz = fin->ZCo.size(); - POld fout(fin->new_POld()); string lin = S("oi") + mode + " " + S(icolx) + " " + S(icoly); if (with_d) lin += " " + S(icold); fout->log_action(lin); - fout->xco = xco; - fout->yco = yco; + fout->xco = CCoord("x", ""); + fout->yco = CCoord("y", ""); + fout->ZCo.pop_back(); + int nz = fin->ZCo.size(); PSpec sout(new CSpec); + sout->z = fin->V[0]->z; + sout->z.pop_back(); for (int j = 0; j < fin->nJ(); j++) { int n = fin->nPts(j); @@ -376,11 +376,13 @@ void NOperate::IntXY(string mode) else sout->push_xy(fin->VS(j)->y[icolx], fin->VS(j)->y[icoly]); sout->z = fin->VS(j)->z; - if (nz > 2) { // new spectrum if jump in other z value - if (j + 1 < fin->nJ() - && fin->V[j + 1]->z[nz - 2]->to_r() != fin->V[j]->z[nz - 2]->to_r()) { + if (nz > 1) { // new spectrum if jump in other z value + if (j+1 < fin->nJ() + && fin->V[j+1]->z[nz-2]->to_r() != fin->V[j]->z[nz-2]->to_r()) { fout->V.push_back(move(sout)); sout = PSpec(new CSpec); + sout->z = fin->V[j+1]->z; + sout->z.pop_back(); } } } @@ -389,7 +391,6 @@ void NOperate::IntXY(string mode) } } - //************************************************************************************************** //* functional operations //**************************************************************************************************