Original Post
Hi, this is my code.
public Matrix GetCol (int col)
{
if (col > this.Cols)
{
throw new System.Exception("Can't get column #" + col
+ " because it's greater than the number of columns " + this.Cols
+ ".");
}
double [,] newMatrix = new double[this.Rows, 1];
for (int row = 0; 0 < this.Rows; row++)
{
newMatrix[row, 0] = // HERE!!!!
this.matrix[row, col];
}
return new Matrix(newMatrix);
}I traced my code and on the line indicated, I get an System.IndexOutOfRangeException. This... makes zero sense. This is a single-threaded application and this.Rows is not being modified. So why is there an exception in there?