示例#1
0
        private void btnSparseFile_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(comboFile.Text))
            {
                return;
            }

            var form = new SparseMatrixVisualizerForm();

            var A = MatrixHelper.LoadMatrix(radioDouble.Checked, comboFile.Text);

            form.SetStorageAdapter(A);
            form.ShowDialog();
        }
示例#2
0
        private void btnSparseRandom_Click(object sender, EventArgs e)
        {
            var form = new SparseMatrixVisualizerForm();

            int  rows, cols;
            bool symmetric;

            if (!Util.GetSparseRandomSize(comboSparseSize.Text, out rows, out cols, out symmetric))
            {
                return;
            }

            var A = MatrixHelper.CreateRandom(radioDouble.Checked, rows, cols, 0.05, symmetric);

            form.SetStorageAdapter(A);
            form.ShowDialog();
        }
示例#3
0
        private void btnSpecial_Click(object sender, EventArgs e)
        {
            var form = new SparseMatrixVisualizerForm();

            int nx, ny;

            bool laplacian;

            if (!Util.GetSpecialSize(comboWathen.Text, out nx, out ny, out laplacian))
            {
                return;
            }

            var A = MatrixHelper.CreateSpecial(radioDouble.Checked, laplacian, nx, ny);

            form.SetStorageAdapter(A);
            form.ShowDialog();
        }
示例#4
0
        protected override void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
        {
            if (windowService == null)
            {
                throw new System.ArgumentNullException("windowService");
            }

            if (objectProvider == null)
            {
                throw new System.ArgumentNullException("objectProvider");
            }

            var obj = (SparseMatrix)objectProvider.GetObject();

            using (var form = new SparseMatrixVisualizerForm())
            {
                form.SetStorageAdapter(new SparseStorageAdapter(obj));
                windowService.ShowDialog(form);
            }
        }