axiom-mail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-mail] Function returning UnivariateTaylorSeries


From: Marcus Better
Subject: [Axiom-mail] Function returning UnivariateTaylorSeries
Date: Thu, 25 Nov 2004 17:27:09 +0100
User-agent: Mozilla Thunderbird 0.8 (X11/20040926)

Hello,

I am trying to create a function (in a spad package) that will compute some coefficients and assemble them into a Taylor series, which it will return. I run into some strange errors. I simplified the code as much as possible, so that it looks like this:

--------------------------------------------
)abbrev package FOO Foo
Foo(K,z): Exports == Implementation where
  K : Ring
  z : Symbol

  Exports ==> with
    bar: () -> UnivariateTaylorSeries(K,z,0)

  Implementation ==> add
    bar ==
      st := generate(const(1)$MappingPackage2(K, K), 0)$Stream(K)
      series(st)$UnivariateTaylorSeries(K,z,0)
-------------------------------------------

This will work when called as

  bar()$Foo(INT, new()$Symbol)

but writing instead

  bar()$Foo(POLY INT, new()$Symbol)

gives me

   >> System error:
   Caught fatal error [memory may be damaged]

The same goes for FRAC INT instead of POLY INT. Moreover, doing

  bar$Foo(INT, new()$Symbol)

returns

  theMap(FOO;bar;Uts;1,312)

as it should, but

  bar$Foo(FRAC INT, new()$Symbol)

gives the "Caught fatal error" message again.

(In my real code I need other types than INT, of course.)

I don't have a clue how to solve this. In particular, I would like to pass the z argument directly to the function, but that did not succeed so far.

I use axiom-0.20040831-1 on Debian Sarge i386.

Marcus




reply via email to

[Prev in Thread] Current Thread [Next in Thread]