Example #1
0
        /// <summary>
        /// 9. Создание комбинированной матрицы
        /// </summary>
        private static async Task SparseMatrixRepSeqCreateAndReadTests()
        {
            using (SparseMatrixRepSeq sparseMatrixRepSeq = new SparseMatrixRepSeq("9"))
            {
                await sparseMatrixRepSeq.ClearAsync();

                await sparseMatrixRepSeq.AddRowAsync(new double[] { 0.11, 1.11, 2.22, 0, 0, -5.55, 0, 0, -8.88, -9.99 });

                await sparseMatrixRepSeq.PrintMatrix();

                Console.WriteLine("-------------------\n");
                double[] seq0   = new double[] { -5.55, 0, 15, 211, 0.09 };
                var      tuple0 = await sparseMatrixRepSeq.AddRowsSequenceBandAsync(seq0,
                                                                                    5, 2, 15);

                await sparseMatrixRepSeq.PrintMatrix();

                Console.WriteLine("-------------------\n");
                double[] seq1   = new double[] { -1, -2, -3 };
                var      tuple1 = await sparseMatrixRepSeq.AddRowsSequenceAsync(seq1,
                                                                                new int[] { 1, 2 },
                                                                                new int[] { 1, 1 });

                await sparseMatrixRepSeq.PrintMatrix();
            }
            Console.WriteLine("---Successful end of method---");
        }
Example #2
0
        /// <summary>
        /// 8. Добавление ленточных последовательностей элементов в массив
        /// </summary>
        private static async Task DataSequenceBandAddRowsTests()
        {
            using (SparseMatrixRepSeq sparseMatrixRepSeq = new SparseMatrixRepSeq("8"))
            {
                await sparseMatrixRepSeq.ClearAsync();

                double[] seq0   = new double[] { -5.55, 0, 15, 211, 0.09 };
                var      tuple0 = await sparseMatrixRepSeq.AddRowsSequenceBandAsync(seq0,
                                                                                    5, 2, 15);

                await sparseMatrixRepSeq.PrintRowsFromSequencesBand();
            }
            Console.WriteLine("---Successful end of method---");
        }