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

17 Commits

Author SHA1 Message Date
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
c06e183ae5 arrays : revised version of map & fold
- also cleaned a bit reinterpretview example
2013-09-11 18:39:25 +02:00
Olivier Parcollet
27be5cbd5b arrays: fix some test to avoid valgrind error 2013-09-08 11:58:37 +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
Olivier Parcollet
0464c8e3b6 move one test to c++11 for obsolete gcc
alias_const_view test is c++11 only.
does not work on gcc 4.6
2013-08-27 14:32:52 +02:00
Olivier Parcollet
0f524b26fc work on doc 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
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
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
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
893736dbbf added two little tests ...
- draft of reinterpret_array_view and immutable_diagonal_matrix
2013-07-26 18:23:46 +02:00
Olivier Parcollet
f4d42a4ec8 arrays : clean an old example 2013-07-23 08:13:52 +02:00
Olivier Parcollet
552c440238 arrays : add ConstView to fix const correctness
- A()(0) = 1
will not work any more if A is const, as it should be.

- Introduced the notion of const_view, simply done by a flag
(flag 0, for easy debug)
- changed the slice of ISP to use it (only on C++11 compliant compiler)
- Move BoundCheck Flags to 5.
2013-07-23 08:13:52 +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