Christian Wolinski

MaplePrimes Activity


These are replies submitted by Christian Wolinski

@hitstudent Have you actually produced the object asked? The method you produced is simply incomplete.

@taro I think that should be:

numer_expand := expand@numer/denom;

@Carl Love type(f[1](x),indexed); returns false, at least in Maple 5.4. Is this different in Maple 16?

@Preben Alsholm I have not observed this before:

 

restart;
rng := ''i = 1 .. 3'';
u := setattribute((x) -> 'x' ^ op(1, 'procname'), remember);
['u[i]' $ rng](x-y);
op(4, eval(u));

So an index on a function name always invokes the same procedure. I always expected an indexed function to require a table.

So how do we typecheck an expression for function f, specifically with or specifically without the index?

@Carl Love type('u[1](x)', specfunc(anything, u))=false; #Maple 5.4

That is to say specfunc judges the face of the expression with identity. What about newer Maple?

Say u:=proc(x) x+1 end; v:=table([]); type('u[1](x)', specfunc(anything, u)), type('v[1](x)', specfunc(anything, v));

@Carl Love I did not anticipate specfunc(`~`[`=`]) as a possibility. Does this mean newer maple would identifiy u[1](x) as specfunc(u)? How does one identify indexed function by its base name?

@Carl Love Would this be a cartesian product,: {{1,3}, {1}} union~ {{5},{6}}? Is that even valid form?

My original question was this: type('a =~ b', specfunc(anything, `~`)) or type('a =~ b', specfunc(anything, `=~`)) or some other type?

@Carl Love There is one in the previous post.

Output list from op Command

Also, can you tell me how the new ~ is interpreted typewise, ex: a ~= b?

 

 

 

 

restart;
N:=20000;

T:=table():
i:=1:
for i from i to N
do
   T[i]:=T[i+1]:
   if irem(i,100)=0 then
      T[i+1]:=1;
      evaln(T[1]);
   fi;   
od:
i,eval(T[1],i-1),eval(T[1],i);

U:=table():
i:=1:
for i from i to N
do
   U[i]:=U[i+1]:
   if irem(i,100)=0 then
      U[i+1]:=1;
      eval(U[1],N+1);
   fi;   
od:
i,eval(U[1],N),eval(U[1],N+1);;


gives:
N := 20000
20001   T[20001]   1
20001   U[20001]   1


evaln(expression) and eval(expression, length) make no obstacles. This is what I was anticipating.
eval(expression) is different indeed.

@roman_pearce Thank You. I do not understand what you mean when you say it is a "C function". I always believed Maple is database based, so to overcome common limits of linear storage, so why these limits? Is there a limit on recursion in the newer kernels?

Also see below. Why are all the limits observed distinct?

 

 

restart;

f:=unapply('cat(a,i),i');
g:=unapply('assign(f(i),f(i+1)),i');
 
i:=1:N:=5000;
for i from i to N  
do
   g(i);
   eval(a1);
od:
print(i);

for i from i to N  
do
   g(i);
   eval(a1);
od:
print(i);

gives:

N := 5000
Error, too many levels of recursion
2824
Error, too many levels of recursion
2824

@Art Kalb
type & typematch observe an expression, each type given identifies a single element in the exression.
patmatch observes the expression and subexpressions as aggregates, each type given may be identified by a composite of elements in the expression.

@Preben Alsholm "For i from i do" means "resume i". Initially I reused that loop to get the result I wanted. Now I've simply copied it twice.

@Carl Love I just saw this: PolynomialTools, Split. Thats what it is.

@Preben Alsholm Maple V, Release 4 (1996).


It looks like a coding slip up, easy fixed.

@Carl Love `evala/toprof` given a parameter containing RootOfs chooses one RootOf in the expression, not used in parameter of any other RootOfs or functions in the expression.

First 7 8 9 10 11 12 13 Page 9 of 13