acer

32632 Reputation

29 Badges

20 years, 45 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

Do you mean that you want the data in the plot that is (saved in) the PlotComponent? That component's name is 'plotter_'.

Open that worksheet, but with autoexecute turned off, and decline to execute automatically, when prompted. Then do this,

stuff:=DocumentTools:-GetProperty('plotter_',value);

In recent Maple you can use the plottools:-getdata command to extract the data (as rtables). But even in older versions you could now pick apart `stuff` using the op command.

plottools:-getdata(stuff);

I'm guessing that you want the Matrix in the ensuing  "points" substructure.

acer

@lpearce The integral succeeds for me using 64bit Maple 14.00 on both ubuntu 10.04 and 11.04.

But the integral failed for me, returning unevaluated, on 64bit ubuntu 12.04 with 64bit versions 14.00 and 14.01 of Maple. The problem now appears similar to this and this.

Note that ubuntu 12.04 came out some years after Maple 14 (2010), and is not on the list of supported platforms for that version.

@lpearce The integral succeeds for me using 64bit Maple 14.00 on both ubuntu 10.04 and 11.04.

But the integral failed for me, returning unevaluated, on 64bit ubuntu 12.04 with 64bit versions 14.00 and 14.01 of Maple. The problem now appears similar to this and this.

Note that ubuntu 12.04 came out some years after Maple 14 (2010), and is not on the list of supported platforms for that version.

@lpearce I also had success for that command with 64bit Maple 14.00 on Linux, when running in the commandline (tty) interface (started with the -s option to suppress default reading of initialization files).

It's hard to guess just exactly what the original cause might have been, for you.

@lpearce I also had success for that command with 64bit Maple 14.00 on Linux, when running in the commandline (tty) interface (started with the -s option to suppress default reading of initialization files).

It's hard to guess just exactly what the original cause might have been, for you.

Hmm. Now I am wondering what was wrong with this code in the original thread, and which also works in Maple 13, 12, and 11...

> proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();

proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();

That didn't rely upon first calling interface(), and doesn't call `print`. The calls to `printf` could be replaced by calls to `iolib` (and some printing mechanism must be used, because that is the task).

Hmm. Now I am wondering what was wrong with this code in the original thread, and which also works in Maple 13, 12, and 11...

> proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();

proc () local t; t := proc () debugopts('callstack')[9] end proc; printf("%s;\n",eval(t)()) end proc();

That didn't rely upon first calling interface(), and doesn't call `print`. The calls to `printf` could be replaced by calls to `iolib` (and some printing mechanism must be used, because that is the task).

The above used `thisproc` as a means of an anonymous procedure to refer to itself, which is somewhat recent Maple functionality.

The following is in Maple 13, as 1D Maple Notation input,

> assign('m',proc () printf("assign('m',%s): m();",convert(eval('m'),string)) end proc): m();

assign('m',proc () printf("assign('m',%s): m();",convert(eval('m'),string)) end proc): m();

I suppose that conversion to a string is not necessary, and it could also be,

> assign('m',proc () printf("assign('m',%a): m();",eval('m')) end proc): m();

assign('m',proc () printf("assign('m',%a): m();",eval('m')) end proc): m();

The above used `thisproc` as a means of an anonymous procedure to refer to itself, which is somewhat recent Maple functionality.

The following is in Maple 13, as 1D Maple Notation input,

> assign('m',proc () printf("assign('m',%s): m();",convert(eval('m'),string)) end proc): m();

assign('m',proc () printf("assign('m',%s): m();",convert(eval('m'),string)) end proc): m();

I suppose that conversion to a string is not necessary, and it could also be,

> assign('m',proc () printf("assign('m',%a): m();",eval('m')) end proc): m();

assign('m',proc () printf("assign('m',%a): m();",eval('m')) end proc): m();

@Markiyan Hirnyk It is full source and not just the procedure body that you are after, it seems. I didn't understand that part of the request before, sorry.

In 1D Maple notation this might be considered closer, as a line-printed piece of source code,

> proc () printf("%s();",convert(eval('thisproc'),string)) end proc();

proc () printf("%s();",convert(eval('thisproc'),string)) end proc();

[edit: doing it without the conversion to a string...]

> proc () printf("%a();",eval('thisproc')) end proc();

proc () printf("%a();",eval('thisproc')) end proc();

For 2D Math it might be possible, but trickier because it may be that Typesetting calls or TypeMK are needed.

@Markiyan Hirnyk It is full source and not just the procedure body that you are after, it seems. I didn't understand that part of the request before, sorry.

In 1D Maple notation this might be considered closer, as a line-printed piece of source code,

> proc () printf("%s();",convert(eval('thisproc'),string)) end proc();

proc () printf("%s();",convert(eval('thisproc'),string)) end proc();

[edit: doing it without the conversion to a string...]

> proc () printf("%a();",eval('thisproc')) end proc();

proc () printf("%a();",eval('thisproc')) end proc();

For 2D Math it might be possible, but trickier because it may be that Typesetting calls or TypeMK are needed.

@Axel Vogt One of the profiled code snippets in that google groups (usenet) thread performed "porgrammer indexing" of an rtable, by referring to an entry using () round brackets instead of [] square brackets when assigning computed values to entries. I wonder if any of his code relies heavily on this to repeatedly "grow" any rtables (ie. Vector, Matrix, or Array).

When Maple grows an rtable in this way it may have to recreate  and replace it in situ. I believe that it might overallocate by some proportion, which avoids recreation of the underlying structure only up to the amount of extra space allocated. But if that kind of indexing is done heavily (or.. entirely in the worst scenario) then Maple may be producing and disposing of many copies of the rtable (ie. disposable garbage).

Here is an example of the "worst scenario", for comparison, performed in Maple 15 on 64bit Linux.

> restart:
> kernelopts(printbytes=false):

> p:=proc(x::float,V::Vector(datatype=float[8]),N::integer)           
>    local i::integer[4];
>    for i from 1 to N do
>       V(i):=ln(x); # programmer indexing, which can grow V
>    end do;
>    NULL;
> end proc:

> G:=Vector(datatype=float[8]): # created with no entries stored

> CodeTools:-Usage( evalhf(p(3.5, G, 1000000)) ):  
memory used=84.64MiB, alloc change=61.36MiB, cpu time=720.00ms, real time=734.00ms

> G[100];
                               1.25276296849537


> restart:
> kernelopts(printbytes=false):

> p:=proc(x::float,V::Vector(datatype=float[8]),N::integer)           
>    local i::integer[4];
>    for i from 1 to N do
>       V[i]:=ln(x);
>    end do;
>    NULL;
> end proc:

> G:=Vector(1000000,datatype=float[8]):

> CodeTools:-Usage( evalhf(p(3.5, G, 1000000)) ):  
memory used=512 bytes, alloc change=0 bytes, cpu time=130.00ms, real time=134.00ms

> G[100];
                               1.25276296849537

It's just a guess, as to a possible cause of avoidable garbage collection. Better performance in such a case might even be attained by initially creating the rtable with the maximal explicit size that the algorithm might need (if that is feasible in memory).

@Axel Vogt One of the profiled code snippets in that google groups (usenet) thread performed "porgrammer indexing" of an rtable, by referring to an entry using () round brackets instead of [] square brackets when assigning computed values to entries. I wonder if any of his code relies heavily on this to repeatedly "grow" any rtables (ie. Vector, Matrix, or Array).

When Maple grows an rtable in this way it may have to recreate  and replace it in situ. I believe that it might overallocate by some proportion, which avoids recreation of the underlying structure only up to the amount of extra space allocated. But if that kind of indexing is done heavily (or.. entirely in the worst scenario) then Maple may be producing and disposing of many copies of the rtable (ie. disposable garbage).

Here is an example of the "worst scenario", for comparison, performed in Maple 15 on 64bit Linux.

> restart:
> kernelopts(printbytes=false):

> p:=proc(x::float,V::Vector(datatype=float[8]),N::integer)           
>    local i::integer[4];
>    for i from 1 to N do
>       V(i):=ln(x); # programmer indexing, which can grow V
>    end do;
>    NULL;
> end proc:

> G:=Vector(datatype=float[8]): # created with no entries stored

> CodeTools:-Usage( evalhf(p(3.5, G, 1000000)) ):  
memory used=84.64MiB, alloc change=61.36MiB, cpu time=720.00ms, real time=734.00ms

> G[100];
                               1.25276296849537


> restart:
> kernelopts(printbytes=false):

> p:=proc(x::float,V::Vector(datatype=float[8]),N::integer)           
>    local i::integer[4];
>    for i from 1 to N do
>       V[i]:=ln(x);
>    end do;
>    NULL;
> end proc:

> G:=Vector(1000000,datatype=float[8]):

> CodeTools:-Usage( evalhf(p(3.5, G, 1000000)) ):  
memory used=512 bytes, alloc change=0 bytes, cpu time=130.00ms, real time=134.00ms

> G[100];
                               1.25276296849537

It's just a guess, as to a possible cause of avoidable garbage collection. Better performance in such a case might even be attained by initially creating the rtable with the maximal explicit size that the algorithm might need (if that is feasible in memory).

@Angelos58 

Let mA mean membership in A, and mB mean membership in B.

"mA implies mB" is an analog of "A is a subset of B".

"mA or mB" is an analog of "A union B".

"mA and MB" is an analog of "A intersect B".

 

If you are stuck accepting the first of those analogs, then consider the following. (You may take the first and second sentences below as a definition of the term subset.)

Let B be a set and let set A be a subset of B.

Every member of A is also a member of B.

Every member of A is necessarily a member of B.

Any member x of A is necessarily a member of B.

If x is a member of A then x is a member of B.

"x is a member of A" implies "x is a member of B".

Membership in a subset of set B implies membership in set B.

@Angelos58 

Let mA mean membership in A, and mB mean membership in B.

"mA implies mB" is an analog of "A is a subset of B".

"mA or mB" is an analog of "A union B".

"mA and MB" is an analog of "A intersect B".

 

If you are stuck accepting the first of those analogs, then consider the following. (You may take the first and second sentences below as a definition of the term subset.)

Let B be a set and let set A be a subset of B.

Every member of A is also a member of B.

Every member of A is necessarily a member of B.

Any member x of A is necessarily a member of B.

If x is a member of A then x is a member of B.

"x is a member of A" implies "x is a member of B".

Membership in a subset of set B implies membership in set B.

First 403 404 405 406 407 408 409 Last Page 405 of 597