[Haskell-cafe] Where's the problem ?

2007-07-04 Thread Rome

Hi everyone,

I write a program for fast online multiplication, this means, leading digits
are computed first, so this program is able to handle real numbers. 

My program and Source-Code is available under
http://www.romeinf04.de http://www.romeinf04.de 

but only with german comments, because this is my master thesis.

Now the problem:
My program computes using the schoenhage-strassen multiply-subroutine the
output everytime only until the 32777th Digit, but then it holds without an
error message. Windows Task manager tells me CPU Usage 100% and Memory
Allocation is increasing.
Profiling told me, the function Algorithm.resultOfMult is using this memory.
To compute the 32777th digit, my program needs several digits of the
input-numbers including the 32800th.
I'm using GHC 6.6.1 with option -O2 to compile.

Output is row-wise by an IO-function, calling itself recursively with
updated parameters, hte output looks like:

dig11 dig21 -- res1
dig12 dig22 -- res2
dig12 dig23 -- res3
.
.
. and so on

If I use the Naive-Multiply-Subroutine, the problem occurs at the 16392th
digit.

A friend of mine compiled it under Linux and got:
.
.
.
32779 :  1   1 ---32776--  0
32780 :  1   0 ---32777-- -1
Main: Ix{Integer}.index: Index (32766) out of range ((0,32765))

If I convert every Integer into Int and use instead of the generic list
functions the prelude-list functions, it works.
I don't have any idea, where the problem might be...

Greetings

Roman

Please excuse my english writing, I'm from Germany.
-- 
View this message in context: 
http://www.nabble.com/Where%27s-the-problem---tf4022913.html#a11426358
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Deadlock in real number multiplication (Was: Where's the problem ?)

2007-07-04 Thread Rome

 A friend of mine compiled it under Linux and got:
 .
 .
 .
 32779 :  1   1 ---32776--  0
 32780 :  1   0 ---32777-- -1
 Main: Ix{Integer}.index: Index (32766) out of range ((0,32765))

 If I convert every Integer into Int and use instead of the generic list
 functions the prelude-list functions, it works.

--... and the result is right?

 I don't have any idea, where the problem might be...

--Stupid question: Did you pay enough attentation to carries? There might be
--an unresolvable dependency if you request a digit which depends on
--infinitely many carries from following digits.

Thx for your reply.
The next output-digit depends on several digits of the input, which are
determined by the rectangles defined in module /Schedule/. Every coordinate
of a single rectangle is unique by definition.
Because I use Signed-Digit-Representation, carries are only local in a
single call of the multiplication -subroutine. Further my program is the
implementation of an online-algorithm, leading digits are computed first, so
an infinte number of carries shouldn't be the reason, I think.
In my opinion there is something wrong with the use of Integer because of
the Linux-error message. 
I can only verify the correctness of the result of the first 30
output-digits, and these are okay in both cases: Int and Integer.
-- 
View this message in context: 
http://www.nabble.com/Where%27s-the-problem---tf4022913.html#a11435728
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe