Csound Csound-dev Csound-tekno Search About

[Cs-dev] Questions about arrays

Date2013-04-11 13:23
Fromjohn ffitch
Subject[Cs-dev] Questions about arrays
Now we have arrays in cs6 I am looking at transferring the t-var
operations onto arrays.  This has raised a number of semantic
decisions that about which I though you all might have opinions.

Question 1:
  maxtab and mintab find max/min in a 1-D array.  \\\\\\\\\\\if
  presented with a higher dimensional array should it find max/min of
  all entries?

Question 2:
  sumtab adds all entries in a t-var.  Should it add all entries in a
  higher dimensional case?

Question 3:
  scalet scales a 1-D vector to fit a maximum value and a minimum.
  What should it do on a multi-dimensional array?

Question 4:
  There was arithmetic on vectors so t1 + t2 yielded an array of size
  minimum of sizes of t1 and t2, that is an element-by-element sum.
  Similar for - * / and %.  What should they do on multi-dimensional
  arrays, and what if dimensions do not match?

Question 5:
  In an assignment kArray1 = kArray2 what should happen if sizes
  and/or dimensions do not match?


That will do for a start -- similar questions arise in copy2ftab and
copy2ttab.

Options include errors, truncating, partial evaluation ..... Clearly
the error is the easiest to code but what are the use-cases?

==John ffitch

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-04-11 15:37
FromVictor Lazzarini
SubjectRe: [Cs-dev] Questions about arrays
My 1c to this disucssion
On 11 Apr 2013, at 13:23, john ffitch wrote:

> Question 1:
>  maxtab and mintab find max/min in a 1-D array.  \\\\\\\\\\\if
>  presented with a higher dimensional array should it find max/min of
>  all entries?
That sounds reasonable to me.


> Question 2:
>  sumtab adds all entries in a t-var.  Should it add all entries in a
>  higher dimensional case?
Same as above.

> Question 3:
>  scalet scales a 1-D vector to fit a maximum value and a minimum.
>  What should it do on a multi-dimensional array?
Sounds like it should be applied to all values?

> Question 4:
>  There was arithmetic on vectors so t1 + t2 yielded an array of size
>  minimum of sizes of t1 and t2, that is an element-by-element sum.
>  Similar for - * / and %.  What should they do on multi-dimensional
>  arrays, and what if dimensions do not match?
 We could implement matrix arithmetic, and if sizes are not compatible find
a failsafe option(?).

> Question 5:
>  In an assignment kArray1 = kArray2 what should happen if sizes
>  and/or dimensions do not match?
My suggestion is to copy what can be copied, discarding anything beyond the
size of the receiver

> That will do for a start -- similar questions arise in copy2ftab and
> copy2ttab.
> 
> Options include errors, truncating, partial evaluation ..... Clearly
> the error is the easiest to code but what are the use-cases?
> 
> ==John ffitch
> 
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-04-11 16:58
Fromandy fillebrown
SubjectRe: [Cs-dev] Questions about arrays
AttachmentsNone  None  
I would find it useful to have the option to make the array opcodes work on a single dimension of a multi-dimensional array.  For example if I have t_points[10][3] I would like to be able to use scalet to scale only the 1st dimension, i.e. t_points[0][0], t_points[1][0], t_points[2][0], etc... or the 2nd dimension t_points[0][1], t_points[1][1], t_points[2][1], etc... and the same for the 3rd dimension.  Maybe add an optional argument that can be used to specify the dimension to operate on and have it default to -1 meaning operate on all dimensions?

~ andy.f



On Thu, Apr 11, 2013 at 8:23 AM, john ffitch <jpff@codemist.co.uk> wrote:
Now we have arrays in cs6 I am looking at transferring the t-var
operations onto arrays.  This has raised a number of semantic
decisions that about which I though you all might have opinions.

Question 1:
  maxtab and mintab find max/min in a 1-D array.  \\\\\\\\\\\if
  presented with a higher dimensional array should it find max/min of
  all entries?

Question 2:
  sumtab adds all entries in a t-var.  Should it add all entries in a
  higher dimensional case?

Question 3:
  scalet scales a 1-D vector to fit a maximum value and a minimum.
  What should it do on a multi-dimensional array?

Question 4:
  There was arithmetic on vectors so t1 + t2 yielded an array of size
  minimum of sizes of t1 and t2, that is an element-by-element sum.
  Similar for - * / and %.  What should they do on multi-dimensional
  arrays, and what if dimensions do not match?

Question 5:
  In an assignment kArray1 = kArray2 what should happen if sizes
  and/or dimensions do not match?


That will do for a start -- similar questions arise in copy2ftab and
copy2ttab.

Options include errors, truncating, partial evaluation ..... Clearly
the error is the easiest to code but what are the use-cases?

==John ffitch

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-devel


Date2013-04-11 17:29
FromSteven Yi
SubjectRe: [Cs-dev] Questions about arrays
Perhaps we should look at Matlab and Octave as models:

http://www.mathworks.co.uk/help/matlab/math/multidimensional-arrays.html
http://www.gnu.org/software/octave/doc/interpreter/Simple-Examples.html#Simple-Examples

I don't have either installed here to test out what happens when the
dimensions don't line up, but perhaps someone could give it a go and
report the behavior.

On Thu, Apr 11, 2013 at 4:58 PM, andy fillebrown
 wrote:
> I would find it useful to have the option to make the array opcodes work on
> a single dimension of a multi-dimensional array.  For example if I have
> t_points[10][3] I would like to be able to use scalet to scale only the 1st
> dimension, i.e. t_points[0][0], t_points[1][0], t_points[2][0], etc... or
> the 2nd dimension t_points[0][1], t_points[1][1], t_points[2][1], etc... and
> the same for the 3rd dimension.  Maybe add an optional argument that can be
> used to specify the dimension to operate on and have it default to -1
> meaning operate on all dimensions?
>
> ~ andy.f
>
>
>
> On Thu, Apr 11, 2013 at 8:23 AM, john ffitch  wrote:
>>
>> Now we have arrays in cs6 I am looking at transferring the t-var
>> operations onto arrays.  This has raised a number of semantic
>> decisions that about which I though you all might have opinions.
>>
>> Question 1:
>>   maxtab and mintab find max/min in a 1-D array.  \\\\\\\\\\\if
>>   presented with a higher dimensional array should it find max/min of
>>   all entries?
>>
>> Question 2:
>>   sumtab adds all entries in a t-var.  Should it add all entries in a
>>   higher dimensional case?
>>
>> Question 3:
>>   scalet scales a 1-D vector to fit a maximum value and a minimum.
>>   What should it do on a multi-dimensional array?
>>
>> Question 4:
>>   There was arithmetic on vectors so t1 + t2 yielded an array of size
>>   minimum of sizes of t1 and t2, that is an element-by-element sum.
>>   Similar for - * / and %.  What should they do on multi-dimensional
>>   arrays, and what if dimensions do not match?
>>
>> Question 5:
>>   In an assignment kArray1 = kArray2 what should happen if sizes
>>   and/or dimensions do not match?
>>
>>
>> That will do for a start -- similar questions arise in copy2ftab and
>> copy2ttab.
>>
>> Options include errors, truncating, partial evaluation ..... Clearly
>> the error is the easiest to code but what are the use-cases?
>>
>> ==John ffitch
>>
>>
>> ------------------------------------------------------------------------------
>> Precog is a next-generation analytics platform capable of advanced
>> analytics on semi-structured data. The platform includes APIs for building
>> apps and a phenomenal toolset for data science. Developers can use
>> our toolset for easy data analysis & visualization. Get a free account!
>> http://www2.precog.com/precogplatform/slashdotnewsletter
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-04-12 20:21
Fromjoachim heintz
SubjectRe: [Cs-dev] Questions about arrays
thanks for discussing this at first.

as to question 5, i agree with victor (copy what can be copied, in other 
words, use the smallest size or dimension for the result). i'd suggest a 
warning message for this case.

	joachim


Am 11.04.2013 14:23, schrieb john ffitch:
> Now we have arrays in cs6 I am looking at transferring the t-var
> operations onto arrays.  This has raised a number of semantic
> decisions that about which I though you all might have opinions.
>
> Question 1:
>    maxtab and mintab find max/min in a 1-D array.  \\\\\\\\\\\if
>    presented with a higher dimensional array should it find max/min of
>    all entries?
>
> Question 2:
>    sumtab adds all entries in a t-var.  Should it add all entries in a
>    higher dimensional case?
>
> Question 3:
>    scalet scales a 1-D vector to fit a maximum value and a minimum.
>    What should it do on a multi-dimensional array?
>
> Question 4:
>    There was arithmetic on vectors so t1 + t2 yielded an array of size
>    minimum of sizes of t1 and t2, that is an element-by-element sum.
>    Similar for - * / and %.  What should they do on multi-dimensional
>    arrays, and what if dimensions do not match?
>
> Question 5:
>    In an assignment kArray1 = kArray2 what should happen if sizes
>    and/or dimensions do not match?
>
>
> That will do for a start -- similar questions arise in copy2ftab and
> copy2ttab.
>
> Options include errors, truncating, partial evaluation ..... Clearly
> the error is the easiest to code but what are the use-cases?
>
> ==John ffitch
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2013-04-12 20:21
Fromjoachim heintz
SubjectRe: [Cs-dev] Questions about arrays
i also vote for adding an optional argument for specifying the dimension 
which defaults to -1 (= all dimensions).
	joachim

Am 11.04.2013 17:58, schrieb andy fillebrown:
> I would find it useful to have the option to make the array opcodes work
> on a single dimension of a multi-dimensional array.  For example if I
> have t_points[10][3] I would like to be able to use scalet to scale only
> the 1st dimension, i.e. t_points[0][0], t_points[1][0], t_points[2][0],
> etc... or the 2nd dimension t_points[0][1], t_points[1][1],
> t_points[2][1], etc... and the same for the 3rd dimension.  Maybe add an
> optional argument that can be used to specify the dimension to operate
> on and have it default to -1 meaning operate on all dimensions?
>
> ~ andy.f
>
>
>
> On Thu, Apr 11, 2013 at 8:23 AM, john ffitch  > wrote:
>
>     Now we have arrays in cs6 I am looking at transferring the t-var
>     operations onto arrays.  This has raised a number of semantic
>     decisions that about which I though you all might have opinions.
>
>     Question 1:
>        maxtab and mintab find max/min in a 1-D array.  \\\\\\\\\\\if
>        presented with a higher dimensional array should it find max/min of
>        all entries?
>
>     Question 2:
>        sumtab adds all entries in a t-var.  Should it add all entries in a
>        higher dimensional case?
>
>     Question 3:
>        scalet scales a 1-D vector to fit a maximum value and a minimum.
>        What should it do on a multi-dimensional array?
>
>     Question 4:
>        There was arithmetic on vectors so t1 + t2 yielded an array of size
>        minimum of sizes of t1 and t2, that is an element-by-element sum.
>        Similar for - * / and %.  What should they do on multi-dimensional
>        arrays, and what if dimensions do not match?
>
>     Question 5:
>        In an assignment kArray1 = kArray2 what should happen if sizes
>        and/or dimensions do not match?
>
>
>     That will do for a start -- similar questions arise in copy2ftab and
>     copy2ttab.
>
>     Options include errors, truncating, partial evaluation ..... Clearly
>     the error is the easiest to code but what are the use-cases?
>
>     ==John ffitch
>
>     ------------------------------------------------------------------------------
>     Precog is a next-generation analytics platform capable of advanced
>     analytics on semi-structured data. The platform includes APIs for
>     building
>     apps and a phenomenal toolset for data science. Developers can use
>     our toolset for easy data analysis & visualization. Get a free account!
>     http://www2.precog.com/precogplatform/slashdotnewsletter
>     _______________________________________________
>     Csound-devel mailing list
>     Csound-devel@lists.sourceforge.net
>     
>     https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
>
>
> ------------------------------------------------------------------------------
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
>
>
>
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net