///////////////////////////////////////////////////////////////////////////
// ASVR: Active Set Support Vector Regression                            //
// Copyright 2002 David R. Musicant and Alexander Feinberg.              //
// This software is free for academic use only.                          //
// For commercial use, contact dmusican@carleton.edu.                    //
///////////////////////////////////////////////////////////////////////////
// Utilities.H: General purpose utilities.                               //
///////////////////////////////////////////////////////////////////////////

#ifndef UTILITIES_H
#define UTILITIES_H

#include <time.h>

// Mexfiles need to redefine printing to the screen, and there is no
// function in mexfiles for flushing output.
#ifdef MEXFILE
#define PRINT mexPrintf
#define FLUSH
#else
#define PRINT printf
#define FLUSH fflush(stdout)
#endif

// CPU Time class
class CPUTime {
 private:
  clock_t initTick, lastTick;
 public:
  double totalTime;
  CPUTime();
  void Reset();
  double Check();
};

#endif
