From: bangerth Date: Mon, 30 May 2011 01:26:46 +0000 (+0000) Subject: Update with regard to changes to _1, etc. Also update some things that are plain... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=734e1775de6c0888f3ba3b8c98b8f6b54275e6b8;p=dealii-svn.git Update with regard to changes to _1, etc. Also update some things that are plain outdated. git-svn-id: https://svn.dealii.org/trunk@23755 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/doc/doxygen/headers/multithreading.h b/deal.II/doc/doxygen/headers/multithreading.h index 5da7f80e86..11c70f3632 100644 --- a/deal.II/doc/doxygen/headers/multithreading.h +++ b/deal.II/doc/doxygen/headers/multithreading.h @@ -414,7 +414,7 @@ *out = *in_1 + *in_2; * @endcode * The next C++ standard will contain a more elegant way to achieve the - * same effect shown above using the Boost Lambda library, through a + * same effect shown above using the Boost library, through a * mechanism known as lambda expressions and closures. * * Note also that we have made sure that no CPU ever gets a chunk of @@ -486,21 +486,21 @@ Vector &dst) const { parallel::transform (dst.begin(), dst.end(), - boost::bind (&SparseMatrix::vmult_one_row, + std_cxx1x::bind (&SparseMatrix::vmult_one_row, this, - boost::cref(src), - boost::ref(dst), - _1), + std_cxx1x::cref(src), + std_cxx1x::ref(dst), + std_cxx1x::_1), 200); } * @endcode * Note how we use boost::bind + * href="http://www.boost.org/doc/libs/1_37_0/libs/bind/bind.html">std_cxx1x::bind * to bind certain arguments to the vmult_one_row * function, leaving one argument open and thus allowing the * parallel::transform function to consider the passed function argument as * unary. Also note that we need to make the source and destination vectors as - * (const) references to prevent boost::bind from passing them by value + * (const) references to prevent std_cxx1x::bind from passing them by value * (implying a copy for src and writing the result into a * temporary copy of dst, neither of which is what we desired). * Finally, notice the grainsize of a minimum of 200 rows of a matrix that @@ -542,11 +542,11 @@ Vector &dst) const { parallel::apply_to_subranges (0, n_rows(), - boost::bind (vmult_on_subrange, + std_cxx1x::bind (vmult_on_subrange, this, - _1, _2, - boost::cref(src), - boost::ref(dst)), + std_cxx1x::_1, std_cxx1x::_2, + std_cxx1x::cref(src), + std_cxx1x::ref(dst)), 200); } * @endcode @@ -617,10 +617,10 @@ return std::sqrt (parallel::accumulate_from_subranges (0, n_rows(), - boost::bind (mat_norm_sqr_on_subrange, + std_cxx1x::bind (mat_norm_sqr_on_subrange, this, - _1, _2, - boost::cref(x)), + std_cxx1x::_1, std_cxx1x::_2, + std_cxx1x::cref(x)), 200)); } * @endcode @@ -993,19 +993,20 @@ // ...is the same as: WorkStream::run (dof_handler.begin_active(), dof_handler.end(), - boost::bind(&MyClass::assemble_on_one_cell, *this, _1, _2, _3), - boost::bind(&MyClass::copy_local_to_global, *this, _1), + std_cxx1x::bind(&MyClass::assemble_on_one_cell, *this, + std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3), + std_cxx1x::bind(&MyClass::copy_local_to_global, *this, std_cxx1x::_1), per_task_data); * @endcode - * Note how boost::bind produces a function object that takes three + * Note how std_cxx1x::bind produces a function object that takes three * arguments by binding the member function to the *this - * object. _1, _2 and _3 are placeholders for the first, + * object. std_cxx1x::_1, std_cxx1x::_2 and std_cxx1x::_3 are placeholders for the first, * second and third argument that can be specified later on. In other words, for * example if p is the result of the first call to - * boost::bind, then the call p(cell, scratch_data, + * std_cxx1x::bind, then the call p(cell, scratch_data, * per_task_data) will result in executing * this-@>assemble_on_one_cell (cell, scratch_data, per_task_data), - * i.e. boost::bind has bound the object to the function pointer + * i.e. std_cxx1x::bind has bound the object to the function pointer * but left the three arguments open for later. * * Similarly, let us assume that MyClass::assemble_on_one_cell @@ -1027,22 +1028,22 @@ * @code WorkStream::run (dof_handler.begin_active(), dof_handler.end(), - boost::bind(&MyClass::assemble_on_one_cell, + std_cxx1x::bind(&MyClass::assemble_on_one_cell, *this, current_solution, - _1, - _2, - _3, + std_cxx1x::_1, + std_cxx1x::_2, + std_cxx1x::_3, previous_time+time_step), - boost::bind(&MyClass::copy_local_to_global, - *this, _1), + std_cxx1x::bind(&MyClass::copy_local_to_global, + *this, std_cxx1x::_1), per_task_data); * @endcode * Here, we bind the object, the linearization point argument, and the * current time argument to the function before we hand it off to * WorkStream::run(). WorkStream::run() will then simply call the * function with the cell and scratch and per task objects which will be filled - * in at the positions indicated by _1, _2 and _3. + * in at the positions indicated by std_cxx1x::_1, std_cxx1x::_2 and std_cxx1x::_3. * * To see the WorkStream class used in practice on tasks like the ones * outlined above, take a look at the step-32, step-35 or step-37