3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-01 03:33:50 +01:00
Commit Graph

80 Commits

Author SHA1 Message Date
Olivier Parcollet
1906dc30a5 Fix expression template for gf & std::vector
- add move semantics in expression template.

for gfs :
- rm descriptor
- Remove data from expr, rewrote assignment
  which now iterates on the mesh, simply.
  RHS models now FunctionOnMesh
- This fix the multiplication bug of gf
- Remove assign_no_resize/assign_with_resize from proxy
2013-09-22 18:17:40 +02:00
Michel Ferrero
28140f14fb Work on documentation
Mainly on the python part. I had a quick browse through to check if
the scripts were still working.
2013-09-17 14:55:55 +02:00
Michel Ferrero
84df58aad7 Fix upper bound problem in tails
There was a mistake in the computation of omax in the tail multiplication.

  modified:   triqs/gfs/local/functions.cpp
  modified:   triqs/gfs/local/tail.hpp
2013-09-13 12:16:04 +02:00
Olivier Parcollet
2cca9584b9 mpi: first draft for #12
- a thin layer, using a bit boost::mpi (for the communicator mostly ...)
  along the lines discussed in #12.
- implemented reduce, allreduce, bcast for arrays, simple scalars,
and any custom type that support boost serialization.
- Custom types :  the operations are done recursively on members.
  No change is needed in the class to use this mpi routine, as long as
  serialize function is defined.
- For arrays of basic types (int, double...), a direct call to MPI C API, which works also for views
  (as long as they are contiguous).
- For arrays of more complex types, we revert to boost::mpi.
- Added a simple test.
- Work still in progress :
   - missing a simple scatter/gather for the arrays
   - need more tests & API thinking.
   - dispatch array code to array lib
   - reduce is "sum" only, but do we need more.
2013-09-13 09:20:21 +02:00
Michel Ferrero
f0dfabff38 Change tail implementation with fixed array size
Now the tail have a fixed size. It actually makes everything simpler. I took
order_min = -1 and order_max = 8. This makes the tails compatible with the
previous implementation. However we might want to change this to something like
-10, 10 so that they are self-contained. This commit should also fix issue #11.
2013-09-12 15:21:56 +02:00
Olivier Parcollet
d4c96a9d93 gf: minor correction for 2 times, etc...
-> are going to be replaced soon anyway ...
2013-09-11 20:48:03 +02:00
Olivier Parcollet
0586c77307 add c14 details in std::c14
- to use already a few c14 convenience details :

-> polymorphic std::plus, e.g.
   boost::mpi::reduce (world, A,C, std::c14::plus<>(),0);
this plus determine the type by itself ...
  -> errors on the type can be very cryptic on the gf.

-> add std::c14::make_unique
(equivalent of make_shared for unique_ptr).
2013-09-11 20:22:38 +02:00
Olivier Parcollet
b534936589 Fix matrix * alias issue and adapt det_manip
- The previous version of the * operator for matrix was too clever.
It was giving a lazy object and then rewriting C = A *B into gemm (a,A,B,0,C).
The pb was in case of aliasing : when e.g. C = A, or is a part of A.
gemm is not correct that case, and as a result generic code like
a = a *b
may not be correct in matrix case, which is unacceptable.

- So we revert to a simple * operator for matrix
that does immediate computation.
Same thing for matrix* vector

- we also suppress a_x_ty class.

-> for M = a * b,
when M is a matrix, there is no overhead due to move assignment
-> however, when M is a view, there is an additionnal copy.

-Correctness comes first, hence the fix.
However, if one wants more speed and one can guarantee that
there is no aliasing possible, then one has to write a direct gemm call.

-> det_manip class was adapted, since in that case, we can show there
no alias, and we want the speed gain, so the * ops where replaced
by direct blas call (using the array blas interface).

-> also gemm, gemv, ger were overloaded in the case the return
matrix/vector (i.e. last parameter of the function) is not an lvalue,
but a temporary view created on the fly.
2013-09-11 18:49:22 +02:00
Olivier Parcollet
3c2a3c51dc arrays : fix in bug in ref counting in deserialize 2013-09-11 18:39:46 +02:00
Olivier Parcollet
c06e183ae5 arrays : revised version of map & fold
- also cleaned a bit reinterpretview example
2013-09-11 18:39:25 +02:00
Olivier Parcollet
a0eba01769 arrays : clean move constructor of cuboid::map
- remove mess linked to old icc 13 support
and write a clear and readable code.
2013-09-11 18:38:18 +02:00
Olivier Parcollet
e0f58aeb62 gf : clean product mesh
- reinterpret array is much simple.
clean old code after check on various compilers
2013-09-11 18:38:18 +02:00
Laura Messio
29a6a9f5df gf : cleaning the imtime evaluator 2013-09-09 15:41:46 +02:00
Laura Messio
257bdb9d6a Work on gf
gf: security in the case beta<0 added in the mesh construction
gf: inline added in slice
test/triqs/gf: test of on_mesh() added
gfs: scalar for two-real_times
test/triqs/gf/ renamed in gfs, test gf_retw.cpp completed
gfs: evaluator homogeneised
two_times: evaluator corrected
test/triqs/gf/ renamed in gfs, test gf_retw.cpp completed

+ Correction after rebase

Fix a test : gf_re_im_freq_time
There is an issue with the last point.
To be fixed.
2013-09-09 15:41:46 +02:00
Laura Messio
a39e41e9fd det_manip: try_insert_from_function(i,j,fx,fy,ksi) 2013-09-09 15:41:46 +02:00
Olivier Parcollet
4413c6a588 Fix #3
I have no clue why this is a pb, and I can not reproduce it,
but the change is correct and trivial so I merge this pull request.
2013-09-08 16:54:22 +02:00
Olivier Parcollet
1dd2d9e691 correction after compiling on linux gcc 4.8.1/ clang 3.3
- clef : lazy_method is broken . remove it from the test for the moment.
2013-09-08 15:35:57 +02:00
Olivier Parcollet
4bbcbe35ef gcc 4.6: correction
- removing some test & tuple_tool which fail on old 4.6
For Ubuntu 12.04 compat.
2013-09-08 15:17:18 +02:00
Olivier Parcollet
2c542647fd clef : new version using lvalues and moving rvalues
- change : all objects are by default
  stored now by reference, not by copy any more.
  Unless the trait force_copy_in_expr is true.
- rvalue refs are moved into the tree
- simplifies a lot the writing of lazy method, objects.
- added a macro for methods
- tests ok. Further check needed to control absence of copies...
- improved documentation
2013-09-08 15:04:12 +02:00
Olivier Parcollet
11081a68b7 Fix #5
- a temp. array in stev had the wrong sign.
2013-09-08 11:58:07 +02:00
Olivier Parcollet
1313566669 utility: simplify a bit tuple::apply 2013-09-06 21:23:55 +02:00
Olivier Parcollet
9790fe8bd0 Work on gf
- clean curry.
- start testing.
2013-09-06 16:00:51 +02:00
Olivier Parcollet
5d0049de7a arrays : minor cosmetics 2013-09-06 16:00:51 +02:00
Michel Ferrero
eaad5fa41d Change MC parameter names
modified:   triqs/mc_tools/mc_generic.hpp
2013-09-05 17:54:49 +02:00
Olivier Parcollet
7c758ede0d arrays : add cbegin 2013-09-02 21:25:44 +02:00
Olivier Parcollet
9f5d5ceb2d Fix for no python compilation 2013-08-30 20:11:04 +02:00
Olivier Parcollet
bb7394dfaf gf : correction to legendre.
a error in a trait.
2013-08-30 16:08:40 +02:00
Olivier Parcollet
5a12b7eeb5 gf : correction for block
- forgot a constructor on the domain
 (was a pb for cthyb_krylov code).
- a few details (better make_gf).
2013-08-30 12:59:46 +02:00
Olivier Parcollet
3b29e9bf9d arrays : renaming concept name
CuboidArray <-> Array
added make_cuboid_domain
2013-08-29 18:06:04 +02:00
Olivier Parcollet
b88f62d50e arrays: details while writing doc
- add factories for matrices
- add make_immutablef from a lambda
- details
2013-08-29 18:05:23 +02:00
Michel Ferrero
9c258fa7e1 Add tools to be able to find version and release
I added a version.hpp and updated the version.py so that
one can find the version of the library either from the
c++ or the python (if there is python support).

  modified:   CMakeLists.txt
  modified:   cmake/TRIQSConfig.cmake.in
  modified:   pytriqs/version.py.in
  modified:   triqs/CMakeLists.txt
  new file:   triqs/version.hpp.in
2013-08-29 11:41:19 +02:00
Olivier Parcollet
b45045e81c gfs: change the name of the mesh -> gf_mesh for gcc
gcc has a pb because the template mesh<Variable,Opt>
has the name same as the gf mesh method (!).
Clang is fine however on this...

Solution : rename the template mesh<...> to gf_mesh...
Not very elegant, but ok.
2013-08-27 14:20:50 +02:00
Olivier Parcollet
165b44a081 gf: mesh. const_iterator and add cbegin
- for meshes :
clean concept w/ doc, add cbegin, and changed
iterator to const_iterator (more standard name).
2013-08-27 13:43:58 +02:00
Olivier Parcollet
7898bd8d88 gf : mesh now the class, not a trait.
simplify : mesh was a impl trait,
make it the class itself.
corrected the gf, tests and the cython.
2013-08-27 13:43:58 +02:00
Olivier Parcollet
3d6c030b1f arrays : correct deletion of std::swap for views
- forgot the bool flags, in case a weak view is involved.
2013-08-27 13:43:58 +02:00
Olivier Parcollet
f78e6baf9e code cleaning
- TRIQS_MODEL_CONCEPT renamed : clearer for doc
- index_value_type : remove, useless...
2013-08-27 13:43:58 +02:00
Olivier Parcollet
f71ff22ed0 arrays: cleaning cuboid domain
- add one more constructor, clean constructor
- simplify foreach (use simple overload).
2013-08-27 13:43:58 +02:00
Olivier Parcollet
072b45ac1c arrays: Remove dim0, dim1, .shape in various matrix object.
Not in the concept, not needed, just an annoyance.
replaced by free functions :
first_dim(A), second_dim(A), get_shape(A) and so on...
2013-08-27 13:43:58 +02:00
Olivier Parcollet
e241f85a7d arrays: rm debug code matrix_view_proxy_DEBUG.hpp
- used only for speed issue searching...
2013-08-27 13:43:58 +02:00
Olivier Parcollet
c8fcb40164 arrays : rm linalg/determinant and inverse (links)
It is clearer to have only one file :
det_and_inverse.hpp
changed the included in tests.
2013-08-27 13:43:57 +02:00
Olivier Parcollet
017394e17f arrays : add experimental array_const_view
- not completely clear how to
manipulate this alias, in particular when
matching template function
(and portability : require C++11 compiler).
2013-08-27 13:43:57 +02:00
Olivier Parcollet
241d5636d7 arrays: rm tags file and some cleaning
- tags are defined in files, this impl/tags.hpp
was not needed any more.
- some code cleaning
2013-08-27 13:43:57 +02:00
Olivier Parcollet
6fa737978e arrays: remove .len (redundant)
.len -> .shape
with same syntax.
Made a few necessary corrections here and there.
2013-08-27 13:43:57 +02:00
Olivier Parcollet
17a741ad9e arrays: rm has_view_type_tag & add_views
- has_view_type_tag mechanism was replaced by a decltype long ago.
Cleaning since it seems to work on all supported compiler now.

- removed add_views : not used any more.
2013-08-27 13:43:57 +02:00
Olivier Parcollet
41bc8d0338 changing non_view_type to regular_type
- cosmetic : for clarity of the code.
2013-08-27 13:43:57 +02:00
Olivier Parcollet
938f3dc425 arrays: workaround a bug in clang 3.3 release ?
- Apparently there is a bug in release 3.3 of clang
(? on kondo cluster ?) that crash the compiler in compiling
a test. Pb not present in clang from svn.
Changed a little bit the libs as a workaround.
2013-08-27 11:37:21 +02:00
Olivier Parcollet
4f4c697897 separate some tests in c++11 dir for old compilers.
new policy : for non standard conforming compilers,
we can skip the tests using new features using recent c++ features.
I.e. compilers below gcc 4.8.1, clang 3.3.
2013-07-30 22:37:41 +02:00
Olivier Parcollet
44bf1e322a gf product and curry. First draft
- works on simple case, to be reread.
- curry in general. To be reread ..
- added some tests.
2013-07-30 22:37:41 +02:00
Olivier Parcollet
f6fa63c9b3 gf: clean h5name
- _s automatically done for scalar_valued.
- add simple reinterpretation of gf scalar to matrix view to
easy h5 saving to plot in python
2013-07-30 22:37:41 +02:00
Olivier Parcollet
e707cd8754 correction tuple_tools for gcc 4.6 2013-07-30 22:37:41 +02:00