Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003962OCamlOCaml otherlibspublic2006-01-25 14:472012-06-21 20:12
ReporterChristophe Troestler 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version3.09.0 
Target VersionFixed in Version 
Summary0003962: polymorphic Bigarray.kind_eq
DescriptionIt would be nice to have the following function in Bigarray

  val kind_eq : ('a, 'b) Bigarray.kind -> ('c, 'd) Bigarray.kind -> bool

While not difficult to write, it requires the use of Obj.magic which is better to avoid in ones code. In the same vein,

  val layout_eq : 'a Bigarray.layout -> 'b Bigarray.layout -> bool

would be nice as well (or [is_fortran_layout : 'a Bigarray.layout -> bool] and [is_c_layout : 'a Bigarray.layout -> bool]).
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0003526)
Christophe Troestler (reporter)
2006-01-30 23:55

Actually more is necessary:
val kind_match :
  float:(float -> 'a) ->
  complex:(Complex.t -> 'a) ->
  int:(int -> 'a) ->
  int32:(int32 -> 'a) ->
  int64:(int64 -> 'a) ->
  nativeint:(nativeint -> 'a) ->
  char:(char -> 'a) -> ('b, 'c) Bigarray.kind -> 'b -> 'a
val kind_make :
  float:('a -> float) ->
  complex:('a -> Complex.t) ->
  int:('a -> int) ->
  int32:('a -> int32) ->
  int64:('a -> int64) ->
  nativeint:('a -> nativeint) ->
  char:('a -> char) -> ('b, 'c) Bigarray.kind -> 'a -> 'b
val kind_map :
  float:(float -> float) ->
  complex:(Complex.t -> Complex.t) ->
  int:(int -> int) ->
  int32:(int32 -> int32) ->
  int64:(int64 -> int64) ->
  nativeint:(nativeint -> nativeint) ->
  char:(char -> char) -> ('a, 'b) Bigarray.kind -> 'a -> 'a

One probably wants to distinguish between float32 and float64, etc. (and not only between OCaml types as above) and to change the names which may not be so good.
I can provide more info on the application if that can serve as a motivation.

- Issue History
Date Modified Username Field Change
2006-01-25 14:47 Christophe Troestler New Issue
2006-01-30 23:55 Christophe Troestler Note Added: 0003526
2006-03-29 16:31 doligez Status new => acknowledged
2012-06-21 20:12 frisch Category OCaml general => OCaml otherlibs


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker