From b8a4e94aaac591fb68e873919b2795753b095f86 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (h)" <j.wuttke@fz-juelich.de> Date: Wed, 11 Nov 2015 22:00:51 +0100 Subject: [PATCH] rename CVar -> CGenus --- pub/lib/CMakeLists.txt | 4 +- pub/lib/commands.cpp | 14 ++-- pub/lib/edif.cpp | 16 ++--- pub/lib/fassign.cpp | 4 +- pub/lib/file_in.hpp | 2 +- pub/lib/func.hpp | 2 +- pub/lib/geni.cpp | 8 +-- pub/lib/{var.cpp => genus.cpp} | 21 +++--- pub/lib/{var.hpp => genus.hpp} | 12 ++-- pub/lib/manip.cpp | 4 +- pub/lib/node.cpp | 8 +-- pub/lib/olf.cpp | 122 ++++++++++++++++----------------- pub/lib/olf.hpp | 14 ++-- pub/lib/opr.cpp | 6 +- pub/lib/reg.cpp | 2 +- pub/lib/reg.hpp | 2 +- pub/lib/rssm.cpp | 2 +- pub/lib/slice.cpp | 8 +-- pub/utest/test001_VCateg.cpp | 6 +- 19 files changed, 128 insertions(+), 129 deletions(-) rename pub/lib/{var.cpp => genus.cpp} (88%) rename pub/lib/{var.hpp => genus.hpp} (89%) diff --git a/pub/lib/CMakeLists.txt b/pub/lib/CMakeLists.txt index 3758ec27..b4c5437a 100644 --- a/pub/lib/CMakeLists.txt +++ b/pub/lib/CMakeLists.txt @@ -27,6 +27,7 @@ fit.cpp fregistry.cpp func.cpp geni.cpp +genus.cpp import.cpp integrate.cpp jsel.cpp @@ -43,7 +44,6 @@ rssm.cpp slice.cpp special.cpp toplevel.cpp -var.cpp ) set(inc_files @@ -61,6 +61,7 @@ fit.hpp fregistry.hpp func.hpp geni.hpp +genus.hpp import.hpp integrate.hpp jsel.hpp @@ -80,7 +81,6 @@ singleton.hpp slice.hpp special.hpp toplevel.hpp -var.hpp xax_lex.hpp ) diff --git a/pub/lib/commands.cpp b/pub/lib/commands.cpp index 61512494..443c37cc 100644 --- a/pub/lib/commands.cpp +++ b/pub/lib/commands.cpp @@ -73,7 +73,7 @@ bool frida_command( string cmd ) " g graphics setup\n" " f file input, output, creation\n" " m manipulate data (select, bin, reorganise, ...)\n" - " o operate on variables, compute integrals, ...\n" + " o operate on genusiables, compute integrals, ...\n" " r read raw data (currently only for SPHERES)\n" " _ special / temporary commands\n" "Modifier (appended to command):\n" @@ -85,7 +85,7 @@ bool frida_command( string cmd ) " hic dimension-reducing functionals of curves\n" " ho operators by precedence\n" " hr handling resolution functions (convolution, Dirac delta function)\n" - " hv variables\n" + " hv genusiables\n" " \\h meta commands and macros\n" ; @@ -122,7 +122,7 @@ bool frida_command( string cmd ) " (a zero shift argument may be omitted from 'conv', but not from 'resol')\n" "To activate the convolution:\n" " - use command 'cv' to provide resolution file reference\n" - "If function f has a sharp peak (strong variation within one resolution bin):\n" + "If function f has a sharp peak (strong genusiation within one resolution bin):\n" " - use 'pconv(F(t,...))', where F is the primitive of f\n" ; } else if (cmd == "hv") { @@ -181,9 +181,9 @@ bool frida_command( string cmd ) "File attributes:\n" " cwc weighing: constant\n" " cwl weighing: logarithmic\n" - " cwv weighing: reciprocal variance (default)\n" - " cwvd weighing: reciprocal variance, data only\n" - " cwvc weighing: reciprocal variance, curve only\n" + " cwv weighing: reciprocal genusiance (default)\n" + " cwvd weighing: reciprocal genusiance, data only\n" + " cwvc weighing: reciprocal genusiance, curve only\n" " cgd+ graphics: take x points from data reference file\n" " cgd- graphics: create x points by dividing the plot window\n" "Frida-wide settings:\n" @@ -531,7 +531,7 @@ bool frida_command( string cmd ) } else if (cmd == "o") { - cout << "Commands to operate on variables or spectra:\n" + cout << "Commands to operate on genusiables or spectra:\n" " ox on x\n" " oy on y\n" " oz0,.. on z0,..\n" diff --git a/pub/lib/edif.cpp b/pub/lib/edif.cpp index 212e2464..6af6c479 100644 --- a/pub/lib/edif.cpp +++ b/pub/lib/edif.cpp @@ -19,7 +19,7 @@ #include "olf.hpp" #include "mem.hpp" #include "slice.hpp" -#include "var.hpp" +#include "genus.hpp" #include "obj.hpp" #include "edif.hpp" @@ -207,17 +207,17 @@ void NEdif::edit_fnam() void NEdif::edit_coord( string which ) { // EMBEDDED_DIALOG - CVar var( which ); + CGenus genus( which ); NOlm::IterateO fiter; // check whether all files have the same coordinate: POlo fin = fiter(); - CCoord old_co = fin->coord( var ); + CCoord old_co = fin->coord( genus ); bool uniform = true; bool multifile = false; while ( fin = fiter() ) { multifile = true; - if ( fin->coord( var )!=old_co ) { + if ( fin->coord( genus )!=old_co ) { uniform = false; break; } @@ -227,7 +227,7 @@ void NEdif::edit_coord( string which ) if ( multifile && !uniform ) { fiter.reset(); while ( fin = fiter() ) { - cout << " file " << fiter.k() << ": " << fin->coord( var ) <<"\n"; + cout << " file " << fiter.k() << ": " << fin->coord( genus ) <<"\n"; } } string in = sask( "Coordinate "+which+": name(unit)" + @@ -236,20 +236,20 @@ void NEdif::edit_coord( string which ) fiter.reset(); if ( multifile && in=="f" ) { while ( fin = fiter() ) { - old_co = fin->coord( var ); + old_co = fin->coord( genus ); in = sask( "Coordinate "+which+" for file "+S(fiter.k())+": name(unit)", old_co.str_compact() ); CCoord new_co(in); fin->lDoc.push_back( "ec"+string(which)+" "+new_co.str_compact()+ " # old: " + old_co.str_compact() ); - fin->set_coord( var, new_co ); + fin->set_coord( genus, new_co ); } } else { CCoord new_co(in); while ( fin = fiter() ) { fin->lDoc.push_back( "ec"+string(which)+" "+new_co.str_compact()+ " # old: " + old_co.str_compact() ); - fin->set_coord( var, new_co ); + fin->set_coord( genus, new_co ); } } } diff --git a/pub/lib/fassign.cpp b/pub/lib/fassign.cpp index b2db0831..450b43b7 100644 --- a/pub/lib/fassign.cpp +++ b/pub/lib/fassign.cpp @@ -53,9 +53,9 @@ void fassign_initialize() G->register_fct_e_se ( m, func_assign ); G->register_fct_s_ss ( m, func_assign ); - m = { "defined", 1, "(s): 1 if there is a variable s" }; + m = { "defined", 1, "(s): 1 if there is a genusiable s" }; G->register_fct_i_s ( m, func_defined ); - m = { "undef", 1, "(s): undefine variable s, return 1 upon success" }; + m = { "undef", 1, "(s): undefine genusiable s, return 1 upon success" }; G->register_fct_0_s ( m, func_undef ); } diff --git a/pub/lib/file_in.hpp b/pub/lib/file_in.hpp index 644c44da..efcda4c5 100644 --- a/pub/lib/file_in.hpp +++ b/pub/lib/file_in.hpp @@ -8,7 +8,7 @@ //! \brief NFileIn: load files -//! Method to load files, with support for various old formats. +//! Method to load files, with support for genusious old formats. namespace NFileIn { void load(); diff --git a/pub/lib/func.hpp b/pub/lib/func.hpp index e56d2953..4637fe78 100644 --- a/pub/lib/func.hpp +++ b/pub/lib/func.hpp @@ -38,7 +38,7 @@ class CFuncMetadata { }; -//! A wrapper holding function metadata and implementations for various input and output types. +//! A wrapper holding function metadata and implementations for genusious input and output types. class CFunc : public CFuncMetadata { public: diff --git a/pub/lib/geni.cpp b/pub/lib/geni.cpp index 34dc318b..9c0a44fe 100644 --- a/pub/lib/geni.cpp +++ b/pub/lib/geni.cpp @@ -151,12 +151,12 @@ void geni_avge( double* r, double* dr, int n, const vector<RObjVecNum>& a ) *dr = 0; // TODO better estimate } -//! Sample variance. +//! Sample genusiance. void geni_variance( double* r, double* dr, int n, const vector<RObjVecNum>& a ) { if ( n<2 ) - throw S("Cannot compute sample variance for sample size < 2"); + throw S("Cannot compute sample genusiance for sample size < 2"); double p=0, pp=0, q=0; for ( int i=0; i<n; i++ ) { pp = p + ( a[0]->to_r(i) - p ) / (i+1); @@ -307,7 +307,7 @@ void SGeniRegistry::initialize() (new CGeni( "avge", 1, "y", geni_avge, "a", "average of y" ))->register_me(); (new CGeni( "var", 1, "y", geni_variance, "a", - "sample variance of y" ))->register_me(); + "sample genusiance of y" ))->register_me(); (new CGeni( "stdv", 1, "y", geni_stdv, "a", "sample standard deviation of y" ))->register_me(); (new CGeni( "integral", 2, "x,y", geni_integral, "ab", @@ -315,7 +315,7 @@ void SGeniRegistry::initialize() (new CGeni( "cog", 2, "x,y", geni_cog, "a", "center of gravity of x weighed with y" ))->register_me(); (new CGeni( "width", 2, "x,y", geni_width, "a", - "standard variation in x weighed with y" ))->register_me(); + "standard genusiation in x weighed with y" ))->register_me(); (new CGeni( "corr", 2, "x,y", geni_corr, "?", // TODO: unit? "correlation coefficient of x and y" ))->register_me(); } diff --git a/pub/lib/var.cpp b/pub/lib/genus.cpp similarity index 88% rename from pub/lib/var.cpp rename to pub/lib/genus.cpp index dea8c64b..d2459ea4 100644 --- a/pub/lib/var.cpp +++ b/pub/lib/genus.cpp @@ -4,22 +4,21 @@ //* http://apps.jcns.fz-juelich.de/frida //************************************************************************************************** -//! \file var.cpp -//! \brief Variable reference CVar. +//! \file genus.cpp +//! \brief Variable reference CGenus. #include "defs.hpp" - -#include "var.hpp" +#include "genus.hpp" //************************************************************************************************** -//* class CVar +//* class CGenus //************************************************************************************************** //! Returns number contained in parameter label s, starting at index pos. -int CVar::request_num( string s, int pos ) +int CGenus::request_num( string s, int pos ) { if ( s.size()<=pos ) throw "missing parameter number in '" + s + "'"; @@ -32,7 +31,7 @@ int CVar::request_num( string s, int pos ) //! Creates instance according to given parameter label. -CVar::CVar( string s ) +CGenus::CGenus( string s ) { num = -1; if( s.size()<1 ) @@ -72,14 +71,14 @@ CVar::CVar( string s ) } else if ( s=="R2" ) { categ = VCateg::CR2; } else { - throw "Invalid variable '" + s + "'"; + throw "Invalid genusiable '" + s + "'"; } } -//! Returns string representation of this variable. +//! Returns string representation of this genusiable. -string CVar::var_info() const +string CGenus::genus_info() const { string ret; switch (categ) { @@ -97,7 +96,7 @@ string CVar::var_info() const case VCateg::NJ: ret = "nj"; break; case VCateg::NI: ret = "ni"; break; default: - throw S("BUG: no info available for unexpected variable category"); + throw S("BUG: no info available for unexpected genusiable category"); } if ( numbered() ) { if( num==-1 ) diff --git a/pub/lib/var.hpp b/pub/lib/genus.hpp similarity index 89% rename from pub/lib/var.hpp rename to pub/lib/genus.hpp index 2bb572bf..348090b4 100644 --- a/pub/lib/var.hpp +++ b/pub/lib/genus.hpp @@ -4,8 +4,8 @@ //* http://apps.jcns.fz-juelich.de/frida //************************************************************************************************** -//! \file var.hpp -//! \brief Variable reference CVar. +//! \file genus.hpp +//! \brief Variable reference CGenus. //! Variable category. @@ -22,13 +22,13 @@ enum class VCateg : char { //! Variable reference, composed of a category and a number, if applicable. -class CVar { +class CGenus { public: VCateg categ; int num; - CVar( VCateg categ, int num=0 ) : categ(categ), num(num) {} - CVar( const string s ); + CGenus( VCateg categ, int num=0 ) : categ(categ), num(num) {} + CGenus( const string s ); bool is_errvar() const { return categ==VCateg::DY; } @@ -58,7 +58,7 @@ class CVar { categ==VCateg::R || categ==VCateg::Z; } - string var_info() const; + string genus_info() const; private: static int request_num( string s, int pos ); diff --git a/pub/lib/manip.cpp b/pub/lib/manip.cpp index b74f1bb8..da90331a 100644 --- a/pub/lib/manip.cpp +++ b/pub/lib/manip.cpp @@ -408,7 +408,7 @@ void NManip::points_remove_err() //* manipulations on spectra //************************************************************************************************** -//! Remove z variable that does not vary with j. +//! Remove z genusiable that does not genusy with j. void NManip::ScaRemoveConstantZ( POlo fio ) { @@ -526,7 +526,7 @@ void NManip::slices_rebin() // TODO needs justification / documentation if (mj<2) { if ( !in_with_dy ) - throw S("BUG: should not compute variance for case mj=1"); + throw S("BUG: should not compute genusiance for case mj=1"); sout->dy[i] = fd->VS(ji)->dy[i]; } else { double vm_src = 0, vm_grp = 0; diff --git a/pub/lib/node.cpp b/pub/lib/node.cpp index 4b7cde34..d8b7d544 100644 --- a/pub/lib/node.cpp +++ b/pub/lib/node.cpp @@ -1007,7 +1007,7 @@ RObj CNodeIdf::tree_val( const CContext& ctx ) const { PObj ret = SVariRegistry::get_instance()->find( idf ); if ( !ret ) - throw "uninitialized variable "+idf; + throw "uninitialized genusiable "+idf; return ret; } @@ -1154,7 +1154,7 @@ RObjVecDbl CNodeConv::convolve( const CContext& ctx, double theshift, const RSpe dret->dv.assign( n, 0. ); tt.resize(n); for ( int iv=0; iv<nv; ++iv ) { - double dx; // variable step + double dx; // genusiable step if ( iv==0 ) dx = sv->x[1] - sv->x[0]; else if ( iv==nv-1 ) @@ -1251,9 +1251,9 @@ RObjVecDbl CNodePConv::convolve( const CContext& ctx, double theshift, const RSp throw S("BUG: pconv result has nonfinite result"); if( dret ) { if ( !std::isfinite(dret->dv[i]) ) - throw S("BUG: pconv result has nonfinite variance"); + throw S("BUG: pconv result has nonfinite genusiance"); if ( dret->dv[i]<0 ) - throw S("BUG: pconv result has negative variance"); + throw S("BUG: pconv result has negative genusiance"); dret->dv[i] = sqrt(dret->dv[i]) / conv_norm; if ( !std::isfinite(dret->dv[i]) ) throw S("BUG: pconv result has nonfinite error"); diff --git a/pub/lib/olf.cpp b/pub/lib/olf.cpp index b1dce655..eb86d9e2 100644 --- a/pub/lib/olf.cpp +++ b/pub/lib/olf.cpp @@ -23,7 +23,7 @@ #include "olf.hpp" #include "slice.hpp" -#include "var.hpp" +#include "genus.hpp" #include "obj.hpp" #include "expr.hpp" #include "xax_lex.hpp" @@ -164,96 +164,96 @@ PCurve COlc::VC( int j ) const //! Return one coordinate. -CCoord COld::coord( const CVar& var ) const +CCoord COld::coord( const CGenus& genus ) const { - if ( var.categ==VCateg::X ) { + if ( genus.categ==VCateg::X ) { return xco; - } else if ( var.categ==VCateg::Y ) { + } else if ( genus.categ==VCateg::Y ) { return yco; - } else if ( var.categ==VCateg::Z ) { - if( var.num >= nZ() ) - throw "coordinate " + var.var_info() + " not defined"; - return ZCo[var.num]; - } else if ( var.categ==VCateg::R ) { - if( var.num >= RPar.size() ) - throw "coordinate " + var.var_info() + " not defined"; - return RPar[var.num].Co; + } else if ( genus.categ==VCateg::Z ) { + if( genus.num >= nZ() ) + throw "coordinate " + genus.genus_info() + " not defined"; + return ZCo[genus.num]; + } else if ( genus.categ==VCateg::R ) { + if( genus.num >= RPar.size() ) + throw "coordinate " + genus.genus_info() + " not defined"; + return RPar[genus.num].Co; } else { - throw "variable " + var.var_info() + " not defined for curve file"; + throw "variable " + genus.genus_info() + " not defined for curve file"; } } //! Return one coordinate. -CCoord COlc::coord( const CVar& var ) const +CCoord COlc::coord( const CGenus& genus ) const { - if ( var.categ==VCateg::X ) { + if ( genus.categ==VCateg::X ) { return xco; - } else if ( var.categ==VCateg::Y ) { + } else if ( genus.categ==VCateg::Y ) { return yco; - } else if ( var.categ==VCateg::Z ) { - if( var.num >= nZ() ) - throw "coordinate " + var.var_info() + " not defined"; - return ZCo[var.num]; - } else if ( var.categ==VCateg::CP ) { - if( var.num >= nP ) - throw "coordinate " + var.var_info() + " not defined"; - return PCo[var.num]; - } else if ( var.categ==VCateg::R ) { - if( var.num >= RPar.size() ) - throw "coordinate " + var.var_info() + " not defined"; - return RPar[var.num].Co; + } else if ( genus.categ==VCateg::Z ) { + if( genus.num >= nZ() ) + throw "coordinate " + genus.genus_info() + " not defined"; + return ZCo[genus.num]; + } else if ( genus.categ==VCateg::CP ) { + if( genus.num >= nP ) + throw "coordinate " + genus.genus_info() + " not defined"; + return PCo[genus.num]; + } else if ( genus.categ==VCateg::R ) { + if( genus.num >= RPar.size() ) + throw "coordinate " + genus.genus_info() + " not defined"; + return RPar[genus.num].Co; } else { - throw "variable " + var.var_info() + " not defined for curve file"; + throw "variable " + genus.genus_info() + " not defined for curve file"; } } //! Change one coordinate. -void COld::set_coord( const CVar& var, CCoord& co ) +void COld::set_coord( const CGenus& genus, CCoord& co ) { - if ( var.categ==VCateg::X ) { + if ( genus.categ==VCateg::X ) { xco = co; - } else if ( var.categ==VCateg::Y ) { + } else if ( genus.categ==VCateg::Y ) { yco = co; - } else if ( var.categ==VCateg::Z ) { - if( var.num >= nZ() ) - throw "coordinate " + var.var_info() + " not defined"; - ZCo[var.num] = co; - } else if ( var.categ==VCateg::R ) { - if( var.num >= RPar.size() ) - throw "coordinate " + var.var_info() + " not defined"; - RPar[var.num].Co = co; + } else if ( genus.categ==VCateg::Z ) { + if( genus.num >= nZ() ) + throw "coordinate " + genus.genus_info() + " not defined"; + ZCo[genus.num] = co; + } else if ( genus.categ==VCateg::R ) { + if( genus.num >= RPar.size() ) + throw "coordinate " + genus.genus_info() + " not defined"; + RPar[genus.num].Co = co; } else { - throw "variable " + var.var_info() + " not defined for curve file"; + throw "variable " + genus.genus_info() + " not defined for curve file"; } } //! Change one coordinate. -void COlc::set_coord( const CVar& var, CCoord& co ) +void COlc::set_coord( const CGenus& genus, CCoord& co ) { - if ( var.categ==VCateg::X ) { + if ( genus.categ==VCateg::X ) { xco = co; - } else if ( var.categ==VCateg::Y ) { + } else if ( genus.categ==VCateg::Y ) { yco = co; - } else if ( var.categ==VCateg::Z ) { - if( var.num >= nZ() ) - throw "coordinate " + var.var_info() + " not defined"; - ZCo[var.num] = co; - } else if ( var.categ==VCateg::CP ) { - if( var.num >= nP ) - throw "coordinate " + var.var_info() + " not defined"; - PCo[var.num] = co; - } else if ( var.categ==VCateg::R ) { - if( var.num >= RPar.size() ) - throw "coordinate " + var.var_info() + " not defined"; - RPar[var.num] = co; + } else if ( genus.categ==VCateg::Z ) { + if( genus.num >= nZ() ) + throw "coordinate " + genus.genus_info() + " not defined"; + ZCo[genus.num] = co; + } else if ( genus.categ==VCateg::CP ) { + if( genus.num >= nP ) + throw "coordinate " + genus.genus_info() + " not defined"; + PCo[genus.num] = co; + } else if ( genus.categ==VCateg::R ) { + if( genus.num >= RPar.size() ) + throw "coordinate " + genus.genus_info() + " not defined"; + RPar[genus.num] = co; } else { - throw "variable " + var.var_info() + " not defined for curve file"; + throw "variable " + genus.genus_info() + " not defined for curve file"; } } @@ -350,7 +350,7 @@ void COlc::curve_query( const string& quest ) cout << "curve definition:\n" "- either an arithmetic expression,\n" - " containing the running variable t,\n" + " containing the running genusiable t,\n" " for instance: p0+p1*t\n" "- or external evaluation mode e(c|i)(r|w)\n" " next question will ask for external program\n" @@ -663,11 +663,11 @@ string COlc::weight_str() const case _LOG: return "logarithmic"; case _VAR: - return "with reciprocal variance (data and curve)"; + return "with reciprocal genusiance (data and curve)"; case _VARC: - return "with reciprocal variance (curve only)"; + return "with reciprocal genusiance (curve only)"; case _VARD: - return "with reciprocal variance (data only)"; + return "with reciprocal genusiance (data only)"; } throw S("BUG: unexpected weight"); } diff --git a/pub/lib/olf.hpp b/pub/lib/olf.hpp index b7c64988..4567fb3b 100644 --- a/pub/lib/olf.hpp +++ b/pub/lib/olf.hpp @@ -10,7 +10,7 @@ #include "ptr.hpp" #include "coord.hpp" -class CVar; +class CGenus; //! Online object. Virtual base class for COld, COlc. @@ -42,8 +42,8 @@ class COlo { RObj z( int j, int iz ) const; virtual PSlice new_slice( int j ) const = 0; virtual POlo new_olo( bool modified=true ) const = 0; - virtual CCoord coord( const CVar& var ) const = 0; - virtual void set_coord( const CVar& var, CCoord& co ) = 0; + virtual CCoord coord( const CGenus& genus ) const = 0; + virtual void set_coord( const CGenus& genus, CCoord& co ) = 0; }; @@ -62,8 +62,8 @@ class COld : public COlo { void copy_mainvec( ROlo fin ); // Overloaded functions: - void set_coord( const CVar& var, CCoord& co ); - CCoord coord( const CVar& var ) const; + void set_coord( const CGenus& genus, CCoord& co ); + CCoord coord( const CGenus& genus ) const; // Functions specific to data file: void purge_dy(); @@ -116,8 +116,8 @@ public: void copy_mainvec( ROlo fin ); // Overloaded functions: - void set_coord( const CVar& var, CCoord& co ); - CCoord coord( const CVar& var ) const; + void set_coord( const CGenus& genus, CCoord& co ); + CCoord coord( const CGenus& genus ) const; // Pertinent functions: bool has_global_par() const; diff --git a/pub/lib/opr.cpp b/pub/lib/opr.cpp index 23d9e2c9..ba65315f 100644 --- a/pub/lib/opr.cpp +++ b/pub/lib/opr.cpp @@ -18,7 +18,7 @@ #include "mem.hpp" #include "slice.hpp" #include "reg.hpp" -#include "var.hpp" +#include "genus.hpp" #include "obj.hpp" #include "expr.hpp" #include "opr.hpp" @@ -148,7 +148,7 @@ void NOperate::Pointwise( string llabel ) { NOlm::IterateO fiter; - CVar lref(llabel); + CGenus lref(llabel); static string expr; expr = sask("Expression", expr); @@ -171,7 +171,7 @@ void NOperate::Pointwise( string llabel ) POlo fout( fin->new_olo() ); if( lref.categ!=VCateg::CP ) - fout->lDoc.push_back( "o" + lref.var_info() + " " + expr); + fout->lDoc.push_back( "o" + lref.genus_info() + " " + expr); CCoord co = T->node_coord( k ); if ( lref.categ==VCateg::X ) { diff --git a/pub/lib/reg.cpp b/pub/lib/reg.cpp index e19212db..9fe84e6a 100644 --- a/pub/lib/reg.cpp +++ b/pub/lib/reg.cpp @@ -22,7 +22,7 @@ PObj SVariRegistry::find_or_fail( string key ) const { PObj ret = find( key ); if( !ret ) - throw "Cannot find variable '" + key + "'"; + throw "Cannot find genusiable '" + key + "'"; return ret; } diff --git a/pub/lib/reg.hpp b/pub/lib/reg.hpp index f18d3d12..4f845d93 100644 --- a/pub/lib/reg.hpp +++ b/pub/lib/reg.hpp @@ -9,7 +9,7 @@ #include "singleton.hpp" -//! Registry for variable objects. +//! Registry for genusiable objects. class SVariRegistry: public ISingleton<SVariRegistry> { private: diff --git a/pub/lib/rssm.cpp b/pub/lib/rssm.cpp index 643ec66f..6763acd3 100644 --- a/pub/lib/rssm.cpp +++ b/pub/lib/rssm.cpp @@ -41,7 +41,7 @@ class CRawfileSpheres { int maj_syntax, min_syntax, maj_outform, min_outform; }; -//! Read raw data file, store contents as class variables +//! Read raw data file, store contents as class genusiables void CRawfileSpheres::RdRawYam( std::ifstream& F_in ) { diff --git a/pub/lib/slice.cpp b/pub/lib/slice.cpp index cb826812..dfdbfa1d 100644 --- a/pub/lib/slice.cpp +++ b/pub/lib/slice.cpp @@ -168,10 +168,10 @@ void CSpec::intpol( const vector<double>& xx, vector<double>* yy, vector<double> //std::cout << "DEBUG INTPOL i=" << i << " ii=" << ii << " x=" << x[i] << ".." << x[i+1] << // " xx=" << xx[ii] << " y=" << y[i] << ".." << y[i+1] << " -> " << (*yy)[ii] << "\n"; if( dd ) { - double var = ( (x[i+1]-xx[ii])*SQR(dy[i]) + (xx[ii]-x[i])*SQR(dy[i+1]) ) / (x[i+1]-x[i]); - if ( var< 0 ) - throw "interpolation failed: variance<0"; - (*dd)[ii] = sqrt( var ); + double genus = ( (x[i+1]-xx[ii])*SQR(dy[i]) + (xx[ii]-x[i])*SQR(dy[i+1]) ) / (x[i+1]-x[i]); + if ( genus< 0 ) + throw "interpolation failed: genusiance<0"; + (*dd)[ii] = sqrt( genus ); } ++ii; } diff --git a/pub/utest/test001_VCateg.cpp b/pub/utest/test001_VCateg.cpp index 98f6f971..2ee4eb91 100644 --- a/pub/utest/test001_VCateg.cpp +++ b/pub/utest/test001_VCateg.cpp @@ -1,12 +1,12 @@ #include "gtest/gtest.h" #include "defs.hpp" -#include "var.hpp" +#include "genus.hpp" // Tests where all categories are assigned a supercategory TEST(VCategTest, AllSupercategorized) { for( int i=0; i<(int)VCateg::_LAST_; ++i ) { - CVar var((VCateg)i); + CGenus genus((VCateg)i); // cout << "test " << i << "\n"; - EXPECT_TRUE( var.pointwise()||var.slicewise()||var.filewise()||var.sessionwise() ); + EXPECT_TRUE( genus.pointwise()||genus.slicewise()||genus.filewise()||genus.sessionwise() ); } } -- GitLab