Exemplo n.º 1
0
    private static void test02()

    //****************************************************************************80
    //
    //  Purpose:
    //
    //    TEST02 tests ccs_HEADER_READ and ccs_DATA_READ.
    //
    //  Licensing:
    //
    //    This code is distributed under the GNU LGPL license.
    //
    //  Modified:
    //
    //    18 July 2014
    //
    //  Author:
    //
    //    John Burkardt
    //
    {
        int          n      = 0;
        int          ncc    = 0;
        const string prefix = "simple";

        Console.WriteLine("");
        Console.WriteLine("TEST02");
        Console.WriteLine("  Read a sparse matrix in CCS format from 3 files.");
        //
        //  Read the header.
        //
        CompressedColumnStorage.ccs_header_read(prefix, ref ncc, ref n);
        //
        //  Allocate space.
        //
        double[] acc = new double[ncc];
        int[]    ccc = new int[n + 1];
        int[]    icc = new int[ncc];
        //
        //  Read the matrix data.
        //
        CompressedColumnStorage.ccs_data_read(prefix, ncc, n, ref icc, ref ccc, ref acc);
        //
        //  Print the CCS matrix.
        //
        int m = n;

        CompressedColumnStorage.ccs_print(m, n, ncc, icc, ccc, acc, "  The matrix in 0-based CCS format:");
        //
        //  Free memory.
        //
    }