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() &&
mesh_pt should NOT be done directly by (),
it should be casted to matsubara_freq.
Removed an old line of code which we forgot to clean
when introducing matsubara_freq
A(i_)(om_) << ...
for A an array of gf was not working.
Modified the auto_assign of arrays to handle the case when the object
in the array is itself autoassigned.
Using the model of std::vector adapter for clef, which works.
Also fixed the gf for a little details (gf_impl is usually in the expression tree, not gf).
- bool at_end() for a mesh point means AFTER the last point ,
as end in STL. It was not correct ( +1 missing).
- also the at_end was not computed in the mesh product.
- it slightly changes the test_fit_tail --> just changed the output.
--> did this bug affect other functions/codes ?
- correct previous commit (for scalar gf, the new check was not compiling)
- correct windowing of linear mesh (left point corrected as right point for rounding error
-> code was previously assuming mesh with only positive, fermionic matsubara freqs
-> changed wn_min to n_min (was misleading, since it was an index, not a frequency) / same for <-> max
-> changed doc accordingly
-> Previously, calculation was implicitly assuming a mesh with only positive matsubara frequencies.
-> Added corresponding test
-> Also added test of density calculation with or without correct tail.
- add c14 include
- the C++14 is lot more readable (due to generic lambda).
- for mesh/product.hpp -> now 2 versions (C++14 and C++11 for temporary
backward compatibility).
Pb :
M() = rhs; // rhs of type RHS
Currenlty does :
M(i,j) = (i==j ? rhs : RHS{})
Changed to
M(i,j) = (i==j ? rhs : RHS{0*rhs})
If RHS is a double, int ... Same result.
If RHS is a matrix, gf, currently the offdiag elements
are default constructed (i.e. of 0 size !).
Which can break operations later (matrix<matrix<double>>)
After change : all elements have the same size !
- use alias
- rename a few things, simplify
- some clang format
- add eval to ref wrapper
- correct evaluator general (return const &, no copy)
- correct declaration order of struct and operator OP
- forgot to correct the value_type of matrix_expr, and vector_expr
as was done long ago for arrays...
- also added cases for arrays until dim 10
- TODO : replace this trait in arrays with a tuple tools for any dim..
not urgent.
- for pieces that need to be precomputed for several
measures.
- put them under shared_ptr, and register then with add_measure_aux.
- they must be callable, as void ().
- TODO : add this in the doc when tested
- the condition p%2 ==1 was wrong if p<0 (never true!)
- added corresponding test (gf_notail)
Conflicts:
triqs/gfs/imtime.hpp
Fixed by O.P. : already fixed in Laura's pull request ...
- gf<cartesian_product<imfreq,imfreq>> was not correct
when out bounds. Fixed evaluator.
- tensor_proxy : fix the trait for algebra which was incorrect.
- TODO: clean code (repetition, put in mesh some windowing).