package mula
ML's Universal Levenshtein Automata library
Install
dune-project
Dependency
Authors
Maintainers
Sources
mula-0.1.1.tbz
sha256=ee5333b6f30b68a26af55b7f2f5a1f4f1189c13f4b678735da5dbb4685d0e225
sha512=22f63d6a077b5825d0b1ce076fa23f39bf4ae4280befec0a8765079fb9f542de2858e9a51e86547d47017c646dfe2c9d1fdd1c99d9f4c30aebf4f7cc06cfe995
doc/src/mula.internal/bitVec.ml.html
Source file bitVec.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
type t = Bits of int [@@unboxed] let[@inline] compare (Bits x) (Bits y) = Int.compare x y let get k (Bits n) = let two_to_k = Int.shift_left Int.one (k - 1) in if Int.equal (Int.logand two_to_k n) 0 then false else true let get_lane ~lane:l ~k bv = get (k + 1 - l) bv let get_right_of_lane ~lane:l ~k ~m bv = get_lane ~lane:(l + m) ~k bv let get_left_of_lane ~lane:l ~k ~m bv = get_lane ~lane:(l - m) ~k bv let rec pos_fold ~f ~init n = match n with | 0 -> init | n -> pos_fold ~f ~init:(f n init) (n - 1) let snoc_one (Bits n) = let n' = Int.logor Int.one (Int.shift_left n 1) in Bits n' let snoc_ones (Bits n) ~m = if m >= Sys.int_size then Bits (Int.minus_one) else let one_m_zeros = Int.shift_left Int.one m in let m_ones = one_m_zeros - 1 in let n' = Int.logor m_ones (Int.shift_left n m) in Bits n' let ones ~m = snoc_ones (Bits Int.zero) ~m let snoc_zero (Bits n) = Bits (Int.shift_left n 1) let snoc_zeros (Bits n) ~m = if m >= Sys.int_size then Bits (Int.zero) else let n' = Int.shift_left n m in Bits n' let zero = (Bits Int.zero) let pp_bv ppf (Bits n)= Format.fprintf ppf "%o" n
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>