Carl Love

Carl Love

28025 Reputation

25 Badges

12 years, 311 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

@acer Oh my, I have a feeling that this will become a FAQ.

@mthkvv It's not possible to calculate a middle coefficient of the product without fully scanning all coefficients of the multiplicands. But for leading or trailing coefficients, the simple fact that you"ve converted the multiplicands to lists already means that you've ruined any possibility of efficiency. To be efficient, the algorithm must only access the necessary coefficients of the multiplicands. 

I agree that it would be useful to have an efficient stock method under modp1 to compute the first leading or trailing coefficients of a polynomial multiplication. An algorithm to do this is straightforward and elementary. It may be possible to implement this using only Maple-level code (meaning no need to touch compiled code), so one of us may be able to do this.

@vv Unfortunately, there are a few structures whose constructors have names that are different from their zeroeth operand. The zeroeth operand of a set is set, but the constructor is `{}`. This is an oversight because the only reasonable reason to use op(0, expr) as a function prefix is to access the constructor. What would be the point of avoiding a large set by returning an even larger function? 

Surely this is a bug in Grid. The set(...appears to be an "escaped" internal intermediary format used before conversion to an ordinary Maple set. It's hard to imagine any good reason that it was programmed like this even if it worked correctly. It seems like a huge waste of memory that could make it impossible for Grid:-Map to return the multi-million-element sets of lists of tuples that you require.

By the way,  CodeTools:-Usage, when applied to a Grid command, doesn't return meaningful numbers, except possibly for the real time. The other numbers only apply to the master process.

 

@nm The command-line options are documented on help page ?maple. I don't have access to a computer at the moment, so I can't check whether standalone is mentioned there.

@coopersj In addition to Tom's cabbages example, I'd guess that LinearAlgebra is more commonly used for error computations where the infinity norm is most appropriate.

You can change the default, like this:

origNorm:= eval(LinearAlgebra:-Norm):
unprotect(LinearAlgebra:-Norm):
LinearAlgebra:-Norm:= proc(v, p:= 2) origNorm(v, p) end proc:
protect(LinearAlgebra:-Norm, origNorm);

LinearAlgebra:-Norm(<3,4>);
                               5

Something like this could be put into an initialization file.

@Muhammad Usman If it's known that the integrals are always 0 or Pi^(-3/2), then crude numeric integration at 1-digit precision can distinguish those cases. One of the "Cuba" methods of numeric integration could be used.

@dim____ Make sure that you're using rhs~ instead of plain rhs.

@Carl Love The answer above uses features introduced in Maple 2019. The following is almost as short, and will work in older Maple:

P:= [0,0]: R:= rand(1..4): 
plot(ListTools:-PartialSums([P, seq([[-1,0],[1,0],[0,-1],[0,1]][R()], 1..10000)]));

 

@acer I agree: When style= pointline is used with a function rather than a discrete set of points, the number of points shown should be much fewer than the number of used for the line.

@MapleEnthusiast Multiplying the pseudo-inverse by the right-side vector gives you only one of the infinitude of solutions. This may be the reason for your "disconnect". I believe (not sure) that it gives a solution of minimal 2-norm.

@Kitonum Yes, certainly your first version is easier to understand than mine. (My primary motivation is usually avoiding repetition.) Your second version is fine for a very smooth curve, as shown, but probably not so great for a less smooth curve. 

@Joe Riel Vote up. I've used the types And(specfunc(...), patfunc(..)) and And(typefunc(...), patfunc(...)) so many times that I wonder why there's not a predefined single type that does it.

@imparter Like this:

plots:-display(
    map(
        L-> plot(sin(x), x= -Pi..Pi, L[]),
        [[linestyle= solid],
         [style= point, symbol= box, numpoints= 16, adaptive= false]
        ]
    )
);

First 156 157 158 159 160 161 162 Last Page 158 of 708