//   Match 2.0.1  -- aligns data series using dynamic programming
//   Copyright (C) 2001-2003  Lorraine E. Lisiecki and Philip A. Lisiecki 
//
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; version 2
//of the License.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
//02111-1307, USA.
//
//The original authors reserve the right to license this program or
//modified versions of this program under other licenses at our
//discretion.
//
//If you publish results generated by this software please cite
//Lisiecki, L. E. and P. A. Lisiecki, The application of dynamic
//  programming to the correlation of paleoclimate records, 
//  submitted to Paleoceanography, 2001
//
//Any questions regarding this license or the operation of this
//software may be directed to Lorraine Lisiecki
//<zogalum@alum.mit.edu>.

#ifndef MATCH_FLOATNAN
#define MATCH_FLOATNAN

#include <string>
#include <iostream>

namespace std {}
using namespace std;

class floatnan {
private:
  float value;
  bool nan;
public:
  class parse_error {};

  floatnan() : value(0.0), nan(true) {}
  floatnan(float value) : value(value), nan(false) {}
  floatnan &operator=(const float &other) {
    value=other; 
    nan=false; 
    return *this;
  }
  bool my_isnan() const { return nan; }
  operator float() { return value; }
  floatnan(string s, int *position);
  friend ostream &operator<<(ostream &os, const floatnan &fn);
};

ostream &operator<<(ostream &os, const floatnan &fn);

#endif // #ifndef MATCH_FLOATNAN

