mirror of
https://github.com/triqs/dft_tools
synced 2024-11-01 11:43:47 +01:00
4d0bb56790
- clean array, matrix, vector expression template they take const & of objects, or move && objects no more views. -> C++11 modernisation - Fix a bug in array resize : it was resetting the indexmap to C memory layout e.g. for a fortran array - Fix a bug in read h5 array when not in C order (forgot an else, the array was read twice).
66 lines
831 B
Plaintext
66 lines
831 B
Plaintext
A =
|
|
[[0,1]
|
|
[10,11]]
|
|
B =
|
|
[[0,2]
|
|
[1,3]]
|
|
(
|
|
[[0,1]
|
|
[10,11]] + (2 *
|
|
[[0,2]
|
|
[1,3]]))
|
|
-------
|
|
Cuboid of rank 2 and dimensions (2 2)
|
|
----EVAL ---
|
|
C = A + 2*B =
|
|
[[0,5]
|
|
[12,17]]
|
|
C = A+B =
|
|
[[0,3]
|
|
[11,14]]
|
|
Af =
|
|
[[0,1]
|
|
[10,11]]
|
|
Bf =
|
|
[[1,2]
|
|
[1,3]]
|
|
Cuboid of rank 2 and dimensions (2 2)
|
|
computing Cf = Af * Bf
|
|
Cf =
|
|
[[1,3]
|
|
[21,53]]
|
|
matrix( Af * Bf )
|
|
[[1,3]
|
|
[21,53]]
|
|
matrix( Af * (Bf + Cf) )
|
|
[[22,56]
|
|
[262,666]]
|
|
(A) --->
|
|
[[0,1]
|
|
[10,11]]
|
|
(make_matrix( 2*A )) --->
|
|
[[0,2]
|
|
[20,22]]
|
|
(A+ 2) ---> (
|
|
[[0,1]
|
|
[10,11]] + 2)
|
|
(make_matrix(A+2 )) --->
|
|
[[2,1]
|
|
[10,13]]
|
|
(make_matrix(1 + A )) --->
|
|
[[1,1]
|
|
[10,12]]
|
|
(make_vector( V2 + 2.0 *V)) ---> [12,24,36]
|
|
(Af) --->
|
|
[[0,1]
|
|
[10,11]]
|
|
(1/Af) ---> (1 * inverse(
|
|
[[0,1]
|
|
[10,11]]))
|
|
(make_matrix(2/Af)) --->
|
|
[[-2.2,0.2]
|
|
[2,0]]
|
|
(make_matrix(Af/2)) --->
|
|
[[0,0.5]
|
|
[5,5.5]]
|