public static Matrix ParseMatrix(IDictionary<String, String> paras,
String name)
{
if (!paras.ContainsKey(name))
{
throw new PersistError("Missing property: " + name);
}
String line = paras[name];
double[] d = NumberList.FromList(CSVFormat.EgFormat, line);
var rows = (int) d[0];
var cols = (int) d[1];
var result = new Matrix(rows, cols);
int index = 2;
for (int r = 0; r < rows; r++)
{
for (int c = 0; c < cols; c++)
{
result[r, c] = d[index++];
}
}
return result;
}