acer

33193 Reputation

29 Badges

20 years, 216 days
Ontario, Canada

Social Networks and Content at Maplesoft.com

MaplePrimes Activity


These are replies submitted by acer

@emendes You've now described a scenario in which the entries are irrelevant to the job. It is very strange that the code you posted utilizes (and searches upon) the values of the entries. That is one of the primary causes of its slowness.

Does the command ListTools:-Slice in Maple 2020 provide anything like the functionality you want? (I'm not saying that its performance is optimal. i am curious about a functionality match.)

If you want to split according to number of entries (in the chunks) then why does ListTools:-LengthSplit not serve? if you want to split according to the number of chunks then why does ListTools:-Slice not serve? If neither of those provides the performance you require then, still, why omit that fact?

ps. It is unhelpful to not mention what kind of list size you have in mind, and target performance you desire.

What do you mean by "chunks of a certain size"?  Does that mean that the values of the entries come into it? (If not, then why examine them? If so, then how?)

Your code contains at least one instance of the misspelling nchunck and as posted doesn't work.

Upload and attach your document using the green up-arrow in the Mapleprimes editor.

You can upload and attach your worksheet, so that people don't have to re-type the expressions using just an image of your code.

(Also, I converted your Post into a Question.)

@Scot Gould I checked, by running the 2D Input case and its 2D parsing through the debugger (Typesetting, which can sometimes be tricky).

It parsed through this inert form (which I assigned to name foo),

foo := _Inert_FUNCTION(_Inert_TABLEREF(_Inert_NAME("evalf"),_Inert_EXPSEQ(_Inert_INTPOS(30))),_Inert_EXPSEQ(_Inert_FUNCTION(_Inert_NAME("^"),_Inert_EXPSEQ(_Inert_FLOAT(_Inert_INTPOS(30),_Inert_INTNEG(1)),_Inert_FLOAT(_Inert_INTPOS(12),_Inert_INTNEG(1))))));

And that turns into this,

lprint(FromInert(foo));

   evalf[30](`^`(3.0,1.2))

And that involves the prefix form for `^`, which as shown earlier does not involve the automatic simplification

@Lisa6 You have now posted eight (8) times in this thread, but you still have not stated explicitly what files you put where, and what you tried.

Notice that in my last Reply I stated where I put the files as well as what I executed in Maple, and I showed the output.

So, you executed these Maple commands?

libname := "/home/usr/maple2020/FGb/FGblib", libname;
with(FGb);

Show the output from both.

Where did you put the files FGblib.ind and FGblib.lib? What directory are they in? Where did you put the .so files? What directory are they in? What are their names?

What do you see if you execute in a Linux terminal,
    cd /home/usr/maple2020/FGb
    ls -l *

Which Maple interface did you launch, and how?

@Scot Gould That old Question and Answer you showed is unrelated to your primary query here, about evalf[30](3.0^(1.2)) producing only a 10-digit result under default Digits=10 when entered in 1D plaintext Maple Notation.

That old post relates to evalf's numeric model (atomic operations are supposed to attain accuracy with 0.6 ulps, but bets are off for compound operations which may incur additional roundoff error and loss of precision) and the special remeber table mechanisms with evalf that allow prior results to be re-used and rounded when requested under lower working precision. I don't see how any of that relates to your primary query here.

In case the original question is altered, here it is:

  1. a1 = x and for every n >= 1 ,   

write the Maple procedure that calculates the term a100 for x = 2.

 

In case the original question is altered, here it is (with followup comment):

 

Type the Maple command string that calculates this expression for the number of n arb
itrarily entered from the keyboard.Can you help me please ?

In the question, an arbitrary number of n will be entered on the keyboard. The first
a = x ^ n will be taken using the for loop. Then with i for a general repetition tota
l expression that will go from i = 2 to n, the desired total will be obtained.

 

In case the question is altered, here is the original:

by using its expansion Write the Maple  program.

@serge17 Yes, they are different.

The cat command will evaluate its first argument, which makes the difference in your example. 

As you saw, it makes the difference between concatenating with the name and concatenating with the assigned value of the name.

It is important to understand the difference. Understanding the difference and using straightforwardly comprehensible code is much better than using hackish methods like a double use of ||, etc.

@HaHu Please do not submit duplicates of this topic.

It's been explained to you: you cannot assign to a name as expression that depends on that same name. (If you could then subsequent evaluation would result in an infinite loop.)

You may need to understand the difference between an equation such as, say,
   u[6] = ....some expression involving u[6]...
which is OK, and the assignment,
   u[6] := ....some expression involving u[6]...
which is not OK.

But don't submit duplicates of the topic just because you don't properly understand the issues already explained.

@serge17 

save G, cat(mypath,"foo.m");


 

On a guess (from the error message it gave that contained a slightly different .so file name!) I tried the following:

I copied the file libfgbuni.so to the new name libfgbunid.so in the same location.

The Linux directory I chose (to contain both .so files as well as the FGblib subdirectory) was this:
    /home/acer/mapleprimes/FGb

The I ran Maple 2020 (64bit Linux) and prepended libname with the subdirectory's location.

This is what happened:

restart;
libname := "/home/acer/mapleprimes/FGb/FGblib", libname:

with(FGb);

Path set to /home/acer/mapleprimes/FGb/FGblib/../libfgbunid.so
    FGb/Maple interface package Version 1.68
    JC Faugere (Jean-Charles.Faugere@inria.fr)
    Type ?FGb for documentation
[ModuleUnload, cpu, date, fgb, fgb_gbasis, fgb_gbasis_elim, fgb_gbasis_lm,
    fgb_hilbert, fgb_interface, fgb_matrixn, fgb_matrixn_radical,
    fgb_matrixn_radical2, fgb_multi, fgb_normalForm, pseudo_fgb_normalForm]

fgb_gbasis([x^2+y,y^2+x],0,[x],[y]);
open simulation
                   2       4
                 [y  + x, y  + y]

The tar file from the website unpacked and contained the file libfgbuni.so, but when I tried all the above without copying to the new file name I got only this:

with(FGb);
libfgbunid.so failed
Error, (in pack_fgb_find_path) cannot find a valid path !

That is why I tried copying the file to the new name libfgbunid.so with the name containing the extra character.

This looks like an oversight/mistake by the author (3rd party). Also, I notice that on the webpage the example does not show the printing of the discovered file location.

@serge17 I'm glad that worked for you, and that you have a solution.

The backslash is the "escape" character in a string (eg, "\n" is a new-line character), which is pretty common even without Maple. To get a literal backslash you can thus escape the backslash, so that "\\" denotes one backslash character.

In modern Maple you can use a forwardslash "/" instead, for file locations even on MS-Windows. I am not sure whether that worked in ancient Maple 7 (2001).

First 184 185 186 187 188 189 190 Last Page 186 of 608