comp.lang.ada
 help / color / mirror / Atom feed
* Mathpaqs release 30-May-2015
@ 2015-06-02 12:27 gautier_niouzes
  2015-06-03 15:16 ` vincent
  2015-06-03 15:41 ` vincent.diemunsch
  0 siblings, 2 replies; 5+ messages in thread
From: gautier_niouzes @ 2015-06-02 12:27 UTC (permalink / raw)


Two additions in the latest release:

 - Formulas, a generic formula package with parsing, evaluation and simplification

 - Contours, a generic contour plot package

Enjoy!

URL: http://sf.net/projects/mathpaqs/
______________________________________________________________________________
Gautier's Ada programming -- http://gautiersblog.blogspot.com/search/label/Ada
NB: follow the above link for a working e-mail address


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Mathpaqs release 30-May-2015
  2015-06-02 12:27 Mathpaqs release 30-May-2015 gautier_niouzes
@ 2015-06-03 15:16 ` vincent
  2015-06-03 15:41 ` vincent.diemunsch
  1 sibling, 0 replies; 5+ messages in thread
From: vincent @ 2015-06-03 15:16 UTC (permalink / raw)


Le mardi 2 juin 2015 14:27:48 UTC+2, gautier...@hotmail.com a écrit :
Thanks Gauthier for this interesting work !

I am really interested by your multiprecision integers. I am happy to see that they are implemented in Ada. 

I used to write a binding to GMP and MPFR but I only considered "Unbounded Integers", implemented as controlled types, just like unbounded_strings are implemented. Do you know how fast is your Library compared to GMP ?

If we had an Ada compiler based on LLVM, we could use "portable" inline assembly code to accelerate computations... Would this be useful ? I suppose the most important thing is the algorithm, isn't it ?

What I would like to have is the euclidean division :
 
A div B = if B > 0 then Floor(A,B) else Ceiling (A,B) end if;
Where Floor(A,B) is the floor of the rational number A/B.

A mod B the corresponding remainder, which is "mod" when B > 0.

These are the div and mod operators from Oberon for instance. I think they really lack in Ada. Would it be difficult to have them starting from your implementation ?

Kind regards,

Vincent
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Mathpaqs release 30-May-2015
  2015-06-02 12:27 Mathpaqs release 30-May-2015 gautier_niouzes
  2015-06-03 15:16 ` vincent
@ 2015-06-03 15:41 ` vincent.diemunsch
  2015-06-03 18:09   ` Jeffrey R. Carter
  1 sibling, 1 reply; 5+ messages in thread
From: vincent.diemunsch @ 2015-06-03 15:41 UTC (permalink / raw)


Le mardi 2 juin 2015 14:27:48 UTC+2, gautier...@hotmail.com a écrit :

Thanks Gauthier for this interesting work ! 

I am really interested by your multiprecision integers. I am happy to see that they are implemented in Ada. 

I used to write a binding to GMP and MPFR but I only considered "Unbounded Integers", implemented as controlled types, just like unbounded_strings are implemented. Do you know how fast is your Library compared to GMP ? 

If we had an Ada compiler based on LLVM, we could use "portable" inline assembly code to accelerate computations... Would this be useful ? I suppose the most important thing is the algorithm, isn't it ? 

Kind regards, 

Vincent


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Mathpaqs release 30-May-2015
  2015-06-03 15:41 ` vincent.diemunsch
@ 2015-06-03 18:09   ` Jeffrey R. Carter
  2015-06-04  7:25     ` Vincent
  0 siblings, 1 reply; 5+ messages in thread
From: Jeffrey R. Carter @ 2015-06-03 18:09 UTC (permalink / raw)


On 06/03/2015 08:41 AM, vincent.diemunsch@gmail.com wrote:
> 
> I am really interested by your multiprecision integers. I am happy to see
> that they are implemented in Ada.

The trouble with his multiprecision integers is that, for each variable, you
have to specify the number of "digits" it can hold. You can sometimes get around
this by using the result of an expression as the initialization of an object.
But sometimes it is difficult, especially if you want to write portable code,
since the size of a "digit" is determined by a constant from System.

The alternative to this is to have unbounded integers, with the number of
"digits" determined by the value. This is generally implemented using access
types, allocation, and deallocation, which can be difficult to get right.

However, in the beta version of the PragmAda Reusable Components for ISO/IEC
8652:2007, there is an Unbounded_Integers pkg that does not (explicitly) use
access types. The division algorithm might be a bit slow.

> I used to write a binding to GMP and MPFR but I only considered "Unbounded
> Integers", implemented as controlled types, just like unbounded_strings are
> implemented. Do you know how fast is your Library compared to GMP ?

Advantages to a binding to something like GMP is that it is well tested and
fast. The disadvantage is that it is a binding to something written in not-Ada.
Also, a decent binding might use 3 subprogram calls where a native pkg would
only use 1 (your code calls the thick binding, which calls the thin binding,
which calls the imported code), and convert types, which might be enough to make
up for the speed difference.

The PragmARCs are at

https://pragmada.x10hosting.com/pragmarc.htm

-- 
Jeff Carter
"If a sperm is wasted, God gets quite irate."
Monty Python's the Meaning of Life
56


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Mathpaqs release 30-May-2015
  2015-06-03 18:09   ` Jeffrey R. Carter
@ 2015-06-04  7:25     ` Vincent
  0 siblings, 0 replies; 5+ messages in thread
From: Vincent @ 2015-06-04  7:25 UTC (permalink / raw)



> 
> The PragmARCs are at
> 
> https://pragmada.x10hosting.com/pragmarc.htm
> 
> -- 
> Jeff Carter
> "If a sperm is wasted, God gets quite irate."
> Monty Python's the Meaning of Life
> 56

Thank you Jeff. I'll have an eye on your implementation.
Regards,

Vincent

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-06-04  7:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-02 12:27 Mathpaqs release 30-May-2015 gautier_niouzes
2015-06-03 15:16 ` vincent
2015-06-03 15:41 ` vincent.diemunsch
2015-06-03 18:09   ` Jeffrey R. Carter
2015-06-04  7:25     ` Vincent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox