- Timestamp:
- 02/25/11 14:37:13 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/QAP/HeuristicLab.Problems.QuadraticAssignment/3.3/Parsers/QAPLIBParser.cs
r5562 r5563 21 21 22 22 public bool Parse(string file) { 23 using (Stream stream = new FileStream(file, FileMode.Open, FileAccess.Read)) { 24 return Parse(stream); 25 } 26 } 27 28 /// <summary> 29 /// Reads from the given stream data which is expected to be in the QAPLIB format. 30 /// </summary> 31 /// <remarks> 32 /// The stream is not closed or disposed. The caller has to take care of that. 33 /// </remarks> 34 /// <param name="stream">The stream to read data from.</param> 35 /// <returns>True if the file was successfully read or false otherwise.</returns> 36 public bool Parse(Stream stream) { 23 37 Error = null; 24 38 try { 25 StreamReader reader = new StreamReader( file);39 StreamReader reader = new StreamReader(stream); 26 40 Size = int.Parse(reader.ReadLine()); 27 41 Distances = new double[Size, Size]; … … 65 79 return false; 66 80 } 67 68 81 } 69 82 }
Note: See TracChangeset
for help on using the changeset viewer.