• [^] # Re: Dommage...

    Posté par . En réponse à la dépêche OCaml 3.10.0 est sorti. Évalué à 6.

    écrire un produit de matrice de façon fonctionnelle, c'est ridicule

    open Array

    let ( @@ ) f g x = f (g x)

    let produit mata matb =
    ....let coeff li col =
    ........fold_left ( + ) 0
    ............(init (length matb) (fun k -> mata.(li).(k) * matb.(k).(col)))
    ....in
    ....init (length mata) (init (try length matb.(0) with _ -> 0) @@ coeff)

    100% tableaux non mutables (non mutés, en tout cas).