[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: GSL in octave
From: |
Julien Bect |
Subject: |
Re: GSL in octave |
Date: |
Thu, 21 Jul 2016 09:08:21 +0200 |
User-agent: |
SOGoMail 2.3.6 |
Le Jeudi 21 Juillet 2016 08:15 CEST, Susi Lehtola <address@hidden> a écrit:
> > 3) In the changeset "It's better to use row vectors instead" (really...
> > can't you try to write more explicit commit messages ?) you modify all
> > templates in such a way that all functions now return row vectors. This
> > is a little unexpected (and not documented). For instance,
> >
> > debye_1 (rand (3, 3))
> > ans =
> >
> > 0.91844 0.84803 0.93841 0.88165 0.99141 0.79339 0.85979
> > 0.84939 0.94766
> >
> > whereas I would have expected a 3 x 3 output.
>
> Well, obviously that will have to be documented, or changed. The reason
> why I made this change and the assumption that size doesn't matter is
> that otherwise you'll get into huge problems when you have more than one
> argument. If you give this function a row and a column vector as
> arguments, then you should get out a matrix. However, if the two
> arguments are matrices, then the output should be a rank-4 tensor, which
> becomes very quickly challenging.
>
> And the biggest functions in octave-gsl have four arguments, which means
> the result with four matrix arguments will be a rank-8 tensor, which
> wouldn't fit into memory.
>
> > 4) Just an idea: for functions with several arguments, it would be
> > really nice (but I don't how hard) to implement broadcasting:
> >
> > conicalP_0 ([1 4 3]', [2 3]) # should return a 3 x 2 matrix as a result
>
> See answer above.
I think we have a misunderstanding about what "broadcast" means.
Even if you have a function with four arguments, broadcasting (as I understand
it) doesn't mean that you will end up with a 4-dimensional (or 8-dimensional
???) array.
For instance, if you have (x, y, z) where x is a row of length m, y a column of
length n, and z an m x n matrix, then you would get an m x n matrix.
Broadcasting is documented in the manual for the case of binary operations:
https://www.gnu.org/software/octave/doc/v4.0.0/Broadcasting.html
but the same principle can be generalized to any number of arguments. See for
instance what the common_size () function does.
Broadcasting is supported for all basic operations in Octave (plus, minus,
times, rdivide, etc.)
- Re: GSL in octave, (continued)
- Re: GSL in octave, Julien Bect, 2016/07/19
- Re: GSL in octave, Julien Bect, 2016/07/19
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/19
- Re: GSL in octave, Julien Bect, 2016/07/20
- Re: GSL in octave, Susi Lehtola, 2016/07/21
- Re: GSL in octave, Julien Bect, 2016/07/23
- Re: GSL in octave, Susi Lehtola, 2016/07/20
- Re: GSL in octave, Julien Bect, 2016/07/20
- Re: GSL in octave, Julien Bect, 2016/07/20
- Re: GSL in octave, Susi Lehtola, 2016/07/21
- Re: GSL in octave,
Julien Bect <=
- Re: GSL in octave, Susi Lehtola, 2016/07/21
- Re: GSL in octave, Julien Bect, 2016/07/21
- Re: GSL in octave, Julien Bect, 2016/07/23
- Re: GSL in octave, Julien Bect, 2016/07/25
- Re: GSL in octave, Nir Krakauer, 2016/07/25
- Re: GSL in octave, Susi Lehtola, 2016/07/25
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/25
- Re: GSL in octave, Julien Bect, 2016/07/26
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/26
- Re: GSL in octave, Tatsuro MATSUOKA, 2016/07/26