[GiNaC-list] memory allocation, matrices

Richard B. Kreckel kreckel at ginac.de
Sun Sep 10 11:51:53 CEST 2006


Hi,

Sorry, most of what you say about mixing Objective C and C++ sounds 
obscure to me, since I don't know any Objective C.

Marko Riedel wrote:

>Thank you for the concise explanation. I plan on mixing Objective C
>and C++ and this leads to another question. Suppose I store a GiNaC
>object in an instance variable of an Objective C object. This
>operation should increment the referene count of the GiNaC object,
>right?
>  
>

If this storing in an instance variable involves calling a constructor 
or assingment operator, which I do hope, then the answer is yes.

>Next suppose that the deallocation method of the Objective C
>object is invoked. Now I need an explicit release of the GiNaC
>object. How would I do this?
>  
>

Wouldn't deallocation invoke the destructor ex::~ex()?

>Do GiNaC objects have a method that
>retrieves the reference count?
>  
>

There are no private methods.

>Do you have concrete experience with systems of equations whose
>coefficients are univariate polynomials with integer coefficients?
>  
>

Experience, well, some, but not very systematic experience. I would say 
that Bareiss is the method of choice here, but I recall having seen 
problems where Gauss was way superior due to some non-obvious 
cancellations. (Markus Knodel had such cases, but I'm unable to google 
it on this list's archives.) Still, talking about algorithmic complexity 
would require us to first determine that of polynomial multiplication 
(still obvious) and then that of polynomial long division (not so 
obvious) and then ask about the size of coefficients and whatnot. 
Instead, I would just go ahead and try it.

Regards
-richy.

-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>



More information about the GiNaC-list mailing list