10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-30 00:44:28 +02:00

Lazy evaluation of bit_kind_size

This commit is contained in:
Anthony Scemama 2014-09-17 12:34:31 +02:00
parent 9bce6b8a2e
commit 5ec739084a
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ let of_int64_list l =
(* Compute n_int *) (* Compute n_int *)
let n_int_of_mo_tot_num mo_tot_num = let n_int_of_mo_tot_num mo_tot_num =
let bit_kind_size = Bit_kind_size.to_int Qpackage.bit_kind_size in let bit_kind_size = Bit_kind_size.to_int (Lazy.force Qpackage.bit_kind_size) in
N_int_number.of_int ( (mo_tot_num-1)/bit_kind_size + 1 ) N_int_number.of_int ( (mo_tot_num-1)/bit_kind_size + 1 )
;; ;;

View File

@ -10,7 +10,7 @@ Please source the quantum_package.rc file."
| Some x -> x | Some x -> x
;; ;;
let bit_kind_size = let bit_kind_size = lazy (
let filename = root^"/src/Bitmask/bitmasks_module.f90" in let filename = root^"/src/Bitmask/bitmasks_module.f90" in
if not (Sys.file_exists_exn filename) then if not (Sys.file_exists_exn filename) then
raise (Failure ("File "^filename^" not found")); raise (Failure ("File "^filename^" not found"));
@ -37,5 +37,5 @@ let bit_kind_size =
| _ -> get_data tail | _ -> get_data tail
end end
in in
get_data lines get_data lines )
;; ;;