mirror of
https://gitlab.com/scemama/QCaml.git
synced 2024-08-30 00:03:42 +02:00
minor changes
This commit is contained in:
parent
91a2ec1288
commit
58f51dbecf
16
.merlin
16
.merlin
@ -1,12 +1,8 @@
|
|||||||
PKG str unix bigarray lacaml zarith mpi alcotest
|
EXCLUDE_QUERY_DIR
|
||||||
|
B _build/default/.run_hartree_fock.eobjs/byte
|
||||||
|
B _build/default/Basis/.Basis.objs/byte
|
||||||
|
B _build/default/Nuclei/.Nuclei.objs/byte
|
||||||
S .
|
S .
|
||||||
S Test
|
|
||||||
S Nuclei
|
|
||||||
S Parallel
|
|
||||||
S CI
|
|
||||||
S Utils
|
|
||||||
S Basis
|
S Basis
|
||||||
S SCF
|
S Nuclei
|
||||||
S MOBasis
|
FLG -w @a-4-29-40-41-42-44-45-48-58-59-60-40 -strict-sequence -strict-formats -short-paths -keep-locs
|
||||||
S CI
|
|
||||||
B _build/**
|
|
||||||
|
@ -3,13 +3,16 @@ open Lacaml.D
|
|||||||
let full_ldl m_A =
|
let full_ldl m_A =
|
||||||
|
|
||||||
let n = Mat.dim1 m_A in
|
let n = Mat.dim1 m_A in
|
||||||
|
|
||||||
assert (Mat.dim2 m_A = n);
|
assert (Mat.dim2 m_A = n);
|
||||||
|
|
||||||
let v_D = Vec.make0 n in
|
let v_D = Vec.make0 n in
|
||||||
|
|
||||||
let m_Lt = Mat.identity n in
|
let m_Lt = Mat.identity n in
|
||||||
|
|
||||||
let v_D_inv = Vec.make0 n in
|
let v_D_inv = Vec.make0 n in
|
||||||
|
|
||||||
|
|
||||||
let compute_d j =
|
let compute_d j =
|
||||||
let l_jk =
|
let l_jk =
|
||||||
Mat.col m_Lt j
|
Mat.col m_Lt j
|
||||||
@ -20,6 +23,7 @@ let full_ldl m_A =
|
|||||||
m_A.{j,j} -. dot ~n:(j-1) l_jk l_jk__d_k
|
m_A.{j,j} -. dot ~n:(j-1) l_jk l_jk__d_k
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
let compute_l i =
|
let compute_l i =
|
||||||
let l_ik__d_k =
|
let l_ik__d_k =
|
||||||
Mat.col m_Lt i
|
Mat.col m_Lt i
|
||||||
@ -33,6 +37,7 @@ let full_ldl m_A =
|
|||||||
v_D_inv.{j} *. ( m_A.{j,i} -. dot ~n:(j-1) l_ik__d_k l_jk )
|
v_D_inv.{j} *. ( m_A.{j,i} -. dot ~n:(j-1) l_ik__d_k l_jk )
|
||||||
in
|
in
|
||||||
|
|
||||||
|
|
||||||
for i=1 to n do
|
for i=1 to n do
|
||||||
for j=1 to (i-1) do
|
for j=1 to (i-1) do
|
||||||
m_Lt.{j,i} <- compute_l i j;
|
m_Lt.{j,i} <- compute_l i j;
|
||||||
@ -85,12 +90,12 @@ let pivoted_ldl threshold m_A =
|
|||||||
let rec aux (pos,value) i =
|
let rec aux (pos,value) i =
|
||||||
if i > n then
|
if i > n then
|
||||||
pos
|
pos
|
||||||
else if m_D.{i} > value then
|
else if v_D.{i} > value then
|
||||||
aux i m_D.{i} (i+1)
|
aux i v_D.{i} (i+1)
|
||||||
else
|
else
|
||||||
aux pos value (i+1)
|
aux pos value (i+1)
|
||||||
in
|
in
|
||||||
let j = aux i m_D.{i} (i+1) in
|
let j = aux i v_D.{i} (i+1) in
|
||||||
let p_i, p_j = pi.(i), pi.(j) in
|
let p_i, p_j = pi.(i), pi.(j) in
|
||||||
pi.(i) <- pj;
|
pi.(i) <- pj;
|
||||||
pi.(j) <- pi;
|
pi.(j) <- pi;
|
||||||
|
Loading…
Reference in New Issue
Block a user