コード例 #1
0
ファイル: Program.cs プロジェクト: Miltt/Console
        static void Main(string[] args)
        {
            // f(x)=3x1+x2 -> max
            double[] funcCoefficients = new double[] { 3, 1 };
            
            // canonical:
            // x1 - 2x2 + u1 = 1
            // -2x1 + x2 + u2 = 2
            // 2x1 + x2 + u3 = 6
            double[,] bounds = new double[,] { { 1, -2, 1 }, { -2, 1, 2 }, { 2, 1, 6} };

            Simplex simplex = new Simplex(funcCoefficients, bounds);
            simplex.Maximize();

            Console.WriteLine("Press any key...");
            Console.ReadKey();
        }