Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-07 Thread Wolfgang Bangerth
On 12/07/2018 07:48 AM, 'Maxi Miller' via deal.II User Group wrote: >     for(auto j = system_matrix.begin(); j != system_matrix.end(); ++j) >     { >     for(auto p = system_matrix.begin(j->row()); p != > system_matrix.end(j->row()); ++p) >     { > /*system_matrix(j->row(),

Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-07 Thread 'Maxi Miller' via deal.II User Group
I implemented a (rough) version of the method in question, with the code here: TimerOutput::Scope t(computing_timer, "Assemble Broyden System"); LinearAlgebraTrilinos::MPI::Vector completely_distributed_s_value(dof_handler.locally_owned_dofs(), mpi_communicator);

Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-06 Thread Wolfgang Bangerth
On 12/6/18 6:49 AM, 'Maxi Miller' via deal.II User Group wrote: > I assume I understand that code, but for verification: > I choose a row j, and iterate over it from begin(j) to end(j), while > increasing p (not j, as I assume?). For every position which exists I get the > column value, which

Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-06 Thread 'Maxi Miller' via deal.II User Group
I assume I understand that code, but for verification: I choose a row j, and iterate over it from begin(j) to end(j), while increasing p (not j, as I assume?). For every position which exists I get the column value, which then is stored in the vector positions, thus giving me all non-zero

Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-05 Thread Wolfgang Bangerth
On 12/05/2018 02:31 AM, 'Maxi Miller' via deal.II User Group wrote: > Hmm, is there a way to get the occupation directly as a vector? Then I > could write p_i as p*s_i, with s_i equal to one for non-zero entries, > and equal to zero for zero-value entries? I assume that should make the >

Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-05 Thread 'Maxi Miller' via deal.II User Group
Addendum to part II: As far as I understand, I have to iterate over the sparsity pattern, and then call the accessor at that point (using index()). Is that correct? Am Mittwoch, 5. Dezember 2018 10:31:50 UTC+1 schrieb Maxi Miller: > > Hmm, is there a way to get the occupation directly as a

Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-05 Thread 'Maxi Miller' via deal.II User Group
Hmm, is there a way to get the occupation directly as a vector? Then I could write p_i as p*s_i, with s_i equal to one for non-zero entries, and equal to zero for zero-value entries? I assume that should make the program slightly more efficient. Furthermore, I tried to find the function for

Re: [deal.II] Fast access to position of non-zero elements in sparsity pattern

2018-12-04 Thread Wolfgang Bangerth
On 12/4/18 6:19 AM, 'Maxi Miller' via deal.II User Group wrote: > For the implementation of the Quasi-Newton-method according to Schubert, > which > is defined as > > C_1 = C_0 - sum(u_i u_i^T(C_0p_j - y/t)(p_i^T/(p_i^Tp_i))) > > with p_i the vector p with all elements set to zero where column