I wrote this bit of code to access a DataTable, however it throws the OutOfBounds Exception.
for (int i = 0; i < table.Rows.Count; i++)
{
//Computing Values of v1, v2
v_1 = v_1 + RGen(0, 2) * (x1_l - x1_best) + RGen(0, 2) * (x1_best - (double)table.Rows[0].ItemArray[i]);
v_2 = v_2 + RGen(0, 2) * (x2_l - x2_best) + RGen(0, 2) * (x2_best - (double)table.Rows[1].ItemArray[i]);
x1.Add(Relax((double)table.Rows[0].ItemArray[i] + v_1));
x2.Add(Relax((double)table.Rows[1].ItemArray[i] + v_2));
}
The DataTable is surely populated. What have I Missed?