- assigned_to: nobody --> cdrnet
- status: open --> pending
I get an index out of bounds error from the library on the
RFFT.TransformForward1D(); line. I believe I am using
the function correctly. Any comments would be
appreciated. My email is gknight@absconsulting.com
The specific error is:
An unhandled exception of
type 'System.IndexOutOfRangeException' occurred in
mathnet.numerics.dll
My test code:
static void Main(string[] args)
{
const int UPPER = 512;
const int FREQ = 5;
double[] x = new double[UPPER];
double[] t = new double[UPPER];
for (int i=0; i<UPPER; i++)
{
x[i]=Math.Sin(FREQ*Math.PI*
(System.Convert.ToDouble(i)/UPPER));
}
if (true)
{
RealFourierTransformation RFFT = new
RealFourierTransformation(x);
RFFT.TransformForward1D();
t=RFFT.Data;
}
System.IO.StreamWriter StreamWrtr = new
System.IO.StreamWriter("InitialConditions.csv", false,
System.Text.Encoding.UTF8);
for (int i=0; i<UPPER; i++)
{
StreamWrtr.WriteLine("{0},{1}", x[i], t[i]);
}
StreamWrtr.Close();
}