#ifndef GRID_1D_H
#define GRID_1D_H

//-----------------------------------------------------------------------------
//
//  Peter Richter (prichter@princeton.edu)
//  Princeton Plasma Physics Laboratory
//  August 2000
//
//  grid_1D.h - One-dimensional grid object.
//
//-----------------------------------------------------------------------------

#include <stdlib.h>
#include <math.h>
#include "preact/util.h"

class grid_1D {
public:
  grid_1D() : vector(NULL) { }
  void set(fp_64 parameters[], int errlo, int errhi)
    {
      endpoints.minimum = parameters[0];
      endpoints.maximum = parameters[1];
      endpoints.min_policy = errlo;
      endpoints.max_policy = errhi;
      npoints = int(parameters[2]);
      spacing = int(parameters[3]);
      ln = (spacing == LOG) ? log(parameters[1] / parameters[0]) : 0;
    }
  void modify(int errlo, int errhi)
    {
      endpoints.min_policy = errlo;
      endpoints.max_policy = errhi;
    }
  fp_64 *vector, *domain;
  range endpoints;
  int npoints, spacing;
  fp_64 ln;
};

//-----------------------------------------------------------------------------

#endif


