[erlang-questions] [Erlang-Question] Is Erlang good for Matrix manipulation and AI related algorithms

Barco You barcojie@REDACTED
Wed Nov 9 06:31:12 CET 2011

Dear Erlangers,

As known, Erlang is born with inherent distributed-computing properties and
is good for lists manipulation, but currently I'm encountering a problem
that I don't know how to do with Erlang in an efficient way.

I hope to build a cubic matrix with I x J x K dimension (I,J,K are integers
and >= 2), for which the origin (index [1,1,1], or [0,0,0] for c/java/lisp)
is assigned with an initial value 1, and then the initial value is
unidirectionally message-passed to adjacent nodes. Every node gets a value
that is the sum of afferent messages and continue to pass its value deeper
forward, until the far-most node (with index [I,J,K]) gets a value. Taking
a 2x2x2 dimensional scenario as an example (in the attached picture, the
vertices of the cube represent the nodes of the matrix), we will get a
final matrix as [ [ [1,1], [1,2] ], [ [1,2], [2,6] ] ].

To implement this, I'll have two functions: gen_cubic([I,J,K]) -> list().
 get_value([i,j,k], Cubic::list()) -> number().

BTW: I heard of that Lisp is good for this kind of matter, but when I tried
to learn List yesterday I found it's so hard to read and the syntax is not
so natural as Erlang. So, if someone have more time, please give your
insights comparing these two language. I would appreciate that.

Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111109/d989bfcc/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cubic_matrix.png
Type: image/png
Size: 5998 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111109/d989bfcc/attachment.png>

More information about the erlang-questions mailing list