mirror of
https://github.com/LCPQ/quantum_package
synced 2025-05-06 07:05:25 +02:00
Lazy evaluation of bit_kind_size
This commit is contained in:
parent
9bce6b8a2e
commit
5ec739084a
@ -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 )
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
@ -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 )
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user