Exemplo n.º 1
0
        public static void Write(string outputFile, RangeTransform r)
        {
            FileStream fileStream = File.Open(outputFile, FileMode.Create);

            try
            {
                RangeTransform.Write(fileStream, r);
            }
            finally
            {
                fileStream.Close();
            }
        }
Exemplo n.º 2
0
        public static RangeTransform Read(string inputFile)
        {
            FileStream fileStream = File.OpenRead(inputFile);

            try
            {
                return(RangeTransform.Read(fileStream));
            }
            finally
            {
                fileStream.Close();
            }
        }
Exemplo n.º 3
0
        public static void Write(Stream stream, RangeTransform r)
        {
            TemporaryCulture.Start();
            StreamWriter streamWriter = new StreamWriter(stream);

            streamWriter.WriteLine(r._length);
            streamWriter.Write(r._inputStart[0]);
            for (int i = 1; i < r._inputStart.Length; i++)
            {
                streamWriter.Write(" " + r._inputStart[i]);
            }
            streamWriter.WriteLine();
            streamWriter.Write(r._inputScale[0]);
            for (int j = 1; j < r._inputScale.Length; j++)
            {
                streamWriter.Write(" " + r._inputScale[j]);
            }
            streamWriter.WriteLine();
            streamWriter.WriteLine("{0} {1}", r._outputStart, r._outputScale);
            streamWriter.Flush();
            TemporaryCulture.Stop();
        }
Exemplo n.º 4
0
 public static RangeTransform Compute(Problem prob)
 {
     return(RangeTransform.Compute(prob, -1.0, 1.0));
 }