Skip to content
Snippets Groups Projects
Commit 320110cd authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

restored oi and oixy (untested)

parent 87835ad5
No related branches found
No related tags found
No related merge requests found
...@@ -168,7 +168,9 @@ void NOperate::Pointwise( string llabel ) ...@@ -168,7 +168,9 @@ void NOperate::Pointwise( string llabel )
POlc fc = P2C( fin ); POlc fc = P2C( fin );
POlo fout( fin->new_olo() ); POlo fout( fin->new_olo() );
fout->lDoc.push_back( "o" + lref.ref_info() + " " + expr);
if( lref.var!=CRef::_FP )
fout->lDoc.push_back( "o" + lref.ref_info() + " " + expr);
if ( lref.pointwise() && !fd ) if ( lref.pointwise() && !fd )
throw string( "no pointwise operation on curve" ); throw string( "no pointwise operation on curve" );
...@@ -233,67 +235,57 @@ void NOperate::Integral(void) ...@@ -233,67 +235,57 @@ void NOperate::Integral(void)
{ {
NOlm::SelAssert(); NOlm::SelAssert();
throw string( "TODO broken after V rewrite" );
/*
string expr = sask( "Functional ?" ); string expr = sask( "Functional ?" );
if ( expr=="" ) return; if ( expr=="" ) return;
PTree T; PTree T;
user_xaxparse( expr.c_str(), &T ); user_xaxparse( expr.c_str(), &T );
NOlm::IterateD fiter; NOlm::IterateO fiter;
COld *fin, fout; POlo fin;
COlo *f;
CSpec S;
CCoord zco;
double xval, zval, result;
bool savable;
uint k, nz;
while( (fin=fiter()) ) { while( (fin=fiter()) ) {
k = fiter.k(); uint k = fiter.k();
nz = fin->ZCo.size(); uint nz = fin->ZCo.size();
savable = nz > 0; bool savable = nz > 0;
fout = *fin; POld fd = P2D( fin );
f = (COlo*) fin; POlc fc = P2C( fin );
fout->VS.clear();
if (savable) {
fout->lDoc.push_back( "oi " +expr );
zco = fin->ZCo.back(); POlo fout( fin->new_olo() );
fout->ZCo.pop_back();
fout->xco = zco;
T->coord(&(fout->yco), k); fout->lDoc.push_back( "oi " +expr );
}
fout->ZCo.pop_back();
fout->xco = fin->ZCo.back();
T->coord( &(fout->yco), k );
PSpec sout( new CSpec );
sout->z = fin->V[0]->z;
sout->z.pop_back();
S.clear(); for ( uint j=0; j<fin->nJ(); j++ ) {
S.z = fin->VS[0].z; double xval, zval, result;
S.z.pop_back();
for ( uint j=0; j<fin->nSpec(); j++ ) {
T->tree_point_val( &result, k, j ); T->tree_point_val( &result, k, j );
if (!savable) { if (!savable) {
cout << "results: " << result << "\n"; cout << "result: " << result << "\n";
break; continue;
} }
xval = fin->VS[j].z[nz-1]; xval = fin->V[j]->z[nz-1];
S.push_xy( xval, result ); sout->push_xy( xval, result );
if (nz>=2) { // new spectrum if jump in other z values if (nz>=2) { // new spectrum if jump in other z values
zval = fin->VS[j].z[nz-2]; zval = fin->V[j]->z[nz-2];
if ((j+1)<fin->VS.size() && if ( j+1 < fin->nJ() && fin->V[j+1]->z[nz-2] != zval ) {
fin->VS[j+1].z[nz-2]!=zval) { fout->V.push_back( sout );
fout->VS.push_back( S ); sout = PSpec( new CSpec );
S.clear(); sout->z = fin->V[j+1]->z;
S.z = fin->VS[j+1].z; sout->z.pop_back();
S.z.pop_back();
} }
} }
} }
if ( savable ) { if ( savable ) {
fout->VS.push_back( S ); fout->V.push_back( sout );
NOlm::OloAdd( fout ); NOlm::OloAdd( fout, fiter.k() );
} }
} }
*/
}; };
...@@ -303,8 +295,6 @@ void NOperate::IntXY(void) ...@@ -303,8 +295,6 @@ void NOperate::IntXY(void)
{ {
NOlm::SelAssert(); NOlm::SelAssert();
throw string( "TODO broken after V rewrite" );
/*
static int icolx = 0, icoly = 1; static int icolx = 0, icoly = 1;
static CCoord xco, yco; static CCoord xco, yco;
icolx = iask( "x from column", icolx ); icolx = iask( "x from column", icolx );
...@@ -315,49 +305,42 @@ void NOperate::IntXY(void) ...@@ -315,49 +305,42 @@ void NOperate::IntXY(void)
yco = CCoord( "y", "" ); // .Ask( "y coordinate", ASK_DEF_GIVEN, yco ); yco = CCoord( "y", "" ); // .Ask( "y coordinate", ASK_DEF_GIVEN, yco );
NOlm::IterateD fiter; NOlm::IterateD fiter;
COld *fin, fout; POld fin;
COlo *f;
CSpec S;
CCoord zco;
double zval;
uint k, nz, n;
while( (fin=fiter()) ) { while( (fin=fiter()) ) {
k = fiter.k(); uint nz = fin->ZCo.size();
nz = fin->ZCo.size();
if( nz<1 ) if( nz<1 )
throw "no z in file " + strg(fiter.k()); throw "no z in file " + strg(fiter.k());
fout = *fin;
f = (COlo*) fin; POld fout( new COld( *fin ) );
fout->VS.clear(); fout->V.clear();
fout->lDoc.push_back( "oixy " + strg(icolx) + " " + strg(icoly) ); fout->lDoc.push_back( "oixy " + strg(icolx) + " " + strg(icoly) );
fout->ZCo.pop_back(); fout->ZCo.pop_back();
fout->xco = xco; fout->xco = xco;
fout->yco = yco; fout->yco = yco;
S.clear();
if( !(fin->nSpec()) ) PSpec sout( new CSpec );
throw string( "input file has no spectra" ); sout->z = fin->V[0]->z;
S.z = fin->VS[0].z; sout->z.pop_back();
S.z.pop_back();
for (uint j=0; j<fin->nSpec(); j++) { for ( uint j=0; j<fin->nJ(); j++ ) {
n = fin->VS[j].size(); uint n = fin->nPts(j);
if( icolx>=n || icoly>=n ) if( icolx>=n || icoly>=n )
throw "not enough columns in spectrum " + strg(j); throw "not enough columns in spectrum " + strg(j);
S.push_xy( fin->VS[j].y[icolx], fin->VS[j].y[icoly] ); sout->push_xy( fin->VS(j)->y[icolx], fin->VS(j)->y[icoly] );
if (nz>=2) { // new spectrum if jump in other z values if (nz>=2) { // new spectrum if jump in other z values
zval = fin->VS[j].z[nz-2]; double zval = fin->V[j]->z[nz-2];
if ((j+1)<fin->VS.size() && if ( j+1 < fin->nJ() && fin->V[j+1]->z[nz-2] != zval) {
fin->VS[j+1].z[nz-2]!=zval) { fout->V.push_back( sout );
fout->VS.push_back(S); sout = PSpec( new CSpec );
S.clear(); sout->z = fin->V[j+1]->z;
S.z = fin->VS[j+1].z; sout->z.pop_back();
S.z.pop_back();
} }
} }
} }
fout->VS.push_back(S); fout->V.push_back( sout );
NOlm::OloAdd( fout ); NOlm::OloAdd( fout, fiter.k() );
} }
*/
}; };
......
...@@ -46,7 +46,7 @@ void NSpecial::FourierCosine(void) ...@@ -46,7 +46,7 @@ void NSpecial::FourierCosine(void)
n = sin->size(); n = sin->size();
plan = fftw_plan_r2r_1d( plan = fftw_plan_r2r_1d(
n, &(Sin->y[0]), &(Sout->y[0]), n, &(sin->y[0]), &(sout->y[0]),
FFTW_REDFT00, FFTW_ESTIMATE); FFTW_REDFT00, FFTW_ESTIMATE);
nold = n; // currently not used nold = n; // currently not used
fftw_execute( plan ); fftw_execute( plan );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment