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

7 Commits

Author SHA1 Message Date
Olivier Parcollet
5128126055 arrays: change operator() && for const_view
Changed operator()(int, int...) && for array, and views.

- For const_view and regular type, returns value_type (i.e. a copy).
  NB : does make a copy, not a move. Ok for scalar type. TODO: think for complicated types.
  This allows codes like :
  f(x)(0,0) where f : x-> matrix or const_view
  to be correct in clef expression evaluation.

- For _view : return a value_type &, as before to allow :
    A(....)(0,0) = rhs;
  It is not possible to detect dangling refs in that case at compile time.
  Added a security in TRIQS_ARRAYS_DEBUG mode to detect a dangling ref at run time,
  i.e. the case where the view is "unique" (ref count ==1).
  This would be a quite bad design anyway ...

- also :

 - clean operator[] for vector (old workaround for old gcc...)
 - add IsView flag in ISP impl class, for the impl. of operator() &&
2014-03-02 17:11:48 +01:00
Olivier Parcollet
85141350e7 remove warnings in compilation
- triqs & tests now compiles with -Wall on clang (3.2)
Checked on OS X.
Todo : recheck on other compilers.
2014-01-30 22:17:28 +01:00
Olivier Parcollet
3c2a3c51dc arrays : fix in bug in ref counting in deserialize 2013-09-11 18:39:46 +02:00
Olivier Parcollet
9f5d5ceb2d Fix for no python compilation 2013-08-30 20:11:04 +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
fc2a620eae arrays: new ref counting and weak views
- improve the mem_block and shared_block.
- the reference counting is now done in the mem_block and shared_block, removing the need of shared_ptr.

- speed tests shows that shared_ptr is very slow (due to thread safety?)
the new version is much better, though not perfect.

- Hence introducing weak views.

- also :
-- clean the guard mechanism for python (to allow returning from python without any python ref left).
-- clean code, add documentation for mem_block
-- remove nan init, which was not working, and corresponding test
-- serialisation of view still unchanged (need to forbid serialization of view ??).

- tests ok, incl. valgrind tests.
2013-07-23 08:13:44 +02:00
Olivier Parcollet
f2c7d449cc First commit : triqs libs version 1.0 alpha1
for earlier commits, see TRIQS0.x repository.
2013-07-17 19:24:07 +02:00