2013-10-23 15:51:51 +02:00
|
|
|
.. highlight:: c
|
|
|
|
|
|
|
|
.. _gf_clef:
|
|
|
|
|
|
|
|
Interaction with CLEF expressions
|
|
|
|
============================================
|
|
|
|
|
2013-12-30 22:31:36 +01:00
|
|
|
The gf containers and their view classes can be used with the :doc:`../clef/contents` library :
|
2013-10-23 15:51:51 +02:00
|
|
|
|
2013-12-30 22:31:36 +01:00
|
|
|
* They can be called with CLEF expressions.
|
|
|
|
* :doc:`Automatic assignment<../clef/assign>` has been set up.
|
2013-10-23 15:51:51 +02:00
|
|
|
|
2013-12-30 22:31:36 +01:00
|
|
|
Using the CLEF library offers a quick and efficient way to fill an array with multiple advantages :
|
2013-10-23 15:51:51 +02:00
|
|
|
|
2013-12-30 22:31:36 +01:00
|
|
|
* It is simpler and more readeable than a series of for loops.
|
|
|
|
* It is more optimal since the loops are automatically written in the best order for memory traversal.
|
2013-10-23 15:51:51 +02:00
|
|
|
|
2013-12-30 22:31:36 +01:00
|
|
|
**Example** :
|
2013-10-23 15:51:51 +02:00
|
|
|
|
2014-05-31 19:12:21 +02:00
|
|
|
.. triqs_example:: ./clef_0.cpp
|
2013-10-23 15:51:51 +02:00
|
|
|
.. note::
|
|
|
|
|
|
|
|
The LHS uses () and not brackets, even though it is on the mesh, because of the strange C++ limitation
|
|
|
|
that [] can not be overloaded for several variables...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|