Контрольная работа: Многокритериальные задачи. Метод альтернативных решений

private int col;

private System.Globalization.NumberFormatInfo numberFormat;

public Reader(string Name)

{

fileName = Name;

}

public void ReadTable(out double[,] table, out int rows, out int cols)

{

numberFormat = new System.Globalization.NumberFormatInfo();

numberFormat.CurrencyDecimalSeparator = ".";

string[] output = File.ReadAllLines(fileName);

string[] aloneString = output[0].Split(new char[] { ' ' });

//double[,] temp = new double[output.Length, aloneString.Length];

table = new double[output.Length, aloneString.Length];

rows = output.Length;

cols = aloneString.Length;

for (int i = 0; i < aloneString.Length; i++)

{

table[0, i] = double.Parse(aloneString[i], numberFormat);

}

for (int i = 1; i < output.Length; i++)

{

aloneString = output[i].Split(new char[] { ' ' });

for (int j = 0; j < aloneString.Length; j++)

{

table[i, j] = double.Parse(aloneString[j], numberFormat);

}

}

}

К-во Просмотров: 510
Бесплатно скачать Контрольная работа: Многокритериальные задачи. Метод альтернативных решений