Пример #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
        }