diff --git a/doc/reference/c++/arrays/lazy.rst b/doc/reference/c++/arrays/lazy.rst index 4ecc5b50..8cf0f4b9 100644 --- a/doc/reference/c++/arrays/lazy.rst +++ b/doc/reference/c++/arrays/lazy.rst @@ -2,23 +2,19 @@ .. _Lazy: -Interaction with clef expressions +Interaction with CLEF expressions ============================================ -* The Value and View classes (array, matrix and vector and algebraic expression of them) - are ready to use with the triqs::clef library : +* The containers and their view classes can be used with the :doc:`../clef/contents` library : - * They can be called on lazy expressions made of placeholders. + * They can be called with CLEF expressions. + * :doc:`Automatic assignment<../clef/assign>` has been set up. - * Automatic assignment has been set up. Cf clef lib doc ... - -* Using the clef library offers a quick and efficient way to fill an array with multiple advantages : +* Using the CLEF library offers a quick and efficient way to fill an array with multiple advantages : * It is simpler and more readeable than a series of for loops. - * It is usually more optimal since the for loops are automatically written in the TraversalOrder of the - array. + * It is usually more optimal since the for loops are automatically written in the TraversalOrder of the array. -* NB : the expression can be (and are) inlined by the compilers... * **Example** : @@ -26,13 +22,11 @@ Interaction with clef expressions #include using triqs::arrays::array; using triqs::clef::placeholder; - int main(){ placeholder<0> i_; placeholder<1> j_; array A(2,2), B(2,2); A(i_,j_) << i_ + 2*j_ ; - B(i_,j_) << A(j_,i_)/2; std::cout << "A = "< auto map(f) (A const &) with : - * A::value_type == ValueType1 + * A::value_type == T1 * The returned type of map(f) models the :ref:`ImmutableCuboidArray` concept * with the same domain as A - * with value_type == ValueType2 - -* N.B. : Some cases require explicit cast, e.g. for the standard abs function (already defined in arrays/mapped_function.hpp) , - or the compiler does not know which std::abs you are talking about :: - - auto Abs = map( std::function(static_cast< double (*)(double)> (std::abs)) ); - -* TO DO : clarify the F f or F const & : check code and put an example with std::ref. + * with value_type == T2 * **Example** : .. compileblock:: #include - using triqs::arrays::matrix; using triqs::arrays::make_matrix; using triqs::clef::placeholder; + using namespace triqs; int main() { // declare and init a matrix - placeholder<0> i_; placeholder<1> j_; - matrix A (2,2); A(i_,j_) << i_ + j_ ; + clef::placeholder<0> i_; clef::placeholder<1> j_; + arrays::matrix A (2,2); A(i_,j_) << i_ + j_ ; // the mapped function - auto F = triqs::arrays::map([](int i) { return i*2.5;}); + auto F = arrays::map([](int i) { return i*2.5;}); std::cout<< "A = " << A << std::endl; std::cout<< "F(A) = " << F(A) << std::endl; // oops no computation done diff --git a/doc/reference/c++/clef/assign.rst b/doc/reference/c++/clef/assign.rst index 193e08eb..29eb93ff 100644 --- a/doc/reference/c++/clef/assign.rst +++ b/doc/reference/c++/clef/assign.rst @@ -1,5 +1,7 @@ .. highlight:: c +.. _clef_auto_assign: + Automatic assignment of containers =================================== diff --git a/doc/reference/c++/det_manip/contents.rst b/doc/reference/c++/det_manip/contents.rst index 1c2637ff..85f9acf0 100644 --- a/doc/reference/c++/det_manip/contents.rst +++ b/doc/reference/c++/det_manip/contents.rst @@ -5,7 +5,8 @@ Manipulations of determinants .. warning:: - This library is stable, but documentation is still a bit spartan ... + This library is stable, but documentation is currently being written + and needs a serious rereading and cleaning The purpose of this little class is to regroup standard block manipulations on determinant, used in several algorithms.