コード例 #1
0
        private async Task <IWindow> Tutor(MapleMatrix matrix, string WinTitle, string Method)
        {
            var WinList  = new MSWinList();
            var PrevWins = WinList.Windows.Where(win => win.Title.EndsWith(WinTitle));

            await Evaluate($"{Method}({matrix});", false);

            IWindow window = default;

            while (window == default(IWindow))
            {
                await Task.Delay(5);

                window = WinList.Windows.FirstOrDefault(c => c.Title.EndsWith(WinTitle) && !PrevWins.Contains(c));
            }

            if (window is MSWindow)//minimize instantly when window is idle
            {
                await Task.Delay(350);

                ((MSWindow)window).SetWindowState(MSWindow.SW.SHOWMINIMIZED);
            }
            else
            {
                await Task.Delay(200); //wait for it to be loaded properly.
            }
            return(window);
        }
コード例 #2
0
        public async Task <MapleMatrix> RowOperation(MapleMatrix Matrix, int Row, string Factor)
        {
            var matrix = await Evaluate($"lprint(RowOperation({Matrix}, {Row}, {Factor}));");

            return(new MapleMatrix(matrix));
        }
コード例 #3
0
        public async Task <MapleMatrix> RowOperation(MapleMatrix Matrix, int[] Rows, string Factor)
        {
            var matrix = await Evaluate($"lprint(RowOperation({Matrix}, [{string.Join(",", Rows)}], {Factor}));");

            return(new MapleMatrix(matrix));
        }
コード例 #4
0
        public async Task <MapleMatrix> AddRow(MapleMatrix Matrix, int i, int j, string factor)
        {
            var matrix = await Evaluate($"lprint(AddRow({Matrix}, {i}, {j}, {factor}));");

            return(new MapleMatrix(matrix));
        }
コード例 #5
0
 public async Task <IWindow> GaussianEliminationTutor(MapleMatrix matrix)
 {
     return(await Tutor(matrix, "Elimination", "GaussianEliminationTutor"));
 }
コード例 #6
0
 public async Task <IWindow> InverseTutor(MapleMatrix matrix)
 {
     return(await Tutor(matrix, "Linear Algebra - Matrix Inverse", "InverseTutor"));
 }
コード例 #7
0
        public async Task <MapleMatrix> ReducedRowEchelonForm(MapleMatrix Matrix)
        {
            var @output = await LPrint($"ReducedRowEchelonForm({Matrix})"); // reduce matrix to echelon form and transform it with lprint

            return(new MapleMatrix(output));                                // create maple matrix from lprint and return
        }