[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Matrix Concatenation
From: |
Srikant |
Subject: |
Re: [Help-gsl] Matrix Concatenation |
Date: |
Mon, 15 Aug 2005 12:58:51 -0700 (PDT) |
James,
Thanks. I had written my own code to do concatenation
which uses for loops but I think your solution is
elegant and perhaps faster.
Thanks,
Srikant
--- James Bergstra <address@hidden>
wrote:
> Can you accomplish your goal with something like
> this:
>
> ///////////
> // Concatenate B after A, store the result in C
> //
>
> gsl_matrix * A = gsl_matrix_alloc( a1, size2 )
> gsl_matrix * B = gsl_matrix_alloc( b1, size2 )
> gsl_matrix * C = gsl_matrix_alloc( a1 + b1, size2 );
>
> gsl_matrix_view aview = gsl_matrix_submatrix( C, 0,
> 0, a1, size2 );
> gsl_matrix_view bview = gsl_matrix_submatrix( C, a1,
> 0, b1, size2 );
>
> gsl_matrix_memcpy( &aview.matrix, A);
> gsl_matrix_memcpy( &bview.matrix, B);
>
> ///////////
>
> James
>
> On Sun, Aug 14, 2005 at 05:48:52PM -0700, Srikant
> wrote:
> > Hi All,
> >
> > I have searched the GSL docs, google and the help
> > archives but did not come across any function that
> > implements Matrix concatenation.
> >
> > Is there a undocumented function that performs
> > horizontal and vertical matrix concatenation?
> >
> > Thanks all for your help,
> > Srikant
> >
> >
> >
> > __________________________________
> > Yahoo! Mail for Mobile
> > Take Yahoo! Mail with you! Check email on your
> mobile phone.
> > http://mobile.yahoo.com/learn/mail
> >
> >
> > _______________________________________________
> > Help-gsl mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/help-gsl
>
> --
> james bergstra
> http://www-etud.iro.umontreal.ca/~bergstrj
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250