Mac Dude

1551 Reputation

17 Badges

12 years, 131 days

MaplePrimes Activity


These are questions asked by Mac Dude

Hi,

Following situation: I have Records with several members. These members in turn have varied expressions assigned to them: some have numbers, one has a Matrix, some have formulae. Example:

q:=Record(l=len,k1=kl/len,R=(a 6x6 Matrix dependent on len and kl/len));

I want to be able to use the limit command on each of the members of q such that each member gets assigned the correct limit of its expression. I.e. I want to write a function limit2 such that

limit2(q,len=0);

yields

Record(l=0,k1=infinity,R=(limit~(the Matrix,len=0))

The trick here is that the members of the Record vary for different Records but I want to write a function limit2 that works for all of these. I can make a list of the members by using exports(q) like this:

exlist:=[exports(q)];

and after some fiddling I found that I can run limit on each member in turn:

for nam in exlist do
  limit~(eval(parse(cat(elm,":-",eval(nam)))),len=0)
end do;

What I have not been able to do is putting the result back into the member of the Record. Usually I would use assign for such a task, but I am unable to get the correct name on the left side that lets me assign to it. These names would of course be q:-l, q:-k1 and q:-R in the above example. I tried the parse(cat(...)) construct above and variations, but in the best case the assignment does not happen, in worse cases I get an error thrown. Never do I get the actual assignment.

Any hint how to do this?

TIA,

M.D.

PS: FWIW, I am doing this on Mape 15.

 

I am trying to define a new typt and I am beating my head against the wall...

What I have working:

TypeTools:-AddType(Element,'record(l,R)');
 
This defines a type which I can then use in type(xpr,Element) to be false or true depending on whether xpr is a record containing (at least) entries l and R or not.

Now I want to define a type ExpandedLine that is a Vector of Element (Element in the sense above). In fact, in the context of my application I am willing to settle for ExpandedLine being a Vector of record.

Tried various approaches (and making sure Vector is in uneval quotes in the AddType statement) like:

TypeTools:-AddType(ExpandedLine,'Vector'(record));

and variations but no luck.

Any help is appreciated.

Mac Dude

 

I have the following situation:

HB:=Bend(L,a,n);

Bend is a proc, that returns a Record with info based on its parameters. I would like to get access to the name I assign to (i.e. HB) in the proc. Any chance?

Mac Dude

PS: I can of course kludge things by adding an argument to the proc Bend. But I'd like to avoid that.

I am running a Maple procedure in CLI Maple (mainly because it just provides colored random numbers for other work). When the procedure runs I am getting this kind of output scrolling by:

memory used=10732.9MB, alloc=344.0MB, time=895.85
memory used=10809.2MB, alloc=345.6MB, time=904.26
memory used=10885.5MB, alloc=347.3MB, time=912.67
memory used=10961.8MB, alloc=348.9MB, time=921.27
.
.
.

So I am wondering what "memory used" and "memory allocated" mean here. In "Activity Monitor" (this is Mac OS X) I see that the "memory allocated" values correspond rather closely to the "real memory" usage. No idea what the "memory used" column is. Note that this is a 32 bit process running on a PPS Mac, and it merrily "uses" unlimited amounts of memory that don't exist on the machine and that a 32 bit process should not be able to use (I think Mac OS X limits 32 bit processes to 4 GB). It is clearly not paging as the machine stays perfectly useable.

So, what am I to make of these numbers?

Mac Dude.

 

Statistics:-Histogram by default choses the vertical axis such that the area under the histogram is 1 (or something like that). In my work, I invariably need to add "frequencyscale=absolute" to get the scale I need. Is there any way to make this the default? Typing this every time gets so old... I have been looking to something analogous to plots:-setoptions but that doesn't seem to exist for Statistics.

M.D.

First 9 10 11 12 13 14 15 Last Page 11 of 23