Hi,
lets keep this on lela-users so others can weight in as well. I'll get back to
you with comments (if I have any :)) later today.
Cheers,
Martin
---------- Forwarded Message ----------
Subject: Re: GSoC: Fast Linear Algebra over Extension Fields
Date: Tuesday 23 Apr 2013
From: Fonyó Dávid <
fony...@gmail.com>
To:
martinr...@googlemail.com
Hello Martin,
I think I've written the patch what you asked for GSoC, but I don't know
what to do now. Here is my code. I represented the two matrix over Z[p]/(f)
as you wrote, and I made a function that compute the product of the
matrices. You didn't write that I should multiply the matrices, but this
seemed the most reasonable, so I hope that I didn't misunderstand you. I
tested it on several inputs. It has no type checking, should I write it? Is
there something that I should correct or rewrite?
Thank you,
David
#include <vector>
#include <lela/integer.h>
#include <lela/ring/modular.h>
#include <lela/matrix/dense.h>
using namespace LELA;
template<class Ring>
void MyFunction(const Ring& R,
std::vector<DenseMatrix<typename Ring::Element> >& C, //m x l
const std::vector<DenseMatrix<typename Ring::Element> >& A, //m x n
const std::vector<DenseMatrix<typename Ring::Element> >& B, //n x l
const std::vector<typename Ring::Element>& P) //I supposed that P has
leading coefficient 1
{
std::vector<typename Ring::Element> temp(A.size()+B.size(), R.zero());
//it'll contain the entry of C before the factorization with P
for(unsigned int row=0; row < C[0].rowdim(); ++row) {
for(unsigned int col=0; col < C[0].coldim(); ++col)
{
for(unsigned int t=0; t < temp.size(); ++t)
{
R.copy(temp[t],R.zero());
}
for(unsigned int k=0; k < A[0].coldim(); ++k)
{
for(unsigned int i=0; i < A.size(); ++i) {
for(unsigned int j=0; j < B.size(); ++j) {
R.axpyin(temp[i+j],A[i][row][k],B[j][k][col]);
}
}
}
//factorize with p
unsigned int i = temp.size()-1;
while(i >= P.size()-1)
{
unsigned int j=i+1-P.size();
//std::cout<<"j"<<j<<std::endl;
typename Ring::Element c;
R.neg(c,temp[i]);
for(unsigned int k=0; k<P.size(); ++k)
{
R.axpyin(temp[j+k],P[k],c);
}
--i;
}
for(unsigned int i=0; i < P.size()-1; ++i)
{
R.copy(C[i][row][col],temp[i]);
}
}
}
}
2013/4/15 Martin Albrecht <
martinr...@googlemail.com>
> Hey Dávid,
>
> (this should at least also be on lela-users)
>
> It would be very helpful if you could provide a little patch to LELA just
> to
> see whether you find your way round the library etc.
>
> For example, you could take two std::vector of mod p matrices and consider
> these vectors as matrices with polynomial entries. Then, you could perform
> schoolbook quadratic polynomial multiplication on these polynomials and
> take
> the result modulo some minimal polynomial represented as a std::vector<int>
> (or so).
>
> Something like that.
>
> Let me know if this is unclear and ask for help on lela-users if you get
> stuck.
>
> On Monday 15 Apr 2013, Dávid Fonyó wrote:
> > Hello,
> >
> > My name is Dávid Fonyó. I'm a third year Mathematics BSc and second year
> > Computer Science BSc student in Eötvös Loránd University, Budapest,
> > Hungary. I would like to join the Google Summer of Code 2013 program, and
> > I'm really interested in the "Fast Linear Algebra over Extension Fields"
> > project.
> >
> > As a prospective mathematician I've learned a lot of things that help me
> > understand the mathematical background of algorithms:
> > Algebra (4 semesters), Operation research (2 semester), Theory of
> > Computation, Numerical methods (2 semester), etc.
> > I have a good experience using C++, and I'm familiar with Java, Pascal,
> Ada
> > and Python.
> >
> > I've already checked the listed algorithms and now I'm reading the
> > references. I would like to ask what the next step will be? What kind of
> > patch should I have to write?
> > Thank you!
> >
> > Best regards,
> > Dávid Fonyó
>
> Cheers,
> Martin
>
> --
> name: Martin Albrecht
> _pgp:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
> _otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
> _www:
http://martinralbrecht.wordpress.com/
> _jab:
martinr...@jabber.ccc.de
>
> --
> --
> You received this message because you are subscribed to the Google
> Groups "lmnd-devel" group. Visit this group at
>
http://groups.google.com/group/lmnd-devel?hl=en
> lmonade:
http://www.lmona.de
>
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "lmnd-devel" group.
> To unsubscribe from this topic, visit
>
https://groups.google.com/d/topic/lmnd-devel/Mm06g0qfNUQ/unsubscribe?hl=en
> .
> To unsubscribe from this group and all its topics, send an email to
>
lmnd-devel+...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>
>
--
name: Martin Albrecht
_pgp:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www:
http://martinralbrecht.wordpress.com/
_jab:
martinr...@jabber.ccc.de