Adept Scientific - English
The world's best software for research, science and engineering.
flag arrow
clearclear
 

 Adept Store | register Join My Adept | Flags  
Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055  
UKusdedksvnofi
Home
Products
Training
Consultancy
 Buy Online
Downloads
Education
Support
My Adept
International |  About Us |  Contact Us |  Press Room |  Jobs


The Next Steps

• Ask us a question
• Maple Product Tour
• Buy Maple Now
• View Maple Pricing
• Find out about Online Training
• Download a Brochure
• Request a Brochure
• Download a Demo
• Request a Demo
• Meet Our Team
• Read our RSS Feeds

Learn More

Maple Home
Maple 11 Professional
Maple 11 Academic
Maple 11 Student Use
Recorded Online Seminars
FREE Training Resources


MapleNet
Maple T.A.
MapleConnect
BlockImporter for Simulink
BlockBuilder for Simulink
Maple Toolboxes
Maple Rave Reviews
Maple Study Guides
Books about Maple
System Requirements

View Maple 10 in Action
Product Comparison Chart

Latest Information

New Features: Professional
New Features: Academic
The Maple Reporter
The Maple Reporter Online
Numerical Algorithms Group
(NAG)


Service & Support

Maple 10 Training Videos
MaplePrimes, blogs, forums
Elite Maintenance Program
Application Centre
Powertools
Maple User Group (MUG)
Join the Maple User Group
(MUG)

Search the Knowledge Base
Technical Support request

List Archives >  Maple User Group List Archive >  Archive by date >  This Month By Date >  This Month By Topic

[MUG] Too many levels of recursion

Search email archive for  

[MUG] Too many levels of recursion
Author:    Posted: Thu, 14 Nov 2002 12:33:52 EET

>> From: "guyer"

Has anybody an idea about the error message "(In Signature) Too many
levels of recursion" ? Is it my procedure's fault or not?

Is this problem concerned with the hardware of the computer which I
can solve by adding more memory?

Thanks in Advance

Tolga GUYER

[MUG] Re: Too many levels of recursion
Author: Maple User Group    Posted: Tue, 19 Nov 2002 16:52:50 -0500

>> From: Maple User Group "maple_gr"

| >> From: "guyer"
| Has anybody an idea about the error message "(In Signature) Too many
| levels of recursion" ? Is it my procedure's fault or not?
| Is this problem concerned with the hardware of the computer which I
| can solve by adding more memory?

-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 15 Nov 2002 12:49:14 -0500
To: "maple-list"
From: "Gerald A. Edgar" "edgar"
Subject: Too many levels of recursion


In my experience, it is a sign of INFINITE recursion, where something (perhaps indirectly) depends on itself. So whenever I have received this message,
it has been my fault. Try turning on "trace" for the function where this
happens, and see if you can tell what is going on.
--
G. A. Edgar http://www.math.ohio-state.edu/~edgar/


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 15 Nov 2002 13:55:24 -0500 (EST)
From: Carl Devore "devore"
To: MAPLE User Group "maple-list"
Subject: Too many levels of recursion

Most likely you have a statement of the form x:= x+1 somewhere where x has
not been initialized.

> Is this problem concerned with the hardware of the computer which I
> can solve by adding more memory?

No.


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Fri, 15 Nov 2002 13:44:42 -0800 (PST)
From: Robert Israel "israel"
To: MAPLE User Group "maple-list"
Subject: Too many levels of recursion


|> Has anybody an idea about the error message "(In Signature) Too many
|> levels of recursion" ? Is it my procedure's fault or not?

Yes, probably. It might help if we could see the actual
procedure, but usually this message indicates that somehow you
are setting up an infinite recursion. The other possibility is
that this is a procedure that legitimately uses a very large number
of levels of recursion.

Each time a procedure calls another, some information must be stored in an
area of memory called the stack. This is removed when the called
procedure returns. The stack has only a finite capacity, and when it is
full this error message occurs. The size of the stack may vary depending
on the platform and the version of Maple as well as the amount of
available memory in the computer.

For example, the following recursive procedure, if called with a positive
integer n, will at some point have n "levels of recursion" active at
the same time, as f(n) calls f(n-1) which calls f(n-2) and so on down to
f(1).

> f:= proc(n) if n = 1 then 2 else f(n-1)^2 + 1 mod (n+2) fi end;

When I tried it just now (in Maple 8 under Windows NT 4.0), f(3309)
worked but f(3310) gave me "too many levels of recursion".

It is often possible to rewrite a recursive procedure as an iterative
one, and there are various other tricks that can reduce the amount of
recursion needed.

> Is this problem concerned with the hardware of the computer which I
> can solve by adding more memory?

Probably not.


Robert Israel "israel"
Department of Mathematics http://www.math.ubc.ca/~israel
University of British Columbia
Vancouver, BC, Canada V6T 1Z2



-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

Date: Sat, 16 Nov 2002 10:18:46 +0100
From: Maerivoet Roland "roland.maerivoet"
To: "maple-list"
Subject: Too many levels of recursion

Hello,

I guess it has to do with your procedure.
Since you did not include it, it's rather difficult to give exact
comments.
You get this kind of error-message when using variables recusively.

--
Met vriendelijke groeten - Best Regards

Roland Maerivoet
Hogeschool Gent
Departement Bedrijfskunde Aalst
Keizersplein, 19
B9300 Aalst
Belgium

tel: +32053212321
fax: +32053710934

http://docent.hogent.be/~roma754
http://users.pandora.be/roland.maerivoet


-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-=*=-

From: "Dr Francis J. Wright" "F.J.Wright"
To: "guyer"
Subject: Too many levels of recursion
Date: Mon, 18 Nov 2002 11:21:42 -0000

> Has anybody an idea about the error message "(In Signature) Too many
> levels of recursion" ? Is it my procedure's fault or not?

Probably.

> Is this problem concerned with the hardware of the computer which I
> can solve by adding more memory?

Probably not.

This error usually arises from a recursive procedure that has an error in
the base case (i.e. the test that should stop the recursion). I suggest
that you try running your procedure in the debugger, or just increase
printlevel and let the procedure run for a bit. From the output, you may be
able to spot the problem. But beware that you will probably get a LOT of
output!

IIRC, there was a time when the Windows version of Maple had a rather small
stack allocated and some highly recursive library procedures could run out
of stack and so cause the above error, but I don't think that has been an
issue for some time now. It probably related to early releases of Maple V
for Windows 3.1.

If you did not intend to write a recursive procedure then maybe you have
done so unintentionally. A recursive procedure is one that calls itself,
which is fine (and a very powerful programming technique) provided you
remember to include an appropriate base case (or cases) to stop the
recursion.

Francis

Previous by date: [MUG] Re: Lebesgue-Integral, Maple User Group
Next by date: [MUG] Re: Limit Superior & Limit Inferior, Maple User Group
Previous thread: [MUG] Maple crashing with odeplot, John Robert Kitchin
Next thread: [MUG] Limit Superior & Limit Inferior,  Classen, Manfred



Ready to buy?

Maple - single user licence
Add to shopping basket
$ 1,895.00
Upgrade to Maple 12 from v11
Add to shopping basket
$ 995.00
Upgrade to Maple 12 from v10 & below
Add to shopping basket
$ 1,395.00

Featured Downloads

Maple White Paper: Technical Knowledge - An Asset You Can Afford to Lose?
Maple in Electronics Application Pack
Maple in Robotics & Aerospace Application Pack
Maple in Finance Application Pack

Product Reviews

"Without the Maple software, we would have to spend weeks generating the equations of motion for every experiment. Then the chances that we did it right would basically be near zero. There would always be a mistake somewhere. It is very difficult to set up a dynamic motion model by hand."
- Jean-Claude PiedBeouf, Ph.D Manager of Robotics, Canadian Space Agency

"Its very good - highly accurate and easy to use. The speed of Maple allows me to change equations and quickly reintegrate them into the application, so more possibilities can be explored to achieve the precise effect desired."
Shawn Neely, Senior R & D Director for PDI/Dreamworks
adept

Top of the Page

Our Privacy and Terms and Conditions Statement
All Trademarks Recognised. Copyright © 2007, Adept Scientific plc.
Site designed and maintained by Adeptise

Adept Scientific | Amor Way | Letchworth Garden City | Herts | SG6 1ZA | Tel: +44 (0)1462 480055