Mercurial > fem-fenics-eugenio
diff src/assemble_system.cc @ 166:40ae9e5dfb93
Use the uBLAS for an estimation of the nnz elements for excess.
author | gedeone-octave <marcovass89@hotmail.it> |
---|---|
date | Sat, 05 Oct 2013 22:27:03 +0100 |
parents | 5fe2a157f4eb |
children | 3895c8d4c066 |
line wrap: on
line diff
--- a/src/assemble_system.cc Sat Oct 05 22:25:52 2013 +0100 +++ b/src/assemble_system.cc Sat Oct 05 22:27:03 2013 +0100 @@ -100,13 +100,17 @@ error ("assemble_system: unknown argument type"); } +// It provides an estimation for excess of nnz elements + boost::tuples::tuple<const std::size_t*, const std::size_t*, const double*, int> aa = A.data (); + int nnz = aa.get<3> (); + std::cout << "Assembling Matrix from the bilinear form..." << std::endl; std::size_t nr = A.size (0), nc = A.size (1); std::vector<double> data_tmp; std::vector<std::size_t> cidx_tmp; - octave_idx_type dims = A.size (0), nz = 0, ii = 0; + octave_idx_type dims = nnz, nz = 0, ii = 0; ColumnVector ridx (dims), cidx (dims), data (dims); for (std::size_t i = 0; i < nr; ++i) @@ -206,13 +210,17 @@ error ("assemble_system: unknown argument type"); } +// It provides an estimation for excess of nnz elements + boost::tuples::tuple<const std::size_t*, const std::size_t*, const double*, int> aa = A.data (); + int nnz = aa.get<3> (); + std::cout << "Assembling Matrix from the bilinear form..." << std::endl; std::size_t nr = A.size (0), nc = A.size (1); std::vector<double> data_tmp; std::vector<std::size_t> cidx_tmp; - octave_idx_type dims = A.size (0), nz = 0, ii = 0; + octave_idx_type dims = nnz, nz = 0, ii = 0; ColumnVector ridx (dims), cidx (dims), data (dims); for (std::size_t i = 0; i < nr; ++i)