Esempio n. 1
0
        public static void TimeSummary()
        {
            var cshGaussSeidel          = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpGaussSeidel, true);
            var cshJacobi               = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpJacobi, true);
            var cshGaussPartial         = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpGaussPartialPivot, true);
            var cshGaussPartialSparse   = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpGaussPartialPivotSparse, true);
            var eigenGaussPartial       = MyMatrixIoHandler.LoadDoubleVector(IoConsts.EigenGaussPartialPivot, true);
            var eigenGaussPartialSparse = MyMatrixIoHandler.LoadDoubleVector(IoConsts.EigenGaussPartialPivotSparse, true);

            var sb = new StringBuilder();

            sb.AppendLine(GetRow("op", "time"));
            sb.AppendLine(GetRow("csh-gauss-seidel", cshGaussSeidel.Item2));
            sb.AppendLine(GetRow("csh-jacobi", cshJacobi.Item2));
            sb.AppendLine(GetRow("csh-gauss-partial", cshGaussPartial.Item2));
            sb.AppendLine(GetRow("csh-gauss-partial-sparse", cshGaussPartialSparse.Item2));
            sb.AppendLine(GetRow("eig-gauss-partial", eigenGaussPartial.Item2));
            sb.AppendLine(GetRow("eig-gauss-partial-sparse", eigenGaussPartialSparse.Item2));
        }
Esempio n. 2
0
        public static void WinChanceErrorSummary()
        {
            var cshGaussSeidel          = MyMatrixIoHandler.LoadDoubleVector(IoConsts.PrefixWinChance + IoConsts.CsharpGaussSeidel, true);
            var cshJacobi               = MyMatrixIoHandler.LoadDoubleVector(IoConsts.PrefixWinChance + IoConsts.CsharpJacobi, true);
            var cshGaussPartial         = MyMatrixIoHandler.LoadDoubleVector(IoConsts.PrefixWinChance + IoConsts.CsharpGaussPartialPivot, true);
            var cshGaussPartialSparse   = MyMatrixIoHandler.LoadDoubleVector(IoConsts.PrefixWinChance + IoConsts.CsharpGaussPartialPivotSparse, true);
            var eigenGaussPartial       = MyMatrixIoHandler.LoadDoubleVector(IoConsts.PrefixWinChance + IoConsts.EigenGaussPartialPivot, true);
            var eigenGaussPartialSparse = MyMatrixIoHandler.LoadDoubleVector(IoConsts.PrefixWinChance + IoConsts.EigenGaussPartialPivotSparse, true);

            var sb = new StringBuilder();

            sb.AppendLine(GetRow("op", "relative_error"));
            sb.AppendLine(GetRow("csh-gauss-seidel", GetRelativeError(cshGaussSeidel.Item1[0], eigenGaussPartialSparse.Item1[0])));
            sb.AppendLine(GetRow("csh-jacobi", GetRelativeError(cshJacobi.Item1[0], eigenGaussPartialSparse.Item1[0])));
            sb.AppendLine(GetRow("csh-gauss-partial", GetRelativeError(cshGaussPartial.Item1[0], eigenGaussPartialSparse.Item1[0])));
            sb.AppendLine(GetRow("csh-gauss-partial-sparse", GetRelativeError(cshGaussPartialSparse.Item1[0], eigenGaussPartialSparse.Item1[0])));
            sb.AppendLine(GetRow("eig-gauss-partial", GetRelativeError(eigenGaussPartial.Item1[0], eigenGaussPartialSparse.Item1[0])));

            File.WriteAllText(IoConsts.SummaryWinChanceError, sb.ToString());
        }
Esempio n. 3
0
        public static void NormSummary()
        {
            var cshGaussSeidel          = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpGaussSeidel, true);
            var cshJacobi               = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpJacobi, true);
            var cshGaussPartial         = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpGaussPartialPivot, true);
            var cshGaussPartialSparse   = MyMatrixIoHandler.LoadDoubleVector(IoConsts.CsharpGaussPartialPivotSparse, true);
            var eigenGaussPartial       = MyMatrixIoHandler.LoadDoubleVector(IoConsts.EigenGaussPartialPivot, true);
            var eigenGaussPartialSparse = MyMatrixIoHandler.LoadDoubleVector(IoConsts.EigenGaussPartialPivotSparse, true);

            var sb = new StringBuilder();

            sb.AppendLine(GetRow("op", "norm"));
            sb.AppendLine(GetRow("csh-gauss-seidel", MyMatrix <double> .VectorNorm(cshGaussSeidel.Item1, eigenGaussPartialSparse.Item1)));
            sb.AppendLine(GetRow("csh-jacobi", MyMatrix <double> .VectorNorm(cshJacobi.Item1, eigenGaussPartialSparse.Item1)));
            sb.AppendLine(GetRow("csh-gauss-partial", MyMatrix <double> .VectorNorm(cshGaussPartial.Item1, eigenGaussPartialSparse.Item1)));
            sb.AppendLine(GetRow("csh-gauss-partial-sparse", MyMatrix <double> .VectorNorm(cshGaussPartialSparse.Item1, eigenGaussPartialSparse.Item1)));
            sb.AppendLine(GetRow("eig-gauss-partial", MyMatrix <double> .VectorNorm(eigenGaussPartial.Item1, eigenGaussPartialSparse.Item1)));
            sb.AppendLine(GetRow("eig-gauss-partial-sparse", MyMatrix <double> .VectorNorm(eigenGaussPartialSparse.Item1, eigenGaussPartialSparse.Item1)));

            File.WriteAllText(IoConsts.SummaryNorm, sb.ToString());
        }