예제 #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
        }