2013-07-17 19:24:07 +02:00
|
|
|
.. highlight:: c
|
|
|
|
|
|
|
|
.. _Lazy:
|
|
|
|
|
2013-09-09 15:46:58 +02:00
|
|
|
Interaction with CLEF expressions
|
2013-07-17 19:24:07 +02:00
|
|
|
============================================
|
|
|
|
|
2014-10-17 18:15:19 +02:00
|
|
|
* The containers and their view classes can be used with the :doc:`../clef/contents` library:
|
2013-07-17 19:24:07 +02:00
|
|
|
|
2013-09-09 15:46:58 +02:00
|
|
|
* They can be called with CLEF expressions.
|
|
|
|
* :doc:`Automatic assignment<../clef/assign>` has been set up.
|
2013-07-17 19:24:07 +02:00
|
|
|
|
2014-10-17 18:15:19 +02:00
|
|
|
* Using the CLEF library offers a quick and efficient way to fill an array with multiple advantages:
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
* It is simpler and more readeable than a series of for loops.
|
2013-09-09 15:46:58 +02:00
|
|
|
* It is usually more optimal since the for loops are automatically written in the TraversalOrder of the array.
|
2013-07-17 19:24:07 +02:00
|
|
|
|
|
|
|
|
2014-10-17 18:15:19 +02:00
|
|
|
* **Example**:
|
2013-07-17 19:24:07 +02:00
|
|
|
|
2014-05-31 19:12:21 +02:00
|
|
|
.. triqs_example:: ./lazy_0.cpp
|
2013-07-17 19:24:07 +02:00
|
|
|
.. note::
|
|
|
|
The syntax uses a <<, not = since the array is not assigned to an expression
|
|
|
|
but filled by the evaluation thereof.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|