mirror of
https://github.com/LCPQ/quantum_package
synced 2025-01-10 21:18:29 +01:00
Reduced memory in qp_edit
This commit is contained in:
parent
32208d35f9
commit
f71fa7ff6b
@ -333,18 +333,18 @@ psi_det = %s
|
|||||||
;;
|
;;
|
||||||
|
|
||||||
let of_rst r =
|
let of_rst r =
|
||||||
let r = Rst_string.to_string r
|
let dets = Rst_string.to_string r
|
||||||
in
|
in
|
||||||
|
|
||||||
(* Split into header and determinants data *)
|
(* Split into header and determinants data *)
|
||||||
let idx = String.substr_index_exn r ~pos:0 ~pattern:"\nDeterminants"
|
let idx = String.substr_index_exn dets ~pos:0 ~pattern:"\nDeterminants"
|
||||||
in
|
in
|
||||||
let (header, dets) =
|
let header =
|
||||||
(String.prefix r idx, String.suffix r ((String.length r)-idx-1) )
|
String.prefix dets idx
|
||||||
in
|
in
|
||||||
|
|
||||||
(* Handle header *)
|
(* Handle header *)
|
||||||
let header = r
|
let header = header
|
||||||
|> String.split ~on:'\n'
|
|> String.split ~on:'\n'
|
||||||
|> List.filter ~f:(fun line ->
|
|> List.filter ~f:(fun line ->
|
||||||
if (line = "") then
|
if (line = "") then
|
||||||
@ -364,7 +364,7 @@ psi_det = %s
|
|||||||
let dets_stream =
|
let dets_stream =
|
||||||
|
|
||||||
let ipos, jmax =
|
let ipos, jmax =
|
||||||
ref (-1), String.length dets
|
ref idx, String.length dets
|
||||||
in
|
in
|
||||||
let next_line =
|
let next_line =
|
||||||
Stream.from (fun _ ->
|
Stream.from (fun _ ->
|
||||||
|
Loading…
Reference in New Issue
Block a user