icegood

290 Reputation

14 Badges

16 years, 183 days

MaplePrimes Activity


These are replies submitted by icegood

Hm, still noone? How then you recompile external library without closing maple itself?

static const char *FuncNames[]= {"MainF", "MainFDerivativeA", "MainFDerivativeY", "MainFDerivative2AA", "MainFDerivative2AY",
  "MainFDerivative2YY", "MainFDerivative3AAA", "MainFDerivative3AAY", "MainFDerivative3AYY", "MainFDerivative3YYY",
  "MainFDerivative4AAAA", "MainFDerivative4AAAY", "MainFDerivative4AAYY", "MainFDerivative4AYYY", "MainFDerivative4YYYY"}; //names of fuctions called from main maple code
static char expr[1024]; //general expression
 
static ice_real_TReal MyExternalFuctionEval(ice_real_TReal y, ice_real_TReal a, ice_real_TReal b, const int DifNo)
{
  FLOAT64 res;
  static int forget;
  static const int forget_delta=100;
  //
#define _CRT_SECURE_NO_WARNINGS
  sprintf(expr, "%s(%.20le, %.20le, %.20le);", FuncNames[DifNo], y, a, b);
#undef _CRT_SECURE_NO_WARNINGS
  res=MapleToFloat64(ExternalKernel, EvalMapleStatement(ExternalKernel, expr));
  forget++;
  if (forget%forget_delta==0)
  {
    sprintf(expr, "forget(%s);", FuncNames[DifNo]);
    EvalMapleStatement(ExternalKernel, expr);
  }
  return (ice_real_TReal)(res);
}

 

Actually, was appreciated even to rise Digits set. Nevertheless, double has only about 16 digits...

And againg, 'forget' call is rather for 'playing'. Neither works before or after. Have suspect that forget should be applied to smth else :(...

Found, via global variables in proc.

also  tried

don't work

also  tried

don't work

Stupid form :(

 

s := proc (y) options operator, arrow; a+b+y end proc; g := proc (y, a, b) options operator, arrow; s(y) end proc; g(1, 1, 1)

---Do you make that unapply call before of after you define MainF? Hopefully, it is made after.

 

After, of course.

---Is MainFDerivative a procedure that will compute under the evalhf interpreter?...

I don't actually know nothing about callbacks nor evalhf  itself. Test function is rather simple one:

 

For it and derivatives memory consuption is big too...

---Do you make that unapply call before of after you define MainF? Hopefully, it is made after.

 

After, of course.

---Is MainFDerivative a procedure that will compute under the evalhf interpreter?...

I don't actually know nothing about callbacks nor evalhf  itself. Test function is rather simple one:

 

For it and derivatives memory consuption is big too...

it's just after 'playing'. Originally it was without options. AS you can see i tried that way too.

it's just after 'playing'. Originally it was without options. AS you can see i tried that way too.

Also use smth like

and tried to call MainFDerivativeY via EvalMapleStatement . Maybe unapply itself has bad cache?

unfortunately, method is far away to be universal...

For more complicated expression error occures with type mismatch for arg S of ES.

My aim is to expand expression

s := (sum((sum(b[j]*(j-1)/n, j = 1 .. i)-(sum(b[j]*(n-j+1)/n, j = i+1..n)))^2, i = 1 .. n))^2

by powers of b[j]. And i really disappointed that i cannot do that in 1 minute :(

unfortunately, method is far away to be universal...

For more complicated expression error occures with type mismatch for arg S of ES.

My aim is to expand expression

s := (sum((sum(b[j]*(j-1)/n, j = 1 .. i)-(sum(b[j]*(n-j+1)/n, j = i+1..n)))^2, i = 1 .. n))^2

by powers of b[j]. And i really disappointed that i cannot do that in 1 minute :(

First 7 8 9 10 Page 9 of 10