** EZPLOT
**
** This is part of the CTSim program
-** Copyright (C) 1983-2000 Kevin Rosenberg
+** Copyright (c) 1983-2001 Kevin Rosenberg
**
-** $Id: ezplot.cpp,v 1.28 2001/01/04 21:28:41 kevin Exp $
+** $Id: ezplot.cpp,v 1.31 2001/02/20 04:48:45 kevin Exp $
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
EZPlotCurve::EZPlotCurve (const double* xData, const double* yData, int n)
-: x(NULL), y(NULL)
+: x(new double[n]), y(new double[n])
{
- x = new double [n];
- y = new double [n];
-
- int copyCount = n * sizeof(double);
- memcpy (x, xData, copyCount);
- memcpy (y, yData, copyCount);
+ for (int i = 0; i < n; i++) {
+ x[i] = xData[i];
+ y[i] = yData[i];
+ }
m_iPointCount = n;
}
}
void
-EZPlot::addCurve (const double x[], const float y[], int num)
+EZPlot::addCurve (const double* const x, const float* const y, int num)
{
double* dy = new double [num];
void
-EZPlot::addCurve (const double x[], const double y[], int num)
+EZPlot::addCurve (const double* const x, const double* const y, int num)
{
if (num < 1)
return;
}
}
}
- }
-
+ }
}