You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 3793 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Reed Wilson
Version: 3.08.3
OS: Windows XP
Submission from: pool0052.cvx20-bradley.dialup.earthlink.net (209.179.250.52)
I noticed a few minutes ago that Bigarray.Array3.of_array is not working. The
values in the last dimension are all the same. Looking at bigarray.ml, I find:
let of_array kind layout data =
let dim1 = Array.length data in
let dim2 = if dim1 = 0 then 0 else Array.length data.(0) in
let dim3 = if dim2 = 0 then 0 else Array.length data.(0).(0) in
let ba = create kind layout dim1 dim2 dim3 in
let ofs = if (Obj.magic layout : 'a layout) = c_layout then 0 else 1 in
for i = 0 to dim1 - 1 do
let row = data.(i) in
if Array.length row <> dim2 then
invalid_arg("Bigarray.Array3.of_array: non-cubic data");
for j = 0 to dim2 - 1 do
let col = row.(j) in
if Array.length col <> dim3 then
invalid_arg("Bigarray.Array3.of_array: non-cubic data");
for k = 0 to dim3 - 1 do
set ba (i + ofs) (j + ofs) (k + ofs) col.(j)
done
done
done;
ba
I'm quite sure that the assignment in the center should be:
set ba (i + ofs) (j + ofs) (k + ofs) col.(k)
The current assignment is ba.{i,j,k} <- data.(i).(j).(j), which doesn't make a
lot of sense.
The text was updated successfully, but these errors were encountered:
Original bug ID: 3793
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)
Bug description
Full_Name: Reed Wilson
Version: 3.08.3
OS: Windows XP
Submission from: pool0052.cvx20-bradley.dialup.earthlink.net (209.179.250.52)
I noticed a few minutes ago that Bigarray.Array3.of_array is not working. The
values in the last dimension are all the same. Looking at bigarray.ml, I find:
let of_array kind layout data =
let dim1 = Array.length data in
let dim2 = if dim1 = 0 then 0 else Array.length data.(0) in
let dim3 = if dim2 = 0 then 0 else Array.length data.(0).(0) in
let ba = create kind layout dim1 dim2 dim3 in
let ofs = if (Obj.magic layout : 'a layout) = c_layout then 0 else 1 in
for i = 0 to dim1 - 1 do
let row = data.(i) in
if Array.length row <> dim2 then
invalid_arg("Bigarray.Array3.of_array: non-cubic data");
for j = 0 to dim2 - 1 do
let col = row.(j) in
if Array.length col <> dim3 then
invalid_arg("Bigarray.Array3.of_array: non-cubic data");
for k = 0 to dim3 - 1 do
set ba (i + ofs) (j + ofs) (k + ofs) col.(j)
done
done
done;
ba
I'm quite sure that the assignment in the center should be:
set ba (i + ofs) (j + ofs) (k + ofs) col.(k)
The current assignment is ba.{i,j,k} <- data.(i).(j).(j), which doesn't make a
lot of sense.
The text was updated successfully, but these errors were encountered: