Google Groups Home
Help | Sign in
proposal for FieldAXPY change of interface
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Jean-Guillaume Dumas  
View profile
 More options May 22, 5:27 am
From: Jean-Guillaume Dumas <Jean-Guillaume.Du...@imag.fr>
Date: Thu, 22 May 2008 11:27:03 +0200
Local: Thurs, May 22 2008 5:27 am
Subject: proposal for FieldAXPY change of interface
Currently the FieldAXPY objects stores a field and an element.
This is a lot of storage for a single scalar element.

I would rather see the FieldAXPY object be more like a field object, i.e.
leave the element to be a parameter of the FieldAXPY methods e.g. :
            inline Element& accumulate (Element& _y, const Element &t)
instead of
            inline Element& accumulate (const Element &t) { _y = ... };

The goal is to be able to implement of LazyField object which could make
some delayed operations.

Apart form this change of interface for the specific FieldAXPY methods
which I regards as mandatory, I see two solutions :
1/ Give the field interface to the FieldAXPY object so that it can be
used directly as field.
For the specializations, it is very easy, it suffices for the FieldAXPY
specializations to inherit from their Field.

2/ Implement a LazyField class inheriting from both the Field and the
FieldAXPY

Other points of view on this ?

Best,

--
                                        Jean-Guillaume Dumas.
____________________________________________________________________
Jean-Guillaume.Du...@imag.fr                   Tél.: +33 476 514 866
Université Joseph Fourier, Grenoble I.         Fax.: +33 476 631 263
Laboratoire Jean Kuntzmann, Mathématiques Appliquées et Informatique
51, avenue des Mathématiques. LJK/IMAG - BP53. 38041 Grenoble FRANCE
http://ljk.imag.fr/membres/Jean-Guillaume.Dumas
____________________________________________________________________


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
B.David Saunders  
View profile
 More options May 25, 9:49 am
From: "B.David Saunders" <saund...@UDel.Edu>
Date: Sun, 25 May 2008 09:49:02 -0400
Local: Sun, May 25 2008 9:49 am
Subject: Re: [linbox-devel] proposal for FieldAXPY change of interface
Jean-Guillaume, I like your idea very much.

FieldAXPY has proved it's worth and is ready to be "mainstreamed".
I recommend the version where the unnormalized values live in a type declared in
the lazy field,
rather than using values wrapped in a FieldAXPY object.  One reason for this is
to mainstream the
laziness idea in FieldAXPY. Another reason is that one pays a penalty for
wrapping a basic type.
Compilers often cannot fully blow away these wrappers.
A third reason is that the knowledge of how to do the lazy operations lies
within the Field.
I find that Each FieldAXPY specialization is in the file containing the
corresponding field.
There is good reason for this.  It is a maintenance issue.
Any change to the field may affect the lazy stuff as well.
It might as well be right in the field.

In fact, I would go so far as to say that the FieldAXPY members should just be
added to the Field concept.  Template/inheritance mixing is too damn fragile!

[ Aside:  Where LinBox says "Field", it really means "BasicRing".  (Muchly...
In FieldAXPY for sure.)
  I'll have more on this thought in a separate email. ]

Virtually every BB needs the lazy functionality for it's apply(), either
directly or via a dot().
I admit that dense matrix elimination stuff may not need it,
but there is a simple default for fields not wanting to bother with real laziness.

However, there is more to think about.  I looked around.
There is virtually no use of FieldAXPY other than in vector dot products.
(J-G, do you have other uses in mind -- lurking behind this proposal?)
Dot products can be further improved.  I survey the FieldAXPY's then talk about
dot().

The specializations of FieldAXPY are of 4 types.

1. counting:  normalizes when sum reaches a threshold length.

2. detecting:  detects overflow with a comparison and corrects.

3. dummy: normalize every operation (the default).

4. invalid: no check on overflow (in never-used field classes like Modular<uint16>).

We ought to fix the invalid ones, but, more important, the invalid approach is
more efficient and
can be used with higher level counting in dot().  In other words, the loop
control in dot() can handle
counting at no extra cost, so counting or detecting at the FieldAXPY level is
wasteful for dot().

-dave

----------------- proposed signatures for the better fields -------------------

Lazy fields have these members in addition to the Field interface.
Alternatively expressed: Fields have these members in addition to the BasicField
interface.

class SomeField {
  public:
  // Basic Field interface, then this ...  //

  // Support for self controlled laziness:  //
   type LazyElement;
   //Because this type may be the same primitive type as Element, the function
names include "Lazy".

   LazyElement& initLazy(LazyElement&); // init to 0.  FieldAXPY::reset()

   LazyElement& axpyinLazy(LazyElement&, const Element&, const Element&); //
FieldAXPY::mulacc()

   LazyElement& addinLazy(LazyElement&, const Element&); // FieldAXPY::accumulate()

   Element& normalizeLazy(Element&, const LazyElement&); // FieldAXPY::get()

// Support for externally controled laziness [primarily in VectorDomain::dot()]:  //

   size_t veryLazySumProdBound; // In the prime field case this is max val of
type Element / (p-1)^2.

   LazyElement& axpyinVeryLazy(LazyElement&, const Element&, const Element&);
   // just axpyin with no normalization and no internal overflow check.

   size_t veryLazySumBound; // In the prime field case this is max val of type
Elememt / (p-1).

   LazyElement& addinVeryLazy(LazyElement&, const Element&);
   // just addin with no normalization and no internal overflow check.  For use
by zero-one BB's.

};

Default case:

LazyElement = Element
initLazy = init
axpyinLazy = axpyin
addinLazy = addin
normalizeLazy = copy
veryLazySumProdBound = max val of size_t
axpyinVeryLazy = axpyin
veryLazySumBound = max val of size_t
addinVeryLazy = addin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Clement Pernet  
View profile
 More options May 27, 1:49 pm
From: Clement Pernet <clement.per...@gmail.com>
Date: Tue, 27 May 2008 10:49:49 -0700
Local: Tues, May 27 2008 1:49 pm
Subject: Re: [linbox-devel] Re: proposal for FieldAXPY change of interface
Hi,

I agree with idea of giving the field interface to FieldAXPY.

Now, J-G, you say LasyField could inherit from both Field and FieldAXPY.
I don't see the need for it, since FieldAXPY already inherited from Field.

Is there a specific reason why LasyField should be different from
FiedlAXPY? Instead, we could, just have a single class, LazyField,
inheriting from field, and implementing the FieldAXPY stuff + the
lasyfield stuff.
If I am missing something, could refresh my memory about the specs of
both FieldAXPY and LasyField.

> The specializations of FieldAXPY are of 4 types.

> 1. counting:  normalizes when sum reaches a threshold length.

> 2. detecting:  detects overflow with a comparison and corrects.

> 3. dummy: normalize every operation (the default).

> 4. invalid: no check on overflow (in never-used field classes like Modular<uint16>).

I agree with this. However, the usage of #4 (invalid) should clearly
state that it is assuming higher level control and has to be used at
ones own risks.

> Lazy fields have these members in addition to the Field interface.
> Alternatively expressed: Fields have these members in addition to the BasicField
> interface.

This sounds like my proposal to merge LasyField and FieldAXPY, doesn't it?

Thinking of making the field system simpler, what about requiring that
any field has these Lasy functionalities. No more inheritance, and
simpler code.

Btw, we should consider a major cleanup of the field and ring
directories, and only keeping the fields that are
* working
* performing good in at least given area (characteristic, BB/Dense,...)

I am currently redesigning the fields Modular<double> Modular<float> in
FFLAS-FFPACK, in order to add the ModularBalanced implementation (as
default) and to add the compression for small finite fields (cf J-G
works on compressed modular representations).
Once it works smoothly in FFLAS-FFPACK, I will port it to LinBox.

Cheers,

Clément


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google