From 10e5138c171175a169419383e886b42f7134d28f Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Sun, 25 Oct 2015 11:58:50 +0100 Subject: [PATCH] corrections R -> P --- pub/lib/curve.cpp | 12 ++++++------ pub/lib/curve.hpp | 2 +- pub/lib/file_out.cpp | 41 ++++++++++++++++++++--------------------- pub/lib/mem.cpp | 4 ++-- pub/lib/node.cpp | 8 ++++---- pub/lib/node.hpp | 8 ++++---- pub/lib/plot.cpp | 12 ++++++------ 7 files changed, 43 insertions(+), 44 deletions(-) diff --git a/pub/lib/curve.cpp b/pub/lib/curve.cpp index 4a6f015c..a0725743 100644 --- a/pub/lib/curve.cpp +++ b/pub/lib/curve.cpp @@ -41,7 +41,7 @@ void NCurveFile::create_fitcurve() fc->curve_query( "Curve definition" ); fc->curve_set_defaults(); - while( POld fd = fiter() ) { + while( ROld fd = fiter() ) { POlc fout( fc->new_olc() ); vector<double> P( fout->nP, 1.0 ); fout->name = string("fit_") + fd->name; @@ -255,7 +255,7 @@ void NCurveFile::set_properties( string which ) void NCurveFile::pars_query() { NOlm::IterateC fiter; - while( POlc fin=fiter() ) { + while( ROlc fin=fiter() ) { for( int ip=0; ip<fin->nP; ++ip ) NOperate::Pointwise( "p" + S(ip) ); } @@ -312,7 +312,7 @@ void NCurveFile::pars_copy() CContext ctx( fiter.k(), j ); int k2 = Tk->tree_val_idx( ctx, "K" ); int j2 = Tj->tree_val_idx( ctx, "J" ); - POlc f2 = NOlm::mem_get_C( k2 ); + ROlc f2 = NOlm::mem_get_C( k2 ); if( j2>=f2->nJ() ) throw "no curve " + S(j2) + " in file " + S(k2); for( int ip: vsel->v ) { @@ -329,13 +329,13 @@ void NCurveFile::pars_copy() void NCurveFile::show_pars() { NOlm::IterateC fiter; - while( POlc fin=fiter() ) + while( ROlc fin=fiter() ) fin->print_info_table(); } //! Sets resolution file reference *sv, *kv, *jv. -void NCurveFile::get_conv( PSpec *sv, int *kv, int *jv, int k, int j ) +void NCurveFile::get_conv( RSpec *sv, int *kv, int *jv, int k, int j ) { // set *kv and *fv for given k: POlc fc = NOlm::mem_get_C(k); @@ -344,7 +344,7 @@ void NCurveFile::get_conv( PSpec *sv, int *kv, int *jv, int k, int j ) *jv = -1; // should not be needed return; } - POld fv = NOlm::mem_get_D(*kv); + ROld fv = NOlm::mem_get_D(*kv); // set *jv and *sv for given j: if ( j>=fc->nJ() ) diff --git a/pub/lib/curve.hpp b/pub/lib/curve.hpp index 80c6f042..596157fc 100644 --- a/pub/lib/curve.hpp +++ b/pub/lib/curve.hpp @@ -26,5 +26,5 @@ namespace NCurveFile { void edit_pars(); void set_par_attr( char attr ); - void get_conv( PSpec *sv, int *kv, int *jv, int k, int j ); + void get_conv( RSpec *sv, int *kv, int *jv, int k, int j ); } diff --git a/pub/lib/file_out.cpp b/pub/lib/file_out.cpp index aa67d816..1fa8dd80 100644 --- a/pub/lib/file_out.cpp +++ b/pub/lib/file_out.cpp @@ -23,10 +23,10 @@ #include "file_out.hpp" namespace NFileOut { - void save_yda( std::ofstream& ofs, POlo f ); - void save_y08( FILE *file, POlo f ); - void save_csv( FILE *file, POlo f ); - void save_tab( FILE *file, POlo f ); + void save_yda( std::ofstream& ofs, ROlo f ); + void save_y08( FILE *file, ROlo f ); + void save_csv( FILE *file, ROlo f ); + void save_tab( FILE *file, ROlo f ); } @@ -36,8 +36,7 @@ void NFileOut::save( string fmt, bool allow_overwrite ) { string outfnam; NOlm::IterateO iter; - POlo f; - while( (f=iter()) ) { + while( POlo f=iter() ) { // query output file name outfnam = wask( "Save as (."+fmt+")", f->name); if ( outfnam=="" ) @@ -81,10 +80,10 @@ void NFileOut::save( string fmt, bool allow_overwrite ) //! Writes a file in format y15. -void NFileOut::save_yda( std::ofstream& ofs, POlo f ) +void NFileOut::save_yda( std::ofstream& ofs, ROlo f ) { - POld fd = P2D( f ); - POlc fc = P2C( f ); + ROld fd = R2D( f ); + ROlc fc = R2C( f ); YAML::Emitter out; out << YAML::BeginMap; @@ -171,10 +170,10 @@ void NFileOut::save_yda( std::ofstream& ofs, POlo f ) //! Writes a file in format y08. -void NFileOut::save_y08( FILE *file, POlo f ) +void NFileOut::save_y08( FILE *file, ROlo f ) { - POld fd = P2D( f ); - POlc fc = P2C( f ); + ROld fd = R2D( f ); + ROlc fc = R2C( f ); fprintf( file, "Meta:\n" " format: frida/y08 for yaml1\n" @@ -211,7 +210,7 @@ void NFileOut::save_y08( FILE *file, POlo f ) for( int j=0; j<f->nJ(); j++ ){ fprintf( file, " - # table %i\n", j ); - PSlice s = f->V[j]; + RSlice s = f->V[j]; for ( int i=0; i<f->nZ(); i++ ) { if( RObjNum pz = PCAST<const CObjNum>(s->z[i]) ) { fprintf( file, " z%i: %18.10g\n", i, pz->to_r() ); @@ -221,7 +220,7 @@ void NFileOut::save_y08( FILE *file, POlo f ) fprintf( file, " z%i: %s\n", i, s->z[i]->to_s().c_str() ); } if ( fd ) { - PSpec s = fd->VS(j); + RSpec s = fd->VS(j); if( s->dy.size() ) { fprintf( file, " xyd: |2 # %i entries\n", (int)s->size() ); for( int i=0; i<s->size(); i++ ) @@ -234,7 +233,7 @@ void NFileOut::save_y08( FILE *file, POlo f ) s->x[i], s->y[i] ); } } else { - PCurve s = fc->VC(j); + RCurve s = fc->VC(j); for ( int i=0; i<fc->nP; i++ ) fprintf( file, " p%i: %18.10g\n", i, s->P[i] ); } @@ -244,10 +243,10 @@ void NFileOut::save_y08( FILE *file, POlo f ) //! Writes y as tab-separated table. -void NFileOut::save_csv( FILE *file, POlo f ) +void NFileOut::save_csv( FILE *file, ROlo f ) { - POld fd = P2D( f ); - POlc fc = P2C( f ); + ROld fd = R2D( f ); + ROlc fc = R2C( f ); if( !fd ) throw S("csv save not implemented for non-data files"); for( int j=0; j<f->nJ(); j++ ){ @@ -261,10 +260,10 @@ void NFileOut::save_csv( FILE *file, POlo f ) //! Writes data as x-y columns with z header lines. -void NFileOut::save_tab( FILE *file, POlo f ) +void NFileOut::save_tab( FILE *file, ROlo f ) { - POld fd = P2D( f ); - POlc fc = P2C( f ); + ROld fd = R2D( f ); + ROlc fc = R2C( f ); if( !fd ) throw S("tab save not implemented for non-data files"); for( int j=0; j<f->nJ(); j++ ){ diff --git a/pub/lib/mem.cpp b/pub/lib/mem.cpp index e6d393bc..b45c64eb 100644 --- a/pub/lib/mem.cpp +++ b/pub/lib/mem.cpp @@ -314,7 +314,7 @@ namespace NOlm { void mem_copy() { IterateO fiter; - while ( POlo fin=fiter() ){ + while ( ROlo fin=fiter() ){ POlo fout( fin->new_olo( false ) ); fout->copy_mainvec( fin ); mem_store( fout ); @@ -341,7 +341,7 @@ namespace NOlm { { BAK.clear(); IterateO fiter; - while ( POlo fin=fiter() ){ + while ( ROlo fin=fiter() ){ POlo fout( fin->new_olo( false ) ); fout->copy_mainvec( fin ); BAK.push_back( fout ); diff --git a/pub/lib/node.cpp b/pub/lib/node.cpp index 8a7a4c3a..4274bcb8 100644 --- a/pub/lib/node.cpp +++ b/pub/lib/node.cpp @@ -1043,7 +1043,7 @@ RObj CNodeMixin::tree_val( const CContext& ctx ) const // Resolution is given by context 'ctx': int kconv, jconv; - PSpec sv; + RSpec sv; NCurveFile::get_conv( &sv, &kconv, &jconv, ctx.k, ctx.j ); PObjVecDbl pret( ctx.want_error ? (new CObjVecDbl) : (new CObjVecEnu) ); @@ -1072,7 +1072,7 @@ RObj CNodeConv::copy_theory( const CContext& ctx, double theshift ) const return theory->tree_val( ctx ); } -RObjVecDbl CNodeConv::convolve( const CContext& ctx, double theshift, const PSpec& sv, +RObjVecDbl CNodeConv::convolve( const CContext& ctx, double theshift, const RSpec& sv, double conv_norm, double conv_step ) const { int n = ctx.vt->size(); @@ -1156,7 +1156,7 @@ RObj CNodePConv::copy_theory( const CContext& ctx, double theshift ) const // for which we should go to shared pointers ... } -RObjVecDbl CNodePConv::convolve( const CContext& ctx, double theshift, const PSpec& sv, +RObjVecDbl CNodePConv::convolve( const CContext& ctx, double theshift, const RSpec& sv, double conv_norm, double conv_step ) const { if( conv_norm <= 0 ) @@ -1283,7 +1283,7 @@ RObj CNodeDirac::copy_theory( const CContext& ctx, double theshift ) const //! Convolution or Dirac function: conv(f, shift), dirac(shift). -RObjVecDbl CNodeDirac::convolve( const CContext& ctx, double theshift, const PSpec& sv, +RObjVecDbl CNodeDirac::convolve( const CContext& ctx, double theshift, const RSpec& sv, double conv_norm, double conv_step ) const { int n = ctx.vt->size(); diff --git a/pub/lib/node.hpp b/pub/lib/node.hpp index 0b38cad7..e8dc2e00 100644 --- a/pub/lib/node.hpp +++ b/pub/lib/node.hpp @@ -428,7 +428,7 @@ class CNodeMixin: public CNode { bool i_dependent() const { return shift->i_dependent(); } RObj tree_val( const CContext& ctx ) const; virtual RObj copy_theory( const CContext& ctx, double theshift ) const =0; - virtual RObjVecDbl convolve( const CContext& ctx, double theshift, const PSpec& sv, + virtual RObjVecDbl convolve( const CContext& ctx, double theshift, const RSpec& sv, double conv_norm, double conv_step ) const =0; bool has_conv() const { return true; } }; @@ -456,7 +456,7 @@ class CNodeConv: public CNodeConvBase { CNodeConv( const RNode& _theory, const RNode& _shift=RNode( new CNodeVal( 0.0 ) ) ) : CNodeConvBase( _theory, _shift ) {} RObj copy_theory( const CContext& ctx, double theshift ) const; - RObjVecDbl convolve( const CContext& ctx, double theshift, const PSpec& sv, + RObjVecDbl convolve( const CContext& ctx, double theshift, const RSpec& sv, double conv_norm, double conv_step ) const; string tree_info() const { return "conv(" + theory->tree_info() +","+ shift->tree_info() + ")"; } @@ -470,7 +470,7 @@ class CNodePConv: public CNodeConvBase { CNodePConv( const RNode& _theory, const RNode& _shift=RNode( new CNodeVal( 0.0 ) ) ) : CNodeConvBase( _theory, _shift ) {}; RObj copy_theory( const CContext& ctx, double theshift ) const; - RObjVecDbl convolve( const CContext& ctx, double theshift, const PSpec& sv, + RObjVecDbl convolve( const CContext& ctx, double theshift, const RSpec& sv, double conv_norm, double conv_step ) const; string tree_info() const { return "pconv(" + theory->tree_info() +","+ shift->tree_info() + ")"; } @@ -484,7 +484,7 @@ class CNodeDirac: public CNodeMixin { CNodeDirac( const RNode& _shift=RNode( new CNodeVal( 0.0 ) ) ) : CNodeMixin( _shift ) {}; RObj copy_theory( const CContext& ctx, double theshift ) const; - RObjVecDbl convolve( const CContext& ctx, double theshift, const PSpec& sv, + RObjVecDbl convolve( const CContext& ctx, double theshift, const RSpec& sv, double conv_norm, double conv_step ) const; bool has_dummy() const { return true; } // has implicit t dependence CCoord node_coord( int k ) const; diff --git a/pub/lib/plot.cpp b/pub/lib/plot.cpp index 78258b50..dece898a 100644 --- a/pub/lib/plot.cpp +++ b/pub/lib/plot.cpp @@ -111,7 +111,7 @@ void determine_Yrange( CPlot* plot, vector<int>& JSel ) //! Plot scan j of data file fd; return number of points plotted. -int plot_data( CPlot* plot, POld fd, int k, int j, int pstyle ) +int plot_data( CPlot* plot, ROld fd, int k, int j, int pstyle ) { const PSpec s = fd->VS(j); int n=s->x.size(); @@ -180,11 +180,11 @@ int plot_data( CPlot* plot, POld fd, int k, int j, int pstyle ) //! Plot scan j of convolved curve file fc; return number of points plotted. -int plot_curve_convolved( CPlot* plot, POlc fc, int k, int j, int cstyle ) +int plot_curve_convolved( CPlot* plot, ROlc fc, int k, int j, int cstyle ) { vector<double> novec; int kconv, jconv; - PSpec sconv; + RSpec sconv; NCurveFile::get_conv( &sconv, &kconv, &jconv, k, j ); vector<double> xp; for ( int i=0; i<sconv->size(); ++i ){ @@ -214,7 +214,7 @@ int plot_curve_convolved( CPlot* plot, POlc fc, int k, int j, int cstyle ) //! Plot scan j of curve file fc, using grid from file kd. -int plot_curve_to_grid( CPlot* plot, POlc fc, int k, int j, int cstyle ) +int plot_curve_to_grid( CPlot* plot, ROlc fc, int k, int j, int cstyle ) { if( fc->kd==-1 ) throw S("data reference not set, incompatible with cg+"); @@ -242,7 +242,7 @@ int plot_curve_to_grid( CPlot* plot, POlc fc, int k, int j, int cstyle ) //! Plot scan j of non-convolved curve file fc on equidistant grid; return number of points plotted. -int plot_curve_equidist( CPlot* plot, POlc fc, int k, int j, int cstyle ) +int plot_curve_equidist( CPlot* plot, ROlc fc, int k, int j, int cstyle ) { vector<double> novec; // equidistant grid @@ -266,7 +266,7 @@ int plot_curve_equidist( CPlot* plot, POlc fc, int k, int j, int cstyle ) //! Plots scan j of non-convolved curve file fc, refining the grid where necessary; return number of points plotted. -int plot_curve_refine( CPlot* plot, POlc fc, int k, int j, int cstyle ) +int plot_curve_refine( CPlot* plot, ROlc fc, int k, int j, int cstyle ) { // refinement cares to: // - stop/start line when leaving/reentering/crossing(TODO) the frame -- GitLab