Changeset 262


Ignore:
Timestamp:
Apr 7, 2005, 8:20:36 PM (16 years ago)
Author:
Peter
Message:

functions added to read into vectors of string, int or double from istream. Also function to check if string is double or int, respectively.

Location:
trunk/src
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r257 r262  
    1515  Regression.cc RegressionKernel.cc RegressionKernelBox.cc          \
    1616  RegressionLinear.cc RegressionLocal.cc RegressionNaive.cc ROC.cc  \
    17   Score.cc Statistics.cc SVD.cc SVM.cc tScore.cc vector.cc          \
     17  Score.cc Statistics.cc stl_utility.cc SVD.cc SVM.cc tScore.cc \
     18  vector.cc \
    1819  WeightedAverager.cc WeNNI.cc
    1920
  • trunk/src/stl_utility.h

    r59 r262  
    1212///
    1313
     14#include <string>
    1415#include <utility>
     16#include <vector>
    1517
    1618namespace theplu {
     
    3234  };
    3335
     36  ///
     37  /// Function return true if string is a number. A number is defined
     38  /// to start with '+', '-' or a digit. It must contain at most one
     39  /// decimal point '.'. Also it may contain 'E' or 'e' followed by an
     40  /// integer (see is_int).
     41  ///
     42  /// @return true if string is a number
     43  ///
     44  bool is_float(std::string&);
     45
     46  ///
     47  /// @return true if every character in string is a digit except the
     48  /// first one that may be '+' or '-'
     49  ///
     50  bool is_int(std::string&);
     51
     52  ///
     53  /// Function reading from istream to vector of doubles. Function
     54  /// reads the line until next '\n'. The line is splitted with
     55  /// respect to whitespaces and push_backed into the vector.
     56  ///
     57  bool read2double(std::istream&, std::vector<double>&);
     58
     59  ///
     60  /// Function reading from istream to vector of ints. Function
     61  /// reads the line until next '\n'. The line is splitted with
     62  /// respect to whitespaces and push_backed into the vector.
     63  ///
     64  bool read2int(std::istream&, std::vector<int>&);
     65
     66  ///
     67  /// Function reading from istream to vector of strings. Function
     68  /// reads the line until next '\n'. The line is splitted with
     69  /// respect to whitespaces and push_backed into the vector.
     70  ///
     71  bool read2string(std::istream&, std::vector<std::string>&);
     72
     73
    3474}} // of namespace cpptools and namespace theplu
    3575
Note: See TracChangeset for help on using the changeset viewer.