Re: general algorithm advice



aldousd666 wrote:
I don't care what language we're talking about, but I do mostly C-like
languages, so perhaps an imperative or Object oriented approach would
be helpful, but I'll take any kind of pseudocode.

The data I"m dealing with are arrays of 4 integer ordinal vectors,
like this:

A = { <a,b,c,d>, <d,e,f,g>, <a,b,c,d>... }
B = { <a,b,c,d>, <d,e,f,g>, <q,r,s,t>... }

I want to be able to find the union, difference, or intersection
(which all center I guess on testing for membership)...

Actually you can do it more efficiently by roughly bisecting sets
recursively (represented as balanced binary trees) rather than using
membership. Both OCaml and F# do this in their stdlib implementations and,
consequently, they are vastly faster than most other languages for this.

--
Dr Jon D Harrop, Flying Frog Consultancy
OCaml for Scientists
http://www.ffconsultancy.com/products/ocaml_for_scientists/?usenet
.



Relevant Pages

  • Re: GoTo in Java
    ... but only to some extent - changing languages has to be ... MF has to support a lot of platforms, ... with, say, the free open-source OCaml compilers. ... Sometimes they're bugs in the *old* implementa- ...
    (comp.lang.cobol)
  • Re: Lisp and OCaml, why?
    ... > interpreted languages as possible over time, if not to use them at ... > lisp and OCaml though - why would someone use them in preference to ... Strong, static typing catches type errors at compile time, reducing ...
    (comp.programming)
  • Re: Compiler and an interpreter
    ... > OCaml is more general and can be reused. ... >> choose between languages. ... since elsewhere you talk about efficiency?) ... For really complicate formulae, OCaml will be relatively ...
    (comp.programming)
  • Re: Design Patterns and Functional programming
    ... OCaml, Standard ML and Scala. ... Impurity is not required, as purely functional languages do exist, but it ... the model-view-controller design pattern. ... Then you can use pattern matching to manipulate ...
    (comp.object)
  • Re: Constants, Static, Public, Private
    ... like languages like OCaml, which offers all three of the alternatives ... they were private functions (which ... OCaml has all three because it's an ML derivative, ... Dynamic closures, by the way, are a fourth kind of "local function" ...
    (comp.lang.cobol)