12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758(**************************************************************************)(* *)(* This file is part of CAISAR. *)(* *)(* Copyright (C) 2024 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* You can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)openBasetypet=intarray[@@derivingord,eq]letto_array=Array.copyletto_array_unsafex=xletof_array=Array.copyletto_list=Array.to_listletof_list=Array.of_listletrank=Array.lengthletsizet=Array.foldt~f:(*)~init:1letppfmtx=Fmt.pffmt"[%a]"Fmt.(array~sep:semiint)xletshows=Fmt.str"%a"ppsletget=Array.getletsettkv=lett=Array.copytinArray.settkv;tletrow_majorta=assert(Array.lengtht=Array.lengtha);letr=ref0infori=0toArray.lengtht-1dor:=(!r*t.(i))+a.(i)done;!rletunrow_majorti=letr=refiinleta=Array.create~len:(Array.lengtht)0infori=Array.lengtht-1downto0doa.(i)<-!r%t.(i);r:=!r/t.(i)done;a