let basic_solve a b =
  let m = Array.length a in
  let n = Array.length a.(0) in
  let j i = (* Gives the first j such that c_ij isn't zero *)
    try
      for j = 0 to n-1 do
        if not (nearly_zero a.(i).(j)) then raise (Found j)
      done ; -1
    with Found j -> j
  in
  let x = Array.make n 0. in
    for i = m-1 downto 0 do
      (* Dealing with equation i. We extract the pivot j. *)
      let j = j i in
        if j = -1 then
          (* No freedom: there must be nothing to do. *)
          ( if abs_float b.(i) > 0.1 then
              ( Printf.printf "Error at %d: 0. <> %f\n%!" i b.(i) ;
                raise Unsolvable ) else
                Printf.printf "Admitted error %f at %d.\n%!" b.(i) i )
        else
          ( x.(j) <- b.(i) /. a.(i).(j) ;
            (* Update the constant vector. *)
            for ii = 0 to i do
              b.(ii) <- b.(ii) -. x.(j) *. a.(ii).(j)
            done )
    done ;
    x