lamawithonel_ has quit [Ping timeout: 255 seconds]
lamawithonel__ has joined #ocaml
Tobu_ has joined #ocaml
Tobu has quit [Read error: Connection reset by peer]
lamawithonel__ has quit [Excess Flood]
lamawithonel__ has joined #ocaml
lamawithonel__ has quit [Excess Flood]
lamawithonel__ has joined #ocaml
thilp has left #ocaml []
jamii has joined #ocaml
alexyk has quit [Quit: alexyk]
alexyk has joined #ocaml
Goncalo has quit [Ping timeout: 244 seconds]
Tobu_ has quit [Remote host closed the connection]
Tobu has joined #ocaml
Cyanure has quit [Remote host closed the connection]
joewilliams_away is now known as joewilliams
nannto___ has joined #ocaml
nannto_ has quit [Ping timeout: 244 seconds]
nannto___ has quit [Read error: Connection reset by peer]
nannto_ has joined #ocaml
jamii has quit [Ping timeout: 258 seconds]
sgnb has quit [Ping timeout: 260 seconds]
alexyk has quit [Quit: alexyk]
<NaCl>
Xaseron: if the operation takes less than a second, it won't show up
<NaCl>
Xaseron: try Unix.gettimeofday ()
<NaCl>
not sure how good the resolution is
<NaCl>
but it's more than one second
_nejimban has joined #ocaml
nejimban has quit [Ping timeout: 244 seconds]
_nejimban is now known as nejimban
willb has quit [Ping timeout: 244 seconds]
willb has joined #ocaml
dnolen has quit [Quit: dnolen]
Tobu has quit [Ping timeout: 258 seconds]
impy has joined #ocaml
Tobu has joined #ocaml
Tobu has quit [Changing host]
Tobu has joined #ocaml
joewilliams is now known as joewilliams_away
KDr2 has joined #ocaml
ulfdoz has joined #ocaml
vivanov has joined #ocaml
impy has quit [Quit: impy]
impy has joined #ocaml
KDr2 has quit [Ping timeout: 252 seconds]
KDr2 has joined #ocaml
philtor has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
alexyk has joined #ocaml
vivanov has quit [Ping timeout: 252 seconds]
ikaros has joined #ocaml
vivanov has joined #ocaml
ankit9 has joined #ocaml
sgnb has joined #ocaml
eye-scuzzy has quit [Quit: leaving]
Tobu_ has joined #ocaml
Tobu has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 255 seconds]
Tobu_ has quit [Quit: No Ping reply in 180 seconds.]
Tobu has joined #ocaml
ygrek has joined #ocaml
mfp has joined #ocaml
pheredhel is now known as phere
jamii has joined #ocaml
phere is now known as Pheredhel
vivanov has quit [Ping timeout: 260 seconds]
vivanov has joined #ocaml
edwin has joined #ocaml
ankit9 has quit [Quit: Leaving]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
<adrien>
NaCl: you were still using my "add_row" function a few days ago, got rid of it by now? :P
jamii has quit [Ping timeout: 240 seconds]
<adrien>
NaCl: and, yeah, I don't think whatever I had made would play nicely with lwt
vivanov has quit [Ping timeout: 276 seconds]
vivanov has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 258 seconds]
alexyk has quit [Quit: alexyk]
galaad has joined #ocaml
eye-scuzzy has joined #ocaml
galaad has quit [Client Quit]
vivanov has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 260 seconds]
ankit9 has joined #ocaml
ankit9 has quit [Client Quit]
ankit9 has joined #ocaml
vivanov has joined #ocaml
ftrvxmtrx has joined #ocaml
lewis1711 has joined #ocaml
Morphous_ has quit [Ping timeout: 255 seconds]
<lewis1711>
when should you use a list and when should you use an array? in an imperative language I'd use a list when I want first insertion and removal, and an array for all other situations, but ocaml seems to be very list-centric, and I only see arrays used when mutating values in place
<adrien>
arrays mix well with imperative code and lists mix well with functional code :-)
<rixed_>
lewis1711: I don't think your question should be specific to the language. IMHO, you should use an array whenever you'd use one in another language (ie, mostly when number of elements is static)
<lewis1711>
aren't list operations more efficient when lists are immutable though? because you can do things like joining lists without copying
munga has joined #ocaml
<flux>
lewis1711, actually that's an interesting question. you can only avoid copying on of the lists, the other you must copy because you need to modify its last element.
<flux>
on the other hand, if you need to concatenate two mutable doubly linked lists together and you don't need the original lists any more, you can do it in constant time..
<flux>
lewis1711, in ocaml, however, list is the basic data structure and one would use array only if you need fast random access or mutability
<lewis1711>
the function that brought this question up was (maths) vector addition. it's one line using lists to represent the vectors with map2, but with arrays I can't do it without a for loop
<rixed_>
lewis1711: le stdlib Array module is lacking behind the list module ; you should use batteries to have the same set of operations on lists and arrays (when that makes sense of course)
<flux>
I would use arrays for vectors as well as for matrices. it is typical to access vectors by their index.
<flux>
or, if you have fixed-size vectors such as 2-vectors or 3-vectors, a record of floats
<flux>
(or possibly a tuple, but that's less efficient in ocaml)
<lewis1711>
the former.
<lewis1711>
so batteries provides the same functions for both? I think I have it somewhere
palomer has quit [Quit: Do fish get thirsty?]
<flux>
you should get a recent version of it, in case you have some oooold one lying around ;)
zorun has joined #ocaml
<rixed_>
additionally, arrays should be faster to alloc and garbage collect than lists
milosn has quit [Quit: leaving]
milosn has joined #ocaml
vivanov has quit [Read error: Connection reset by peer]
ikaros has quit [Quit: Ex-Chat]
vivanov has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
alfa_y_omega has quit [Ping timeout: 252 seconds]
alfa_y_omega has joined #ocaml
Tobu has quit [Ping timeout: 264 seconds]
vivanov has quit [Ping timeout: 240 seconds]
Tobu has joined #ocaml
Skitter has joined #ocaml
Amorphous has joined #ocaml
avsm has joined #ocaml
KDr2 has quit [Quit: Leaving.]
lopex has joined #ocaml
axiles has joined #ocaml
iratsu has quit [Ping timeout: 250 seconds]
schmrkc has quit [Read error: Connection reset by peer]
schmrkc has joined #ocaml
schmrkc has quit [Changing host]
schmrkc has joined #ocaml
iratsu has joined #ocaml
iratsu has quit [Ping timeout: 250 seconds]
avsm has quit [Quit: Leaving.]
iratsu has joined #ocaml
lewis1711 has left #ocaml []
munga has quit [Read error: Operation timed out]
schmrkc has quit [Read error: Connection reset by peer]
schme has joined #ocaml
schme has quit [Changing host]
schme has joined #ocaml
schme is now known as schmrkc
KDr2 has joined #ocaml
KDr2 has quit [Remote host closed the connection]
digimmortal has joined #ocaml
lamawithonel__ has quit [Read error: Connection reset by peer]
larhat has joined #ocaml
Modius has joined #ocaml
Skitter has quit [Ping timeout: 246 seconds]
avsm has joined #ocaml
munga has joined #ocaml
vivanov has joined #ocaml
ftrvxmtrx has joined #ocaml
ski has quit [Ping timeout: 260 seconds]
ski has joined #ocaml
lamawithonel has joined #ocaml
iratsu has quit [Ping timeout: 250 seconds]
Snark has joined #ocaml
iratsu has joined #ocaml
sepp2k has joined #ocaml
mbac has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lopex has quit []
lamawithonel has joined #ocaml
oriba has joined #ocaml
oriba has left #ocaml []
ikaros has joined #ocaml
vivanov has quit [Quit: Lost terminal]
vivanov has joined #ocaml
impy has quit [Ping timeout: 255 seconds]
ankit9 has quit [Quit: Leaving]
vivanov has quit [Quit: Lost terminal]
vivanov has joined #ocaml
<vivanov>
strange there are no plplot bindings in debian
<gildor>
vivanov: I tried once to do it, but given up
<vivanov>
@gildor: :)
<NaCl>
no need for the @. :P
<hcarty>
vivanov: One of the PLplot authors talked about it, but I haven't heard anything since
<hcarty>
vivanov: PLplot is somewhat unique in that the core library + bindings + Debian packaging are all in the same repository
<hcarty>
Maybe unique is the wrong word... I'm sure other libraries exist which do the same. But it's not common.
<vivanov>
hcarty: ic
vivanov has quit [Quit: Lost terminal]
<hcarty>
vivanov: Unfortunately, I'm the only OCaml PLplot developer and I don't have enough time + experience to setup a Debian package
<hcarty>
I've considered splitting out the OCaml bindings to make the packaging process easier. That, unfortunately, makes binding upkeep more difficult.
alexyk has joined #ocaml
Tobu has quit [Quit: No Ping reply in 210 seconds.]
Tobu has joined #ocaml
bzzbzz has quit [Quit: leaving]
joewilliams_away is now known as joewilliams
mbac has left #ocaml []
digimmortal has quit [Ping timeout: 240 seconds]
alexyk has quit [Quit: alexyk]
avsm has quit [Quit: Leaving.]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
lamawithonel has quit [Read error: Connection reset by peer]
lamawithonel has joined #ocaml
alexyk has joined #ocaml
alexyk has quit [Client Quit]
alexyk has joined #ocaml
alexyk has quit [Client Quit]
ulfdoz has joined #ocaml
impy has joined #ocaml
impy has quit [Client Quit]
impy has joined #ocaml
bzzbzz has joined #ocaml
ftrvxmtrx has joined #ocaml
<NaCl>
how would I get specific flags to go into camlp4 when using ocamlbuild with ocamlfind?
<thelema_>
flag ["ocaml"; "compile"; "ocamlviz_auto"] (S[A"-ppopt"; A"camlp4 pa_o.cmo s
<thelema_>
tr.cma pa_ocamlviz.cmo pr_o.cmo"]);
<thelema_>
that's an ocamlbuild-only solution
vivanov has joined #ocaml
Boscop has quit [Ping timeout: 255 seconds]
alexyk has joined #ocaml
vivanov has quit [Quit: Lost terminal]
ankit9 has joined #ocaml
Boscop has joined #ocaml
vivanov has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
lopex has joined #ocaml
Snark has quit [Quit: Ex-Chat]
jamii has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
larhat has quit [Quit: Leaving.]
jamii has quit [Ping timeout: 258 seconds]
lamawithonel has joined #ocaml
ztfw has joined #ocaml
mnabil has joined #ocaml
alfa_y_omega has quit [Ping timeout: 240 seconds]
jamii has joined #ocaml
alfa_y_omega has joined #ocaml
mnabil has quit [Remote host closed the connection]
<edwin>
or is the license an issue? (Cecill-B, looks like some BSD variant without a warranty disclaimer)
ulfdoz has quit [Ping timeout: 255 seconds]
<sgnb>
edwin: someone to take care of it
<sgnb>
(mostly)
<Xaseron>
i get this error message ('_a avltree * '_a avltree, int) Hashtbl.t,
<Xaseron>
contains type variables that cannot be generalized
<Xaseron>
in the interpreeter everythings worksfine but not when i try to compile it
<thelema_>
Xaseron: mutable values (such as hashtables) at the toplevel can't be polymorphic
<thelema_>
if they were, you could put in a value of one type and get back out a value of another type
<thelema_>
A type annotation of the type you want it to be will fix this.
<Xaseron>
hmm ok better than nothing
<thelema_>
another solution is to move that hashtable within a function, so it can only be used with one type
lamawithonel has quit [Remote host closed the connection]
oriba has joined #ocaml
<edwin>
or would the functorized version work at toplevel?
<edwin>
with a slight overhead from functorization
<thelema_>
edwin: the functorized version is monomorphic
<thelema_>
so no problems
<Xaseron>
is there some kind of lookup table in ocaml which checks for physical equallity?
<thelema_>
Xaseron: no, hash-consing has to be done manually
munga has quit [Ping timeout: 240 seconds]
<thelema_>
Xaseron: re-reading your question, I think I may have answered it incorrectly - you want an associative data structure keyed on pointers?
<Xaseron>
i explain the problem in total i have an AVL tree and i try to calculate the height of a tree and to speed up it, i want to use a lookup table
<thelema_>
can't you store the height in each node?
<thelema_>
let rec depth = function | Nil -> 0 | Node (_,l,r) -> 1 + max (depth l) (depth r) in
<thelema_>
If you want to squeeze out the last bit of performance, don't use max on ints, use an explicit if then, as the polymorphic compare used by max is relatively more expensive than integer comparison
<thelema_>
I still recommend keeping the height in the tree.
<Xaseron>
to much changes in the code
<Xaseron>
deadline is fryday an i have to learn for an exam on fryday too
<thelema_>
the compiler wll help you find all the places you have to add an extra component
<thelema_>
but okay.
<Xaseron>
the performance of my redblack and btree is quite good
jamii has joined #ocaml
<thelema_>
if I were you, I wouldn't separate this function, as you'll traverse your tree repeatedly
lamawithonel has quit [Excess Flood]
<thelema_>
make one function to balance an unbalanced tree that does one traversal and passes up the depths of the children
lamawithonel has joined #ocaml
lamawithonel has quit [Excess Flood]
<thelema_>
also, isn't avl height-balanced - "depth" seems the wrong word for the longest path down to a leaf
lamawithonel has joined #ocaml
<Xaseron>
impressive speed up from if then else
<thelema_>
as I said, max isn't optimal on ints
* thelema_
adds Int.max to batteries
<Xaseron>
is there some function to get the cpu cycles?
<thelema_>
Sys.time gives CPU+System time, but is only accurate to 1/100th sec on my system
george_z0rwell has joined #ocaml
<Xaseron>
im allready using this, but cpu cycles would be better for a comparison
<thelema_>
If you're on a multicore system, using the assembly instruction to get CPU cycles is error-prone, as this value isn't synchronized between cores and your process can migrate from one core to another between measurements
lamawithonel has quit [Ping timeout: 255 seconds]
Reaganomicon has quit [Ping timeout: 240 seconds]
lamawithonel has joined #ocaml
<Xaseron>
thelema_: then i would use taskset to bind the programm to one core
ztfw has quit [Remote host closed the connection]
<thelema_>
Linux abstracts this capability into the get_cycles function:
<thelema_>
I've been tempted to wrap this for ocaml, but haven't done so. It should be pretty straightforward, if you've done that kind of thing before