Re: Re: More on Delete Problems

*To*: mathgroup at smc.vnet.net*Subject*: [mg51715] Re: [mg51691] Re: More on Delete Problems*From*: Andrzej Kozlowski <andrzej at akikoz.net>*Date*: Sat, 30 Oct 2004 03:48:04 -0400 (EDT)*References*: <cl9t75$7nl$1@smc.vnet.net> <200410270554.BAA24546@smc.vnet.net> <clpq73$9qe$1@smc.vnet.net> <200410290739.DAA03434@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

No, I have good reason to believe that the problem is relate to Packed Arrays. I also have reaosn to beleive that your suggestion is just a red herring. Theorem 1. Packed arrays are relevant here. a = {{1., 2., 3.}, {4., 5., 6.}}; b = {{1, 0, 1}, {0, -2, 3}, {0, 1, 0}}; c = a.b Developer`PackedArrayQ[c] True Now if we unpack the packed array and use delete we do not get a crash, if we do not we get a crash every time. Now, if you understand what packed arrays do you will see how this may well be related to the crash. Of course this is not a strict mathemaitcal proof but it far more convincing than your suggestion, as I will prove next. Theorem 2 Your suggestion is a "red herring", and has nothing to do with this problem. Proof. a={{1.,2.,3.},{4.,5.,6.}}; b={{1,0,1},{0,-2,3},{0,1,0}}; c=a.b; <<Algebra`AlgebraicInequalities` Delete[c,{1,1}] At this point I get a kernel crash every time! $Version In[1]:= $Version Out[1]= 5.0 for Mac OS X (June 10, 2003) If my conclusion was "premature' what would you call yours? Andrzej Kozlowski Chiba, Japan http://www.akikoz.net/~andrzej/ http://www.mimuw.edu.pl/~akoz/ On 29 Oct 2004, at 16:39, Peter Valko wrote: > *This message was transferred with a trial version of CommuniGate(tm) > Pro* > Dear Andrej, > > I do not really see why you used packed arrays here. > If your message is intended to suggest that the crash problem is > somehow related to the PackedArrays, your conclusion is premature. To > show this I do: > > a = {{1., 2., 3.}, {4., 5., 6.}}; > b = {{1, 0, 1}, {0, -2, 3}, {0, 1, 0}}; > c = a . b > {{1., -1., 7.}, {4., -4., 19.}} > << Algebra`AlgebraicInequalities` > Delete[c, {1, 1}] > {{-1., 7.}, {4., -4., 19.}} > > Without including the "<< Algebra`AlgebraicInequalities`" line, > Mathematica crashes. > > Including the "<<Algebra`AlgebraicInequalities`" line eliminated the > crash problem, but it does not mean the > "Algebra`AlgebraicInequalities" has anything to do with the root of > the problem. (I selected it because it is clearly a neutral, > ambivalent package for the given case.) My conclusion is that with > including a package (any package) more initialization is done and that > helps to avoid the root of the crash problem. > > This example is good, because it is simple and reproducible and it > shows the existence of a problem (I suspect one related to dynamic > allocation of space) that might be more difficult to discover in a > real situation. It is possible, that a simple fix can be built in > temporarily into the init.m file, for instance. A light > acknowledgement and advice from somebody associated with WRI would > help us a lot, even if the disclamer ("this is not the official > opinion of my employer" might show up with it.) > > Regards > Peter > > > > Andrzej Kozlowski <andrzej at akikoz.net> wrote in message > news:<clpq73$9qe$1 at smc.vnet.net>... >> Packed Arrays strike again! >> >> Try this: >> >> >> In[1]:= >> a = {{1., 2., 3.}, {4., 5., 6.}}; >> >> In[2]:= >> b = {{1, 0, 1}, {0, -2, 3}, {0, 1, 0}}; >> >> In[3]:= >> c = Developer`FromPackedArray[a . b]; >> >> In[4]:= >> Delete[c, {1, 1}] >> >> Out[4]= >> {{-1., 7.}, {4., -4., 19.}} >> >> No crash. >> >> Andrzej Kozlowski >> >> Andrzej Kozlowski >> Chiba, Japan >> http://www.akikoz.net/~andrzej/ >> http://www.mimuw.edu.pl/~akoz/ >> >> >> >> >> On 27 Oct 2004, at 14:54, Peter Valko wrote: >> >>> For the record: >>> >>> $Version >>> 5.0 for Microsoft Windows (June 11, 2003) >>> >>> a={{1.,2.,3.},{4.,5.,6.}} >>> b = {{1,0,1},{0,-2,3}, {0,1,0}} >>> c = a . b >>> Delete[c,{1,1}] >>> >>> crashes Mathematica on my machine, exactly as Give Effinger said. >>> >>> >>> >>> >>> >>> >>> >>> >>> Gove Effinger <effinger at skidmore.edu> wrote in message >>> news:<cl9t75$7nl$1 at smc.vnet.net>... >>>> Here's simple code which bombs for me: >>>> >>>> a={{1.,2.,3.},{4.,5.,6.}} >>>> >>>> b = {{1,0,1},{0,-2,3}, {0,1,0}} >>>> >>>> c = a . b >>>> >>>> Delete[c,{1,1}] >>>> >>>> Why? >>>> >>>> G. Effinger >>> >>> > >

**References**:**Re: More on Delete Problems***From:*p-valko@tamu.edu (Peter Valko)

**Re: More on Delete Problems***From:*p-valko@tamu.edu (Peter Valko)

**Re: Re: Bug in Graphics Text under Linux**

**Re: bimodal ditribution form counting signs of Pi digits differences**

**Re: More on Delete Problems**

**Re: Re: More on Delete Problems**