Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Kostas Oikonomou <k.oikonomou@at...>  20140803 14:46:34
Attachments:
Message as HTML

This is a discussion between Eberhard and myself on the new package "listvecops" that Eberhard just put together. Given the related discussion on the list, we are moving this discussion to the list also. Kostas  Original Message  Subject: Re: [Reducealgebradevelopers] vector operations on lists Date: Sun, 03 Aug 2014 11:41:15 +0200 From: Eberhard Schruefer <eschruefer@...> To: Kostas Oikonomou <k.oikonomou@...> On 03/08/14 04:34, Kostas Oikonomou wrote: > Eberhard, thanks very much. I have a few observations: > > 1) The elementwise product is indeed how maxima and Mathematica do it. > But also see 3) below. > > 2) The division doesn't work as expected, i.e. elementwise. How would you like to have it? Do you mean dividing two lists? > > 3) The "assist" package also provides a dot (scalar) product for two > lists, called "scalvect". That would be another useful addition to > "listvecops". Perhaps with a more convenient infix operator? Do you have a suggestion for a name of an infix operator of the dot product? > > 4) Another useful operation would be elementwise powers, the exponent > being a nonnegative real number. > But if you think that allowing any real exponent would not cause any > problems, that would be even better. O.k. thats very simple. > > 5) I now use the package "assist" to provide access to list elements by > index, using the dot notation L.i. > Would it make sense to merge that capability into the "listvecops" package? I'll take a look. > > 6) Fix some details in the error messages: > > "Only list can be added to a list." > "Only a list can be added to a > list." > > "Not equal length lists found in difference." > "Unequal length ..." > > "Not equal length lists found in times." > "Unequal length ..." Will change this in the next update. Eberhard > > > Kostas > > > On 08/02/2014 13:37, Eberhard Schruefer wrote: >> I commited a basic package for the operations you asked for. >> Please fetch the latest svn and then go 'load_package listvecops;" . >> Your examples then result in >> >> 1: load_package listvecops; >> >> 2: A := {a1,a2,a3,a4}; >> >> a := {a1,a2,a3,a4} >> >> 3: B := {b1,b2,b3,b4}; >> >> b := {b1,b2,b3,b4} >> >> 4: c*A ; >> >> {a1*c, >> >> a2*c, >> >> a3*c, >> >> a4*c} >> >> 5: A + B; >> >> {a1 + b1, >> >> a2 + b2, >> >> a3 + b3, >> >> a4 + b4} >> >> 6: A*B; >> >> {a1*b1, >> >> a2*b2, >> >> a3*b3, >> >> a4*b4} >> >> 7: c1*A + c2*B; >> >> {a1*c1 + b1*c2, >> >> a2*c1 + b2*c2, >> >> a3*c1 + b3*c2, >> >> a4*c1 + b4*c2} >> >> >> Is the product of two lists like you wanted it? It looks a little bit >> odd to me, but if this is the convention in >> other systems thats fine. >> >> Eberhard >> >> On 01/08/14 23:01, Kostas Oikonomou wrote: >>> Eberhard, >>> >>> That would be welcome, thanks. >>> >>> Another point of confusion for me is arrays vs. lists. As far as I can >>> see, in Reduce arrays provide access by index, which other systems (e.g. >>> maxima) also allow for lists. Arrays are also global in scope, which to >>> me seems debatable. Are there any other differences visible to the >>> user? Or reasons why one would want to use arrays? >>> >>> Kostas >>> >>> On 08/01/2014 14:48, Eberhard Schruefer wrote: >>>> I think I already told off the list that this is not hard to implement. >>>> I will put a small package together over the next few weeks. >>>> >>>> Eberhard >>>> >>>> On 01/08/14 19:10, Kostas Oikonomou wrote: >>>>> It would be very useful and convenient to users familiar with e.g. >>>>> maxima or Mathematica, and looking at Reduce as an alternative, if >>>>> Reduce had the ability to perform some vector operations on lists. >>>>> For >>>>> example, >>>>> >>>>> A := {a1,a2,a3,a4}; B := {b1,b2,b3,b4}; >>>>> >>>>> c*A > {c*a1,..,c*a4} >>>>> >>>>> A + B > {a1+b1,...,a4+b4} >>>>> >>>>> A*B > {a1*b1,...,a4*b4} >>>>> >>>>> and presumably such an extension would also handle linear >>>>> expressions like >>>>> >>>>> c1*A + c2*B, ... >>>>> >>>>> Unless, I'm missing something major, these manipulations, which are >>>>> quite convenient (in evaluating functions with vector arguments, in my >>>>> case), are very cumbersome to do in Reduce. >>>>> >>>>> I saw a related thread on this from 2011, but apparently nothing >>>>> further >>>>> was done. >>>>> >>>>> Kostas >>>>> >>>>> >>>>>  >>>>> >>>  >>> >>> Want fast and easy access to all the code in your enterprise? Index and >>> search up to 200,000 lines of code with a free copy of Black Duck >>> Code Sight  the same software that powers the world's largest code >>> search on Ohloh, the Black Duck Open Hub! Try it now. >>> http://p.sf.net/sfu/bds >>> _______________________________________________ >>> Reducealgebradevelopers mailing list >>> Reducealgebradevelopers@... >>> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Kostas Oikonomou <k.oikonomou@at...>  20140804 19:41:42

It seems that the problem is the "" sign. Remove that, and it works. Here is a demo: 5: L := {a,b,c}; L := {a,b,c} 6: L *. log(L); log(a)*a + log(b)*b + log(c)*c 7: (L *. log(L)); ***** Syntax error: log(a)( Memory access violation detected Arithmetic exception detected On 08/04/2014 14:29, Eberhard Schruefer wrote: > On 04/08/14 19:37, Kostas Oikonomou wrote: >> When I read in a file with this procedure in Reduce CSL, >> >> load_package listvecops; >> >> procedure H(x); >> begin; >> return (x *. log(x)) >> end; >> >> Reduce says: >> >> 3: H({1,2,3}); >> >> ***** Syntax error: log(3)( >> Memory access violation detected >> >> >> Arithmetic exception detected >> >> >> Arithmetic exception detected >> >> >> Arithmetic exception detected > Yes, since 'log' does not distribute over lists. Either you need to use > 'map' in your procedure > or I have to write some code that does this for 'log'. However the > latter would be necessary > for any function you want to apply on a list. > > Eberhard > >> Kostas >> >> >>  >> Infragistics Professional >> Build stunning WinForms apps today! >> Reboot your WinForms applications with our WinForms controls. >> Build a bridge from your legacy apps to the future. >> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk >> _______________________________________________ >> Reducealgebradevelopers mailing list >> Reducealgebradevelopers@... >> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > >  > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Eberhard Schruefer <eschruefer@ca...>  20140804 20:00:41

Oops, I see. I will fix it tomorrow. Eberhard On 04/08/14 21:40, Kostas Oikonomou wrote: > It seems that the problem is the "" sign. Remove that, and it works. > Here is a demo: > > 5: L := {a,b,c}; > > L := {a,b,c} > > 6: L *. log(L); > > log(a)*a + log(b)*b + log(c)*c > > 7: (L *. log(L)); > > ***** Syntax error: log(a)( Memory access violation detected Arithmetic > exception detected > > On 08/04/2014 14:29, Eberhard Schruefer wrote: >> On 04/08/14 19:37, Kostas Oikonomou wrote: >>> When I read in a file with this procedure in Reduce CSL, >>> >>> load_package listvecops; >>> >>> procedure H(x); >>> begin; >>> return (x *. log(x)) >>> end; >>> >>> Reduce says: >>> >>> 3: H({1,2,3}); >>> >>> ***** Syntax error: log(3)( >>> Memory access violation detected >>> >>> >>> Arithmetic exception detected >>> >>> >>> Arithmetic exception detected >>> >>> >>> Arithmetic exception detected >> Yes, since 'log' does not distribute over lists. Either you need to use >> 'map' in your procedure >> or I have to write some code that does this for 'log'. However the >> latter would be necessary >> for any function you want to apply on a list. >> >> Eberhard >> >>> Kostas >>> >>> >>>  >>> Infragistics Professional >>> Build stunning WinForms apps today! >>> Reboot your WinForms applications with our WinForms controls. >>> Build a bridge from your legacy apps to the future. >>> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Reducealgebradevelopers mailing list >>> Reducealgebradevelopers@... >>> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers >>  >> Infragistics Professional >> Build stunning WinForms apps today! >> Reboot your WinForms applications with our WinForms controls. >> Build a bridge from your legacy apps to the future. >> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk >> _______________________________________________ >> Reducealgebradevelopers mailing list >> Reducealgebradevelopers@... >> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > > > >  > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Arthur Norman <acn1@ca...>  20140804 20:03:27

On Mon, 4 Aug 2014, Kostas Oikonomou wrote: > It seems that the problem is the "" sign. Remove that, and it works. > Here is a demo: > > 5: L := {a,b,c}; > > L := {a,b,c} > > 6: L *. log(L); > > log(a)*a + log(b)*b + log(c)*c > > 7: (L *. log(L)); > > ***** Syntax error: log(a)( Memory access violation detected Arithmetic > exception detected > If I use bootstrapreduce rather than reduce and go "on backtrace" I see what looks like simp being passed an SQ not a prefix form and that leading to an (car 1). When CSL code is run all bytecoded (as in bootstrapreduce) *ALL* uses of car/cdr are checked and clean errors reported/ When compiled into C for speed and because the code is expected to be "production quality" and never do bad things it leaves out those checks. So handing a malformed argument to maprint or addf (etc etc etc) can cause a bad behaviour. Debugging is best done by dropping back to bootstrapreduce when the error should be reported more cleanly and can then (presumebly) be fixed! Arthur 
From: René Grognard <dositheus41@gm...>  20140805 22:42:21
Attachments:
Message as HTML

Greetings to all ! The new package *listvecops* is of interest to me for a possible move to *reduce* of the software I wrote in *maxima* for general CayleyDickson algebras (quaternions,octonions,etc...) as well as the modification of the CayleyDickson recursion to maintain associativity and thus generate a similar recursive construction of Clifford algebras. What is needed at the very base of such software is a linear algebra of nested pairs as in the small maxima example below: (%i2) X[1]:[[a1,a2],[a3,a4]]; (%o2) [[a1,a2],[a3,a4]] (%i3) X[2]:[[b1,b2],[b3,b4]]; (%o3) [[b1,b2],[b3,b4]] (%i4) sum(p[k]*X[k],k,1,2); (%o4) [[p[2]*b1+p[1]*a1,p[2]*b2+p[1]*a2],[p[2]*b3+p[1]*a3,p[2]*b4+p[1]*a4]] With maxima this can be carried to any level of nesting (provided that it makes sense). Clearly it is carried internally and needs a good interface with the users for legibility but this question is another matter altogether. If an equivalent algebra was available in reduce with lists, pairs or the basic PSL vector type used say by the packages *avector* and *orthovec, *the move from maxima to reduce would be more or less straightforward. A look at the code of *listvecops *makes obvious that it cannot deal with nested lists (assuming for a first prospective approach that its linear algebra make sense and leaving aside generating appropriate error messages if not). Even so problems are already encountered with "flat" lists: 3: off lower,nat; 4: A:={a1,a2,a4}; A := {a1,a2,a4} 5: B:={b1,b2,b3}; B := {b1,b2,b3} 6: C:={c1,c2,c3}; C := {c1,c2,c3} 7: a*A+b*B; {a*a1 + b*b1, a*a2 + b*b2, a*a4 + b*b3} 8: a*A+b*B+c*C; ***** Syntax error: a( Memory access violation detected 9: (a*A+b*B)+c*C; {a*a1 + b*b1 + c*c1, a*a2 + b*b2 + c*c2, a*a4 + b*b3 + c*c3} 10: a*A+(b*B+c*C); ***** a( Memory access violation detected 11: array X(3); 12: X(1):=a*A; X(1) := {a*a1,a*a2,a*a4} 13: X(2):=b*B; X(2) := {b*b1,b*b2,b*b3} 14: X(3):=c*C; X(3) := {c*c1,c*c2,c*c3} 15: for k:=1:3 sum X(k); ***** Only a list can be added to a list. It seems here that the type *array *is detected first. Now my questions are: [1] Could these problems be easily solved? [2] Leaving aside error messages in case of incompatibility, could the code be made recursive to deal with nested list? *listvecops *seems a good start anyway for a package which in my own opinion would be a valuable addition to reduce. Regards to all. Rene' Grognard On Tue, Aug 5, 2014 at 6:03 AM, Arthur Norman <acn1@...> wrote: > On Mon, 4 Aug 2014, Kostas Oikonomou wrote: > > It seems that the problem is the "" sign. Remove that, and it works. > > Here is a demo: > > > > 5: L := {a,b,c}; > > > > L := {a,b,c} > > > > 6: L *. log(L); > > > > log(a)*a + log(b)*b + log(c)*c > > > > 7: (L *. log(L)); > > > > ***** Syntax error: log(a)( Memory access violation detected Arithmetic > > exception detected > > > > If I use bootstrapreduce rather than reduce and go "on backtrace" I see > what looks like simp being passed an SQ not a prefix form and that leading > to an (car 1). When CSL code is run all bytecoded (as in bootstrapreduce) > *ALL* uses of car/cdr are checked and clean errors reported/ When compiled > into C for speed and because the code is expected to be "production > quality" and never do bad things it leaves out those checks. So handing a > malformed argument to maprint or addf (etc etc etc) can cause a bad > behaviour. Debugging is best done by dropping back to bootstrapreduce when > the error should be reported more cleanly and can then (presumebly) be > fixed! > > Arthur > > >  > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > 
From: Eberhard Schruefer <eschruefer@ca...>  20140806 09:31:24
Attachments:
Message as HTML

Thank you very much for your report and suggestions. The problems you encountered can be fairly easily fixed. Also nested lists are possible. If time permits I repair and extend the code within the next few days. Eberhard On 06/08/14 00:42, René Grognard wrote: > Greetings to all ! > > The new package /listvecops/ is of interest to me for a possible move > to /reduce/ of the software I wrote in /maxima/ for general > CayleyDickson algebras (quaternions,octonions,etc...) as well as the > modification of the CayleyDickson recursion to maintain associativity > and thus generate a similar recursive construction of Clifford algebras. > What is needed at the very base of such software is a linear algebra > of nested pairs as in the small maxima example below: > > (%i2) X[1]:[[a1,a2],[a3,a4]]; > > (%o2) [[a1,a2],[a3,a4]] > > (%i3) X[2]:[[b1,b2],[b3,b4]]; > > (%o3) [[b1,b2],[b3,b4]] > > (%i4) sum(p[k]*X[k],k,1,2); > > (%o4) > [[p[2]*b1+p[1]*a1,p[2]*b2+p[1]*a2],[p[2]*b3+p[1]*a3,p[2]*b4+p[1]*a4]] > > With maxima this can be carried to any level of nesting (provided that > it makes sense). Clearly it is carried internally and needs a good > interface with the users for legibility but this question is another > matter altogether. > > If an equivalent algebra was available in reduce with lists, pairs or > the basic PSL vector type used say by the packages /avector/ and > /orthovec, /the move from maxima to reduce would be more or less > straightforward. > > A look at the code of /listvecops /makes obvious that it cannot deal > with nested lists (assuming for a first prospective approach that its > linear algebra make sense and leaving aside generating appropriate > error messages if not). > > Even so problems are already encountered with "flat" lists: > > 3: off lower,nat; > > 4: A:={a1,a2,a4}; > A := {a1,a2,a4} > > 5: B:={b1,b2,b3}; > B := {b1,b2,b3} > > 6: C:={c1,c2,c3}; > C := {c1,c2,c3} > > 7: a*A+b*B; > {a*a1 + b*b1, > a*a2 + b*b2, > a*a4 + b*b3} > > 8: a*A+b*B+c*C; > ***** Syntax error: a( > Memory access violation detected > > 9: (a*A+b*B)+c*C; > {a*a1 + b*b1 + c*c1, > a*a2 + b*b2 + c*c2, > a*a4 + b*b3 + c*c3} > > 10: a*A+(b*B+c*C); > ***** a( > Memory access violation detected > > 11: array X(3); > > 12: X(1):=a*A; > X(1) := {a*a1,a*a2,a*a4} > > 13: X(2):=b*B; > X(2) := {b*b1,b*b2,b*b3} > > 14: X(3):=c*C; > X(3) := {c*c1,c*c2,c*c3} > > 15: for k:=1:3 sum X(k); > ***** Only a list can be added to a list. > > It seems here that the type /array /is detected first. > > Now my questions are: > > [1] Could these problems be easily solved? > > [2] Leaving aside error messages in case of incompatibility, could the > code be made recursive to deal with nested list? > > /listvecops /seems a good start anyway for a package which in my own > opinion would be a valuable addition to reduce. > > Regards to all. > > Rene' Grognard > > > On Tue, Aug 5, 2014 at 6:03 AM, Arthur Norman <acn1@... > <mailto:acn1@...>> wrote: > > On Mon, 4 Aug 2014, Kostas Oikonomou wrote: > > It seems that the problem is the "" sign. Remove that, and it > works. > > Here is a demo: > > > > 5: L := {a,b,c}; > > > > L := {a,b,c} > > > > 6: L *. log(L); > > > > log(a)*a + log(b)*b + log(c)*c > > > > 7: (L *. log(L)); > > > > ***** Syntax error: log(a)( Memory access violation detected > Arithmetic > > exception detected > > > > If I use bootstrapreduce rather than reduce and go "on backtrace" > I see > what looks like simp being passed an SQ not a prefix form and that > leading > to an (car 1). When CSL code is run all bytecoded (as in > bootstrapreduce) > *ALL* uses of car/cdr are checked and clean errors reported/ When > compiled > into C for speed and because the code is expected to be "production > quality" and never do bad things it leaves out those checks. So > handing a > malformed argument to maprint or addf (etc etc etc) can cause a bad > behaviour. Debugging is best done by dropping back to > bootstrapreduce when > the error should be reported more cleanly and can then (presumebly) be > fixed! > > Arthur > >  > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > <mailto:Reducealgebradevelopers@...> > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > > > > >  > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > > > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Eberhard Schruefer <eschruefer@ca...>  20140807 14:01:04
Attachments:
Message as HTML

Nested lists should work now and the issue with arrays having lists as elements is hopefully resolved. Eberhard On 06/08/14 11:31, Eberhard Schruefer wrote: > Thank you very much for your report and suggestions. The problems you > encountered can be fairly easily fixed. > Also nested lists are possible. If time permits I repair and extend > the code within the next few days. > > Eberhard > > On 06/08/14 00:42, René Grognard wrote: >> Greetings to all ! >> >> The new package /listvecops/ is of interest to me for a possible move >> to /reduce/ of the software I wrote in /maxima/ for general >> CayleyDickson algebras (quaternions,octonions,etc...) as well as the >> modification of the CayleyDickson recursion to maintain >> associativity and thus generate a similar recursive construction of >> Clifford algebras. >> What is needed at the very base of such software is a linear algebra >> of nested pairs as in the small maxima example below: >> >> (%i2) X[1]:[[a1,a2],[a3,a4]]; >> >> (%o2) [[a1,a2],[a3,a4]] >> >> (%i3) X[2]:[[b1,b2],[b3,b4]]; >> >> (%o3) [[b1,b2],[b3,b4]] >> >> (%i4) sum(p[k]*X[k],k,1,2); >> >> (%o4) >> [[p[2]*b1+p[1]*a1,p[2]*b2+p[1]*a2],[p[2]*b3+p[1]*a3,p[2]*b4+p[1]*a4]] >> >> With maxima this can be carried to any level of nesting (provided >> that it makes sense). Clearly it is carried internally and needs a >> good interface with the users for legibility but this question is >> another matter altogether. >> >> If an equivalent algebra was available in reduce with lists, pairs or >> the basic PSL vector type used say by the packages /avector/ and >> /orthovec, /the move from maxima to reduce would be more or less >> straightforward. >> >> A look at the code of /listvecops /makes obvious that it cannot deal >> with nested lists (assuming for a first prospective approach that its >> linear algebra make sense and leaving aside generating appropriate >> error messages if not). >> >> Even so problems are already encountered with "flat" lists: >> >> 3: off lower,nat; >> >> 4: A:={a1,a2,a4}; >> A := {a1,a2,a4} >> >> 5: B:={b1,b2,b3}; >> B := {b1,b2,b3} >> >> 6: C:={c1,c2,c3}; >> C := {c1,c2,c3} >> >> 7: a*A+b*B; >> {a*a1 + b*b1, >> a*a2 + b*b2, >> a*a4 + b*b3} >> >> 8: a*A+b*B+c*C; >> ***** Syntax error: a( >> Memory access violation detected >> >> 9: (a*A+b*B)+c*C; >> {a*a1 + b*b1 + c*c1, >> a*a2 + b*b2 + c*c2, >> a*a4 + b*b3 + c*c3} >> >> 10: a*A+(b*B+c*C); >> ***** a( >> Memory access violation detected >> >> 11: array X(3); >> >> 12: X(1):=a*A; >> X(1) := {a*a1,a*a2,a*a4} >> >> 13: X(2):=b*B; >> X(2) := {b*b1,b*b2,b*b3} >> >> 14: X(3):=c*C; >> X(3) := {c*c1,c*c2,c*c3} >> >> 15: for k:=1:3 sum X(k); >> ***** Only a list can be added to a list. >> >> It seems here that the type /array /is detected first. >> >> Now my questions are: >> >> [1] Could these problems be easily solved? >> >> [2] Leaving aside error messages in case of incompatibility, could >> the code be made recursive to deal with nested list? >> >> /listvecops /seems a good start anyway for a package which in my own >> opinion would be a valuable addition to reduce. >> >> Regards to all. >> >> Rene' Grognard >> >> >> On Tue, Aug 5, 2014 at 6:03 AM, Arthur Norman <acn1@... >> <mailto:acn1@...>> wrote: >> >> On Mon, 4 Aug 2014, Kostas Oikonomou wrote: >> > It seems that the problem is the "" sign. Remove that, and it >> works. >> > Here is a demo: >> > >> > 5: L := {a,b,c}; >> > >> > L := {a,b,c} >> > >> > 6: L *. log(L); >> > >> > log(a)*a + log(b)*b + log(c)*c >> > >> > 7: (L *. log(L)); >> > >> > ***** Syntax error: log(a)( Memory access violation detected >> Arithmetic >> > exception detected >> > >> >> If I use bootstrapreduce rather than reduce and go "on backtrace" >> I see >> what looks like simp being passed an SQ not a prefix form and >> that leading >> to an (car 1). When CSL code is run all bytecoded (as in >> bootstrapreduce) >> *ALL* uses of car/cdr are checked and clean errors reported/ When >> compiled >> into C for speed and because the code is expected to be "production >> quality" and never do bad things it leaves out those checks. So >> handing a >> malformed argument to maprint or addf (etc etc etc) can cause a bad >> behaviour. Debugging is best done by dropping back to >> bootstrapreduce when >> the error should be reported more cleanly and can then >> (presumebly) be >> fixed! >> >> Arthur >> >>  >> Infragistics Professional >> Build stunning WinForms apps today! >> Reboot your WinForms applications with our WinForms controls. >> Build a bridge from your legacy apps to the future. >> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk >> _______________________________________________ >> Reducealgebradevelopers mailing list >> Reducealgebradevelopers@... >> <mailto:Reducealgebradevelopers@...> >> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers >> >> >> >> >>  >> Infragistics Professional >> Build stunning WinForms apps today! >> Reboot your WinForms applications with our WinForms controls. >> Build a bridge from your legacy apps to the future. >> http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk >> >> >> _______________________________________________ >> Reducealgebradevelopers mailing list >> Reducealgebradevelopers@... >> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > > > >  > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > > > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Eberhard Schruefer <eschruefer@ca...>  20140803 15:15:02
Attachments:
Message as HTML

Taking up Kostas's comments I committed a new version. It extends divison to two lists, allows element wise exponentiation of lists and a dot product. 3: {a,b,c}/{3,g,5}; a b c {,,} 3 g 5 4: ws^3; 3 3 3 a b c {,,} 27 3 125 g 5: {a,b,c,d} listdot {5,7,9,11/d}; 5*a + 7*b + 9*c + 11 Concerning the access of elements in a list by the syntax as is used in the assist package (e.g. l.3) I am a little bit hesitating. It would be easy to do but would require a change at the algebraic level to the core function . (cons). It should not be of any harm to the rest of REDUCE as the right argument of cons is require to be a list at the algebraic level it might confuse LISP people. Eberhard On 03/08/14 16:48, Kostas Oikonomou wrote: > This is a discussion between Eberhard and myself on the new package > "listvecops" that Eberhard just put together. > Given the related discussion on the list, we are moving this > discussion to the list also. > > Kostas > > >  Original Message  > Subject: Re: [Reducealgebradevelopers] vector operations on lists > Date: Sun, 03 Aug 2014 11:41:15 +0200 > From: Eberhard Schruefer <eschruefer@...> > To: Kostas Oikonomou <k.oikonomou@...> > > > > On 03/08/14 04:34, Kostas Oikonomou wrote: > > Eberhard, thanks very much. I have a few observations: > > > > 1) The elementwise product is indeed how maxima and Mathematica do it. > > But also see 3) below. > > > > 2) The division doesn't work as expected, i.e. elementwise. > > How would you like to have it? Do you mean dividing two lists? > > > > > 3) The "assist" package also provides a dot (scalar) product for two > > lists, called "scalvect". That would be another useful addition to > > "listvecops". Perhaps with a more convenient infix operator? > > Do you have a suggestion for a name of an infix operator of > the dot product? > > > > > 4) Another useful operation would be elementwise powers, the exponent > > being a nonnegative real number. > > But if you think that allowing any real exponent would not cause any > > problems, that would be even better. > > O.k. thats very simple. > > > > > 5) I now use the package "assist" to provide access to list elements by > > index, using the dot notation L.i. > > Would it make sense to merge that capability into the "listvecops" package? > > I'll take a look. > > > > > 6) Fix some details in the error messages: > > > > "Only list can be added to a list." > "Only a list can be added to a > > list." > > > > "Not equal length lists found in difference." > "Unequal length ..." > > > > "Not equal length lists found in times." > "Unequal length ..." > > Will change this in the next update. > > Eberhard > > > > > > Kostas > > > > > > On 08/02/2014 13:37, Eberhard Schruefer wrote: > >> I commited a basic package for the operations you asked for. > >> Please fetch the latest svn and then go 'load_package listvecops;" . > >> Your examples then result in > >> > >> 1: load_package listvecops; > >> > >> 2: A := {a1,a2,a3,a4}; > >> > >> a := {a1,a2,a3,a4} > >> > >> 3: B := {b1,b2,b3,b4}; > >> > >> b := {b1,b2,b3,b4} > >> > >> 4: c*A ; > >> > >> {a1*c, > >> > >> a2*c, > >> > >> a3*c, > >> > >> a4*c} > >> > >> 5: A + B; > >> > >> {a1 + b1, > >> > >> a2 + b2, > >> > >> a3 + b3, > >> > >> a4 + b4} > >> > >> 6: A*B; > >> > >> {a1*b1, > >> > >> a2*b2, > >> > >> a3*b3, > >> > >> a4*b4} > >> > >> 7: c1*A + c2*B; > >> > >> {a1*c1 + b1*c2, > >> > >> a2*c1 + b2*c2, > >> > >> a3*c1 + b3*c2, > >> > >> a4*c1 + b4*c2} > >> > >> > >> Is the product of two lists like you wanted it? It looks a little bit > >> odd to me, but if this is the convention in > >> other systems thats fine. > >> > >> Eberhard > >> > >> On 01/08/14 23:01, Kostas Oikonomou wrote: > >>> Eberhard, > >>> > >>> That would be welcome, thanks. > >>> > >>> Another point of confusion for me is arrays vs. lists. As far as I can > >>> see, in Reduce arrays provide access by index, which other systems (e.g. > >>> maxima) also allow for lists. Arrays are also global in scope, which to > >>> me seems debatable. Are there any other differences visible to the > >>> user? Or reasons why one would want to use arrays? > >>> > >>> Kostas > >>> > >>> On 08/01/2014 14:48, Eberhard Schruefer wrote: > >>>> I think I already told off the list that this is not hard to implement. > >>>> I will put a small package together over the next few weeks. > >>>> > >>>> Eberhard > >>>> > >>>> On 01/08/14 19:10, Kostas Oikonomou wrote: > >>>>> It would be very useful and convenient to users familiar with e.g. > >>>>> maxima or Mathematica, and looking at Reduce as an alternative, if > >>>>> Reduce had the ability to perform some vector operations on lists. > >>>>> For > >>>>> example, > >>>>> > >>>>> A := {a1,a2,a3,a4}; B := {b1,b2,b3,b4}; > >>>>> > >>>>> c*A > {c*a1,..,c*a4} > >>>>> > >>>>> A + B > {a1+b1,...,a4+b4} > >>>>> > >>>>> A*B > {a1*b1,...,a4*b4} > >>>>> > >>>>> and presumably such an extension would also handle linear > >>>>> expressions like > >>>>> > >>>>> c1*A + c2*B, ... > >>>>> > >>>>> Unless, I'm missing something major, these manipulations, which are > >>>>> quite convenient (in evaluating functions with vector arguments, in my > >>>>> case), are very cumbersome to do in Reduce. > >>>>> > >>>>> I saw a related thread on this from 2011, but apparently nothing > >>>>> further > >>>>> was done. > >>>>> > >>>>> Kostas > >>>>> > >>>>> > >>>>>  > >>>>> > >>>  > >>> > >>> Want fast and easy access to all the code in your enterprise? Index and > >>> search up to 200,000 lines of code with a free copy of Black Duck > >>> Code Sight  the same software that powers the world's largest code > >>> search on Ohloh, the Black Duck Open Hub! Try it now. > >>>http://p.sf.net/sfu/bds > >>> _______________________________________________ > >>> Reducealgebradevelopers mailing list > >>>Reducealgebradevelopers@... > >>>https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > > > > > >  > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight  the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > > > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Kostas Oikonomou <k.oikonomou@at...>  20140803 21:00:50
Attachments:
Message as HTML

With respect to "listdot", only because I like brevity :), I am offering some alternatives for consideration: "ldot", "dot", and "*." And with respect to a scalar raised to a list power or a list raised to a list power, although I've never had occasion to use these constructs, I've seen this notation in some papers. So I vote for inclusion. Finally, with respect to accessing elements by index. My main concern is to not have to load two packages in order to have this capability. Would it be possible to introduce a new notation? E.g. L(i) or L[i]? Such a notation would be more uniform w.r.t. the usage in matrices, for one thing. Kostas On 08/03/2014 11:14, Eberhard Schruefer wrote: > Taking up Kostas's comments I committed a new version. It extends divison > to two lists, allows element wise exponentiation of lists and a dot > product. > > 3: {a,b,c}/{3,g,5}; > > a b c > {,,} > 3 g 5 > > 4: ws^3; > > 3 3 3 > a b c > {,,} > 27 3 125 > g > > 5: {a,b,c,d} listdot {5,7,9,11/d}; > > 5*a + 7*b + 9*c + 11 > > Concerning the access of elements in a list by the syntax as is used > in the assist package (e.g. l.3) I am a little bit > hesitating. It would be easy to do but would require a change at the > algebraic level to the core function . (cons). It should > not be of any harm to the rest of REDUCE as the right argument of > cons is require to be a list at the algebraic level > it might confuse LISP people. > > Eberhard > > On 03/08/14 16:48, Kostas Oikonomou wrote: >> This is a discussion between Eberhard and myself on the new package >> "listvecops" that Eberhard just put together. >> Given the related discussion on the list, we are moving this >> discussion to the list also. >> >> Kostas >> >> >>  Original Message  >> Subject: Re: [Reducealgebradevelopers] vector operations on lists >> Date: Sun, 03 Aug 2014 11:41:15 +0200 >> From: Eberhard Schruefer <eschruefer@...> >> To: Kostas Oikonomou <k.oikonomou@...> >> >> >> >> On 03/08/14 04:34, Kostas Oikonomou wrote: >> > Eberhard, thanks very much. I have a few observations: >> > >> > 1) The elementwise product is indeed how maxima and Mathematica do it. >> > But also see 3) below. >> > >> > 2) The division doesn't work as expected, i.e. elementwise. >> >> How would you like to have it? Do you mean dividing two lists? >> >> > >> > 3) The "assist" package also provides a dot (scalar) product for two >> > lists, called "scalvect". That would be another useful addition to >> > "listvecops". Perhaps with a more convenient infix operator? >> >> Do you have a suggestion for a name of an infix operator of >> the dot product? >> >> > >> > 4) Another useful operation would be elementwise powers, the exponent >> > being a nonnegative real number. >> > But if you think that allowing any real exponent would not cause any >> > problems, that would be even better. >> >> O.k. thats very simple. >> >> > >> > 5) I now use the package "assist" to provide access to list elements by >> > index, using the dot notation L.i. >> > Would it make sense to merge that capability into the "listvecops" package? >> >> I'll take a look. >> >> > >> > 6) Fix some details in the error messages: >> > >> > "Only list can be added to a list." > "Only a list can be added to a >> > list." >> > >> > "Not equal length lists found in difference." > "Unequal length ..." >> > >> > "Not equal length lists found in times." > "Unequal length ..." >> >> Will change this in the next update. >> >> Eberhard >> > >> > >> > Kostas >> > >> > >> > On 08/02/2014 13:37, Eberhard Schruefer wrote: >> >> I commited a basic package for the operations you asked for. >> >> Please fetch the latest svn and then go 'load_package listvecops;" . >> >> Your examples then result in >> >> >> >> 1: load_package listvecops; >> >> >> >> 2: A := {a1,a2,a3,a4}; >> >> >> >> a := {a1,a2,a3,a4} >> >> >> >> 3: B := {b1,b2,b3,b4}; >> >> >> >> b := {b1,b2,b3,b4} >> >> >> >> 4: c*A ; >> >> >> >> {a1*c, >> >> >> >> a2*c, >> >> >> >> a3*c, >> >> >> >> a4*c} >> >> >> >> 5: A + B; >> >> >> >> {a1 + b1, >> >> >> >> a2 + b2, >> >> >> >> a3 + b3, >> >> >> >> a4 + b4} >> >> >> >> 6: A*B; >> >> >> >> {a1*b1, >> >> >> >> a2*b2, >> >> >> >> a3*b3, >> >> >> >> a4*b4} >> >> >> >> 7: c1*A + c2*B; >> >> >> >> {a1*c1 + b1*c2, >> >> >> >> a2*c1 + b2*c2, >> >> >> >> a3*c1 + b3*c2, >> >> >> >> a4*c1 + b4*c2} >> >> >> >> >> >> Is the product of two lists like you wanted it? It looks a little bit >> >> odd to me, but if this is the convention in >> >> other systems thats fine. >> >> >> >> Eberhard >> >> >> >> On 01/08/14 23:01, Kostas Oikonomou wrote: >> >>> Eberhard, >> >>> >> >>> That would be welcome, thanks. >> >>> >> >>> Another point of confusion for me is arrays vs. lists. As far as I can >> >>> see, in Reduce arrays provide access by index, which other systems (e.g. >> >>> maxima) also allow for lists. Arrays are also global in scope, which to >> >>> me seems debatable. Are there any other differences visible to the >> >>> user? Or reasons why one would want to use arrays? >> >>> >> >>> Kostas >> >>> >> >>> On 08/01/2014 14:48, Eberhard Schruefer wrote: >> >>>> I think I already told off the list that this is not hard to implement. >> >>>> I will put a small package together over the next few weeks. >> >>>> >> >>>> Eberhard >> >>>> >> >>>> On 01/08/14 19:10, Kostas Oikonomou wrote: >> >>>>> It would be very useful and convenient to users familiar with e.g. >> >>>>> maxima or Mathematica, and looking at Reduce as an alternative, if >> >>>>> Reduce had the ability to perform some vector operations on lists. >> >>>>> For >> >>>>> example, >> >>>>> >> >>>>> A := {a1,a2,a3,a4}; B := {b1,b2,b3,b4}; >> >>>>> >> >>>>> c*A > {c*a1,..,c*a4} >> >>>>> >> >>>>> A + B > {a1+b1,...,a4+b4} >> >>>>> >> >>>>> A*B > {a1*b1,...,a4*b4} >> >>>>> >> >>>>> and presumably such an extension would also handle linear >> >>>>> expressions like >> >>>>> >> >>>>> c1*A + c2*B, ... >> >>>>> >> >>>>> Unless, I'm missing something major, these manipulations, which are >> >>>>> quite convenient (in evaluating functions with vector arguments, in my >> >>>>> case), are very cumbersome to do in Reduce. >> >>>>> >> >>>>> I saw a related thread on this from 2011, but apparently nothing >> >>>>> further >> >>>>> was done. >> >>>>> >> >>>>> Kostas >> >>>>> >> >>>>> >> >>>>>  >> >>>>> >> >>>  >> >>> >> >>> Want fast and easy access to all the code in your enterprise? Index and >> >>> search up to 200,000 lines of code with a free copy of Black Duck >> >>> Code Sight  the same software that powers the world's largest code >> >>> search on Ohloh, the Black Duck Open Hub! Try it now. >> >>> http://p.sf.net/sfu/bds >> >>> _______________________________________________ >> >>> Reducealgebradevelopers mailing list >> >>> Reducealgebradevelopers@... >> >>> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers >> >> >> >> >> >>  >> Want fast and easy access to all the code in your enterprise? Index and >> search up to 200,000 lines of code with a free copy of Black Duck >> Code Sight  the same software that powers the world's largest code >> search on Ohloh, the Black Duck Open Hub! Try it now. >> http://p.sf.net/sfu/bds >> >> >> _______________________________________________ >> Reducealgebradevelopers mailing list >> Reducealgebradevelopers@... >> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > > > >  > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight  the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > > > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Eberhard Schruefer <eschruefer@ca...>  20140803 22:08:46
Attachments:
Message as HTML

On 03/08/14 23:02, Kostas Oikonomou wrote: > With respect to "listdot", only because I like brevity :), I am > offering some alternatives for consideration: > "ldot", "dot", and "*." I have changed the name for the dot product to 'ldot' or likewise '*.' . > > And with respect to a scalar raised to a list power or a list raised > to a list power, although I've never had occasion to use these > constructs, I've seen this notation in some papers. So I vote for > inclusion. This is incorporated now. > > Finally, with respect to accessing elements by index. My main concern > is to not have to load two packages in order to have this > capability. Would it be possible to introduce a new notation? E.g. > L(i) or L[i]? Such a notation would be more uniform w.r.t. the usage > in matrices, for one thing. > > Kostas > > On 08/03/2014 11:14, Eberhard Schruefer wrote: >> Taking up Kostas's comments I committed a new version. It extends divison >> to two lists, allows element wise exponentiation of lists and a dot >> product. >> >> 3: {a,b,c}/{3,g,5}; >> >> a b c >> {,,} >> 3 g 5 >> >> 4: ws^3; >> >> 3 3 3 >> a b c >> {,,} >> 27 3 125 >> g >> >> 5: {a,b,c,d} listdot {5,7,9,11/d}; >> >> 5*a + 7*b + 9*c + 11 >> >> Concerning the access of elements in a list by the syntax as is used >> in the assist package (e.g. l.3) I am a little bit >> hesitating. It would be easy to do but would require a change at the >> algebraic level to the core function . (cons). It should >> not be of any harm to the rest of REDUCE as the right argument of >> cons is require to be a list at the algebraic level >> it might confuse LISP people. >> >> Eberhard >> >> On 03/08/14 16:48, Kostas Oikonomou wrote: >>> This is a discussion between Eberhard and myself on the new package >>> "listvecops" that Eberhard just put together. >>> Given the related discussion on the list, we are moving this >>> discussion to the list also. >>> >>> Kostas >>> >>> >>>  Original Message  >>> Subject: Re: [Reducealgebradevelopers] vector operations on lists >>> Date: Sun, 03 Aug 2014 11:41:15 +0200 >>> From: Eberhard Schruefer <eschruefer@...> >>> To: Kostas Oikonomou <k.oikonomou@...> >>> >>> >>> >>> On 03/08/14 04:34, Kostas Oikonomou wrote: >>> > Eberhard, thanks very much. I have a few observations: >>> > >>> > 1) The elementwise product is indeed how maxima and Mathematica do it. >>> > But also see 3) below. >>> > >>> > 2) The division doesn't work as expected, i.e. elementwise. >>> >>> How would you like to have it? Do you mean dividing two lists? >>> >>> > >>> > 3) The "assist" package also provides a dot (scalar) product for two >>> > lists, called "scalvect". That would be another useful addition to >>> > "listvecops". Perhaps with a more convenient infix operator? >>> >>> Do you have a suggestion for a name of an infix operator of >>> the dot product? >>> >>> > >>> > 4) Another useful operation would be elementwise powers, the exponent >>> > being a nonnegative real number. >>> > But if you think that allowing any real exponent would not cause any >>> > problems, that would be even better. >>> >>> O.k. thats very simple. >>> >>> > >>> > 5) I now use the package "assist" to provide access to list elements by >>> > index, using the dot notation L.i. >>> > Would it make sense to merge that capability into the "listvecops" package? >>> >>> I'll take a look. >>> >>> > >>> > 6) Fix some details in the error messages: >>> > >>> > "Only list can be added to a list." > "Only a list can be added to a >>> > list." >>> > >>> > "Not equal length lists found in difference." > "Unequal length ..." >>> > >>> > "Not equal length lists found in times." > "Unequal length ..." >>> >>> Will change this in the next update. >>> >>> Eberhard >>> > >>> > >>> > Kostas >>> > >>> > >>> > On 08/02/2014 13:37, Eberhard Schruefer wrote: >>> >> I commited a basic package for the operations you asked for. >>> >> Please fetch the latest svn and then go 'load_package listvecops;" . >>> >> Your examples then result in >>> >> >>> >> 1: load_package listvecops; >>> >> >>> >> 2: A := {a1,a2,a3,a4}; >>> >> >>> >> a := {a1,a2,a3,a4} >>> >> >>> >> 3: B := {b1,b2,b3,b4}; >>> >> >>> >> b := {b1,b2,b3,b4} >>> >> >>> >> 4: c*A ; >>> >> >>> >> {a1*c, >>> >> >>> >> a2*c, >>> >> >>> >> a3*c, >>> >> >>> >> a4*c} >>> >> >>> >> 5: A + B; >>> >> >>> >> {a1 + b1, >>> >> >>> >> a2 + b2, >>> >> >>> >> a3 + b3, >>> >> >>> >> a4 + b4} >>> >> >>> >> 6: A*B; >>> >> >>> >> {a1*b1, >>> >> >>> >> a2*b2, >>> >> >>> >> a3*b3, >>> >> >>> >> a4*b4} >>> >> >>> >> 7: c1*A + c2*B; >>> >> >>> >> {a1*c1 + b1*c2, >>> >> >>> >> a2*c1 + b2*c2, >>> >> >>> >> a3*c1 + b3*c2, >>> >> >>> >> a4*c1 + b4*c2} >>> >> >>> >> >>> >> Is the product of two lists like you wanted it? It looks a little bit >>> >> odd to me, but if this is the convention in >>> >> other systems thats fine. >>> >> >>> >> Eberhard >>> >> >>> >> On 01/08/14 23:01, Kostas Oikonomou wrote: >>> >>> Eberhard, >>> >>> >>> >>> That would be welcome, thanks. >>> >>> >>> >>> Another point of confusion for me is arrays vs. lists. As far as I can >>> >>> see, in Reduce arrays provide access by index, which other systems (e.g. >>> >>> maxima) also allow for lists. Arrays are also global in scope, which to >>> >>> me seems debatable. Are there any other differences visible to the >>> >>> user? Or reasons why one would want to use arrays? >>> >>> >>> >>> Kostas >>> >>> >>> >>> On 08/01/2014 14:48, Eberhard Schruefer wrote: >>> >>>> I think I already told off the list that this is not hard to implement. >>> >>>> I will put a small package together over the next few weeks. >>> >>>> >>> >>>> Eberhard >>> >>>> >>> >>>> On 01/08/14 19:10, Kostas Oikonomou wrote: >>> >>>>> It would be very useful and convenient to users familiar with e.g. >>> >>>>> maxima or Mathematica, and looking at Reduce as an alternative, if >>> >>>>> Reduce had the ability to perform some vector operations on lists. >>> >>>>> For >>> >>>>> example, >>> >>>>> >>> >>>>> A := {a1,a2,a3,a4}; B := {b1,b2,b3,b4}; >>> >>>>> >>> >>>>> c*A > {c*a1,..,c*a4} >>> >>>>> >>> >>>>> A + B > {a1+b1,...,a4+b4} >>> >>>>> >>> >>>>> A*B > {a1*b1,...,a4*b4} >>> >>>>> >>> >>>>> and presumably such an extension would also handle linear >>> >>>>> expressions like >>> >>>>> >>> >>>>> c1*A + c2*B, ... >>> >>>>> >>> >>>>> Unless, I'm missing something major, these manipulations, which are >>> >>>>> quite convenient (in evaluating functions with vector arguments, in my >>> >>>>> case), are very cumbersome to do in Reduce. >>> >>>>> >>> >>>>> I saw a related thread on this from 2011, but apparently nothing >>> >>>>> further >>> >>>>> was done. >>> >>>>> >>> >>>>> Kostas >>> >>>>> >>> >>>>> >>> >>>>>  >>> >>>>> >>> >>>  >>> >>> >>> >>> Want fast and easy access to all the code in your enterprise? Index and >>> >>> search up to 200,000 lines of code with a free copy of Black Duck >>> >>> Code Sight  the same software that powers the world's largest code >>> >>> search on Ohloh, the Black Duck Open Hub! Try it now. >>> >>>http://p.sf.net/sfu/bds >>> >>> _______________________________________________ >>> >>> Reducealgebradevelopers mailing list >>> >>>Reducealgebradevelopers@... >>> >>>https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers >>> >>> >>> >>> >>> >>>  >>> Want fast and easy access to all the code in your enterprise? Index and >>> search up to 200,000 lines of code with a free copy of Black Duck >>> Code Sight  the same software that powers the world's largest code >>> search on Ohloh, the Black Duck Open Hub! Try it now. >>> http://p.sf.net/sfu/bds >>> >>> >>> _______________________________________________ >>> Reducealgebradevelopers mailing list >>> Reducealgebradevelopers@... >>> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers >> >> >> >>  >> Want fast and easy access to all the code in your enterprise? Index and >> search up to 200,000 lines of code with a free copy of Black Duck >> Code Sight  the same software that powers the world's largest code >> search on Ohloh, the Black Duck Open Hub! Try it now. >> http://p.sf.net/sfu/bds >> >> >> _______________________________________________ >> Reducealgebradevelopers mailing list >> Reducealgebradevelopers@... >> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > > > >  > Want fast and easy access to all the code in your enterprise? Index and > search up to 200,000 lines of code with a free copy of Black Duck > Code Sight  the same software that powers the world's largest code > search on Ohloh, the Black Duck Open Hub! Try it now. > http://p.sf.net/sfu/bds > > > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Kostas Oikonomou <k.oikonomou@at...>  20140804 17:38:15

When I read in a file with this procedure in Reduce CSL, load_package listvecops; procedure H(x); begin; return (x *. log(x)) end; Reduce says: 3: H({1,2,3}); ***** Syntax error: log(3)( Memory access violation detected Arithmetic exception detected Arithmetic exception detected Arithmetic exception detected Kostas 
From: Eberhard Schruefer <eschruefer@ca...>  20140804 18:29:46

On 04/08/14 19:37, Kostas Oikonomou wrote: > When I read in a file with this procedure in Reduce CSL, > > load_package listvecops; > > procedure H(x); > begin; > return (x *. log(x)) > end; > > Reduce says: > > 3: H({1,2,3}); > > ***** Syntax error: log(3)( > Memory access violation detected > > > Arithmetic exception detected > > > Arithmetic exception detected > > > Arithmetic exception detected Yes, since 'log' does not distribute over lists. Either you need to use 'map' in your procedure or I have to write some code that does this for 'log'. However the latter would be necessary for any function you want to apply on a list. Eberhard > > Kostas > > >  > Infragistics Professional > Build stunning WinForms apps today! > Reboot your WinForms applications with our WinForms controls. > Build a bridge from your legacy apps to the future. > http://pubads.g.doubleclick.net/gampad/clk?id=153845071&iu=/4140/ostg.clktrk > _______________________________________________ > Reducealgebradevelopers mailing list > Reducealgebradevelopers@... > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers 
From: Eberhard Schruefer <eschruefer@ca...>  20140803 19:34:17
Attachments:
Message as HTML

On 03/08/14 21:18, Tony Roberts wrote: > > BEGIN PGP SIGNED MESSAGE > Hash: SHA1 > > Hi, > > what about {a,b,c}^{3,g,5} becoming {a^3,b^4gc^5} ? > and a^{3,g,5} becoming {a^3,a^g,a^5} ? > > Tony If that is useful it would be no problem to implement. However, that would need a minor change of the existing typing rule for expt. Before doing so I'll wait for more comments. Eberhard > > On 4/08/2014 12:44 am, Eberhard Schruefer wrote: > > Taking up Kostas's comments I committed a new version. It extends divison > > to two lists, allows element wise exponentiation of lists and a dot > product. > > > > 3: {a,b,c}/{3,g,5}; > > > > a b c > > {,,} > > 3 g 5 > > > > 4: ws^3; > > > > 3 3 3 > > a b c > > {,,} > > 27 3 125 > > g > > > > 5: {a,b,c,d} listdot {5,7,9,11/d}; > > > > 5*a + 7*b + 9*c + 11 > > > > Concerning the access of elements in a list by the syntax as is used > in the assist package (e.g. l.3) I am a little bit > > hesitating. It would be easy to do but would require a change at the > algebraic level to the core function . (cons). It should > > not be of any harm to the rest of REDUCE as the right argument of > cons is require to be a list at the algebraic level > > it might confuse LISP people. > > > > Eberhard > > > > On 03/08/14 16:48, Kostas Oikonomou wrote: > >> This is a discussion between Eberhard and myself on the new package > "listvecops" that Eberhard just put together. > >> Given the related discussion on the list, we are moving this > discussion to the list also. > >> > >> Kostas > >> > >> > >>  Original Message  > >> Subject: Re: [Reducealgebradevelopers] vector operations on lists > >> Date: Sun, 03 Aug 2014 11:41:15 +0200 > >> From: Eberhard Schruefer <eschruefer@...> > >> To: Kostas Oikonomou <k.oikonomou@...> > >> > >> > >> > >> On 03/08/14 04:34, Kostas Oikonomou wrote: > >> > Eberhard, thanks very much. I have a few observations: > >> > > >> > 1) The elementwise product is indeed how maxima and Mathematica > do it. > >> > But also see 3) below. > >> > > >> > 2) The division doesn't work as expected, i.e. elementwise. > >> > >> How would you like to have it? Do you mean dividing two lists? > >> > >> > > >> > 3) The "assist" package also provides a dot (scalar) product for two > >> > lists, called "scalvect". That would be another useful addition to > >> > "listvecops". Perhaps with a more convenient infix operator? > >> > >> Do you have a suggestion for a name of an infix operator of > >> the dot product? > >> > >> > > >> > 4) Another useful operation would be elementwise powers, the > exponent > >> > being a nonnegative real number. > >> > But if you think that allowing any real exponent would not cause any > >> > problems, that would be even better. > >> > >> O.k. thats very simple. > >> > >> > > >> > 5) I now use the package "assist" to provide access to list > elements by > >> > index, using the dot notation L.i. > >> > Would it make sense to merge that capability into the > "listvecops" package? > >> > >> I'll take a look. > >> > >> > > >> > 6) Fix some details in the error messages: > >> > > >> > "Only list can be added to a list." > "Only a list can be added > to a > >> > list." > >> > > >> > "Not equal length lists found in difference." > "Unequal length ..." > >> > > >> > "Not equal length lists found in times." > "Unequal length ..." > >> > >> Will change this in the next update. > >> > >> Eberhard > >> > > >> > > >> > Kostas > >> > > >> > > >> > On 08/02/2014 13:37, Eberhard Schruefer wrote: > >> >> I commited a basic package for the operations you asked for. > >> >> Please fetch the latest svn and then go 'load_package listvecops;" . > >> >> Your examples then result in > >> >> > >> >> 1: load_package listvecops; > >> >> > >> >> 2: A := {a1,a2,a3,a4}; > >> >> > >> >> a := {a1,a2,a3,a4} > >> >> > >> >> 3: B := {b1,b2,b3,b4}; > >> >> > >> >> b := {b1,b2,b3,b4} > >> >> > >> >> 4: c*A ; > >> >> > >> >> {a1*c, > >> >> > >> >> a2*c, > >> >> > >> >> a3*c, > >> >> > >> >> a4*c} > >> >> > >> >> 5: A + B; > >> >> > >> >> {a1 + b1, > >> >> > >> >> a2 + b2, > >> >> > >> >> a3 + b3, > >> >> > >> >> a4 + b4} > >> >> > >> >> 6: A*B; > >> >> > >> >> {a1*b1, > >> >> > >> >> a2*b2, > >> >> > >> >> a3*b3, > >> >> > >> >> a4*b4} > >> >> > >> >> 7: c1*A + c2*B; > >> >> > >> >> {a1*c1 + b1*c2, > >> >> > >> >> a2*c1 + b2*c2, > >> >> > >> >> a3*c1 + b3*c2, > >> >> > >> >> a4*c1 + b4*c2} > >> >> > >> >> > >> >> Is the product of two lists like you wanted it? It looks a > little bit > >> >> odd to me, but if this is the convention in > >> >> other systems thats fine. > >> >> > >> >> Eberhard > >> >> > >> >> On 01/08/14 23:01, Kostas Oikonomou wrote: > >> >>> Eberhard, > >> >>> > >> >>> That would be welcome, thanks. > >> >>> > >> >>> Another point of confusion for me is arrays vs. lists. As far > as I can > >> >>> see, in Reduce arrays provide access by index, which other > systems (e.g. > >> >>> maxima) also allow for lists. Arrays are also global in scope, > which to > >> >>> me seems debatable. Are there any other differences visible > to the > >> >>> user? Or reasons why one would want to use arrays? > >> >>> > >> >>> Kostas > >> >>> > >> >>> On 08/01/2014 14:48, Eberhard Schruefer wrote: > >> >>>> I think I already told off the list that this is not hard to > implement. > >> >>>> I will put a small package together over the next few weeks. > >> >>>> > >> >>>> Eberhard > >> >>>> > >> >>>> On 01/08/14 19:10, Kostas Oikonomou wrote: > >> >>>>> It would be very useful and convenient to users familiar with > e.g. > >> >>>>> maxima or Mathematica, and looking at Reduce as an > alternative, if > >> >>>>> Reduce had the ability to perform some vector operations on > lists. > >> >>>>> For > >> >>>>> example, > >> >>>>> > >> >>>>> A := {a1,a2,a3,a4}; B := {b1,b2,b3,b4}; > >> >>>>> > >> >>>>> c*A > {c*a1,..,c*a4} > >> >>>>> > >> >>>>> A + B > {a1+b1,...,a4+b4} > >> >>>>> > >> >>>>> A*B > {a1*b1,...,a4*b4} > >> >>>>> > >> >>>>> and presumably such an extension would also handle linear > >> >>>>> expressions like > >> >>>>> > >> >>>>> c1*A + c2*B, ... > >> >>>>> > >> >>>>> Unless, I'm missing something major, these manipulations, > which are > >> >>>>> quite convenient (in evaluating functions with vector > arguments, in my > >> >>>>> case), are very cumbersome to do in Reduce. > >> >>>>> > >> >>>>> I saw a related thread on this from 2011, but apparently nothing > >> >>>>> further > >> >>>>> was done. > >> >>>>> > >> >>>>> Kostas > >> >>>>> > >> >>>>> > >> >>>>> >  > >> >>>>> > >> >>> >  > >> >>> > >> >>> Want fast and easy access to all the code in your enterprise? > Index and > >> >>> search up to 200,000 lines of code with a free copy of Black Duck > >> >>> Code Sight  the same software that powers the world's largest code > >> >>> search on Ohloh, the Black Duck Open Hub! Try it now. > >> >>> http://p.sf.net/sfu/bds > >> >>> _______________________________________________ > >> >>> Reducealgebradevelopers mailing list > >> >>> Reducealgebradevelopers@... > >> >>> > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > >> > >> > >> > >> > >> > >> >  > >> Want fast and easy access to all the code in your enterprise? Index and > >> search up to 200,000 lines of code with a free copy of Black Duck > >> Code Sight  the same software that powers the world's largest code > >> search on Ohloh, the Black Duck Open Hub! Try it now. > >> http://p.sf.net/sfu/bds > >> > >> > >> _______________________________________________ > >> Reducealgebradevelopers mailing list > >> Reducealgebradevelopers@... > >> https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > > > > > > > > >  > > Want fast and easy access to all the code in your enterprise? Index and > > search up to 200,000 lines of code with a free copy of Black Duck > > Code Sight  the same software that powers the world's largest code > > search on Ohloh, the Black Duck Open Hub! Try it now. > > http://p.sf.net/sfu/bds > > > > > > _______________________________________________ > > Reducealgebradevelopers mailing list > > Reducealgebradevelopers@... > > https://lists.sourceforge.net/lists/listinfo/reducealgebradevelopers > >   >   > Professor A.J. Roberts > School of Mathematical Sciences phone: +61 8 8313 3035 > University of Adelaide fax: +61 8 8313 3696 > South Australia 5005. mailto:anthony.roberts@... > http://www.maths.adelaide.edu.au/anthony.roberts/ > ==.0000001000000100000110001000011010001111110010111011101000010000== > > BEGIN PGP SIGNATURE > Version: GnuPG v1 > Comment: Using GnuPG with Thunderbird  http://www.enigmail.net/ > > iEYEARECAAYFAlPeiwwACgkQ7TX8dTbro1tedwCdFO8CvCDzfZCzTMYaQdozyeG2 > YjUAnjBhHWUdan/CUteWHkLMX4vRQHPm > =ytW2 > END PGP SIGNATURE > 
Sign up for the SourceForge newsletter:
No, thanks