Changeset 145 for trunk/lib/Gnuplot.h


Ignore:
Timestamp:
Aug 9, 2006, 11:36:31 PM (15 years ago)
Author:
Jari Häkkinen
Message:

Removed test/parser.cc and test/stats.cc. These tests are an essential
part in the test/directory.cc and test/file.cc, and thus redundant.
Fixed the other tests to actually report success or failure.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Gnuplot.h

    r132 r145  
    7272
    7373    ///
    74     /// Send arbitrary commands to Gnuplot.
     74    /// @brief Send arbitrary commands to Gnuplot.
    7575    ///
    76     /// @return 0 if fputs, fputc, and fflush are succesful
     76    /// @return 0 on success (underlying fputs, fputc, and fflush are
     77    /// succesful), EOF otherwise.
    7778    ///
    78     void command(const std::string&);
     79    int command(const std::string&);
    7980
    8081    ///
     
    99100    /// Gnuplot usage.
    100101    ///
     102    /// @return 0 on success, EOF otherwise.
     103    ///
    101104    template <class T1, class T2>
    102     void plot(const std::vector<T1>& y, const std::vector<T2>& x)
    103     { plot(y,x,"plot"); }
     105    int plot(const std::vector<T1>& y, const std::vector<T2>& x)
     106    { return plot(y,x,"plot"); }
    104107
    105108    template <class T1>
    106     void plot(const std::vector<T1>& y,
    107               const std::vector<T1>& x=std::vector<T1>())
    108     { plot(y,x,"plot"); }
     109    int plot(const std::vector<T1>& y,const std::vector<T1>& x=std::vector<T1>())
     110    { return plot(y,x,"plot"); }
    109111
    110112    ///
     
    113115    /// Gnuplot usage.
    114116    ///
     117    /// @return 0 on success, EOF otherwise.
     118    ///
    115119    template <class T1, class T2>
    116     void replot(const std::vector<T1>& y, const std::vector<T2>& x)
    117     { plot(y,x,"replot"); }
     120    int replot(const std::vector<T1>& y, const std::vector<T2>& x)
     121    { return plot(y,x,"replot"); }
    118122
    119123    template <class T1>
    120     void replot(const std::vector<T1>& y,
     124    int replot(const std::vector<T1>& y,
    121125              const std::vector<T1>& x=std::vector<T1>())
    122     { plot(y,x,"replot"); }
     126    { return plot(y,x,"replot"); }
    123127
    124128  private:
     
    134138    ///
    135139    template <class T1, class T2>
    136     void plot(const std::vector<T1>& y, const std::vector<T2>& x,
    137               const std::string& plotcmd)
     140    int plot(const std::vector<T1>& y, const std::vector<T2>& x,
     141             const std::string& plotcmd)
    138142    {
    139143      assert(x.size()==y.size() || x.empty());
     
    152156      cmdstring << "e\n";
    153157
    154       command(cmdstring.str());
     158      return command(cmdstring.str());
    155159    }
    156160
Note: See TracChangeset for help on using the changeset viewer.