icegood

290 Reputation

14 Badges

15 years, 246 days

MaplePrimes Activity


These are replies submitted by icegood

indexing function, nice. Didn't see that it's main purpose for it. Just knew that maple is rich enough fo that.

indexing function, nice. Didn't see that it's main purpose for it. Just knew that maple is rich enough fo that.

MyTypedArray:=module() export ModuleApply, `?[]`; local larr, ltype, ModuleLoad; option optseq;
  description "Typed array with conbersion";
  ModuleLoad := proc()
    global `print/MyTypedArray`;
    `print/MyTypedArray` := proc()
      print(larr);
    end proc:
    TypeTools[AddType]( tMyTypedArray, t->evalb(op(0,t) = 'tMyTypedArray') );
  end proc:
  ModuleLoad();

  ModuleApply := proc()
    larr:=Array(args);
    ltype:=op([1,2],select(has,[op(4,larr)],datatype));
    return tMyTypedArray(args);
  end proc:
  `?[]` := proc(inst::uneval, index::[integer, integer..integer], val) option overload;
    if nargs = 2 then
      eval(inst):-larr[index];
    else
      eval(inst):-larr[index]:=convert(val,eval(inst):-ltype);
    end if;
  end proc:
end module:

MyTypedArrayFactory := proc() local mInstance; mInstance:=MyTypedArray; mInstance(args); mInstance;  end proc:

a:=MyTypedArray(1..10,datatype=float);
            tMyTypedArray(1 .. 10, datatype = float)


why a[1] don't return float? Did by 'overload' help.

@Joe Riel 

init file should be in HOME folder, not in ~/.emacs.d subfilder as i thought. Now everything fine

to Joe Riel 

under evalf? YES!

 

Axel Vogt 

No, Axel. One rule for all. I understand that instead of multiplication now only 'pow' call will be executed. But it's just price for that.

to Joe Riel 

under evalf? YES!

 

Axel Vogt 

No, Axel. One rule for all. I understand that instead of multiplication now only 'pow' call will be executed. But it's just price for that.

M-x mds says "no match" . Init file seems not runned at all or runned in inappropriate way.

See 2nd command from your init:

(autoload 'mds "mds" "Restart the Maple Debugger Server" t)

is it should be with one '?

Also already did end-line convesion to "Unix" for emacs init files. How can i assure that sturtup script runs in emacs i.e. printing "Hello, world" inside or so?

How to install it under windows?

All i have:

Error, (in mdc:-mdc) cannot connect to Debugger server.  Server may not be running.


7) BTW, modify please default path under windows to be subdirectory of emacs: from

there i see, that config should be

  1. If the environment variableis set, use the directory it indicates.
  2. If the registry entry HKCU\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates.
  3. If the registry entry HKLM\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates. Not recommended, as it results in users sharing the same HOME directory.
  4. Ifexists, then use. This is for backward compatibility, as previous versions defaulted toifwas not set.
  5. Use the user's AppData directory, usually a directory calledunder the user's profile directory, the location of which varies according to Windows version and whether the computer is part of a domain.

Have mine in ~AppData\Roaming\.emacs.d\ under windows 7.

My configs are in attach. Roaming.zip  Don't see message

"Hello, MDC!"

Did config.mpl read at all?

Joe, with you world become defenetly better :)

'assuming'  is not universal, at least doesn't work in my case. While for subject i found way to get new realigned pointer after 'assume' calling.

 

if evalb(convert(lvar,string)[-1..-1]="~") then
      lvar:=FromInert(_Inert_ASSIGNEDNAME(convert(lvar,string)[1..-2],"NAME"));
    else
      lvar:=FromInert(_Inert_ASSIGNEDNAME(convert(lvar,string),"NAME"));
    end if;

where lvar had value of old pointer. After checking ToInert(eval(lvar)) i found different addresses in

_Inert_LOCALNAME statement compared to "old" lvar.

'assuming'  is not universal, at least doesn't work in my case. While for subject i found way to get new realigned pointer after 'assume' calling.

 

if evalb(convert(lvar,string)[-1..-1]="~") then
      lvar:=FromInert(_Inert_ASSIGNEDNAME(convert(lvar,string)[1..-2],"NAME"));
    else
      lvar:=FromInert(_Inert_ASSIGNEDNAME(convert(lvar,string),"NAME"));
    end if;

where lvar had value of old pointer. After checking ToInert(eval(lvar)) i found different addresses in

_Inert_LOCALNAME statement compared to "old" lvar.

Valentine's Day is not far away :)

All i did for that it's just to obtain improvements in time but instead of that i obatin only precision ones without big time change. Why in next test code caching mechanizm don't  live together with optimization for LerchPhi

"in peace and glory"?

LerchPhiTest.zip

Goddamn, still noone???

My case relates to every expressions, not only rtables. And expressions assumed to fully calculable (because they are under global scope). Actually i've written workaround:

ReassumeVars:=proc(allconditions)
  local li, var, condition;
  global DummyVar;
  #
  for condition in allconditions do
    var:=op(1, condition[1]);
    for li in anames('user') do
      if type([eval(li)], list(symbol)) and evalb(li<>var) then
        assign(li, subs(var=DummyVar, li));
      end if;
    end do;
    assign(evaln(var), evaln(var));
    assume(condition[]);
    for li in anames('user') do
      if type([eval(li)], list(symbol)) and has(li, DummyVar) then
        assign(li, subs(DummyVar=var, li));
      end if;
    end do;
  end do;
end proc:

with input [[a<=amax, a>=amin], [b is real]] or whatever. Should work.

1 2 3 4 5 6 7 Last Page 2 of 10