Carl Love

Carl Love

28115 Reputation

25 Badges

13 years, 161 days
Himself
Wayland, Massachusetts, United States
My name was formerly Carl Devore.

MaplePrimes Activity


These are replies submitted by Carl Love

If we add a prettyprinting procedure to Markiyan's code, we can get output that looks more like the original formula without altering any of the computational aspects:

`print/binomial`:= (n,k)-> 'C'[n]^k:

theo(a1,a2,N1,N2);

Since expressions are assumed to be equated to 0 by solve, and since the solution variables are assumed to be all the indeterminates, you could simply do

solve(map(coeffs, {f,g}, [x,y]));

Since expressions are assumed to be equated to 0 by solve, and since the solution variables are assumed to be all the indeterminates, you could simply do

solve(map(coeffs, {f,g}, [x,y]));

@casperyc Actually, having just run both NullSpace(GaussianElimination(M)) and NullSpace(M), I see no benefit to the preliminary step.

@casperyc Actually, having just run both NullSpace(GaussianElimination(M)) and NullSpace(M), I see no benefit to the preliminary step.

@PatrickT wrote:

The use of thisproc inside subsindets is very neat.

At first it seems recursive, but essentially it is not: The recursive call can only ever proceed one step. You could just as well write the procedure like below. This is probably a little faster, and is how I would've written it were I not working from your code. This also avoids the redundancy of rebuilding the format for each float.

Round3:= proc(x, n::nonnegint:= 1)
local format:= cat("%.", n, "f");
     subsindets(x, float, f-> parse(sprintf(format, f)))
end proc;

@PatrickT wrote:

The use of thisproc inside subsindets is very neat.

At first it seems recursive, but essentially it is not: The recursive call can only ever proceed one step. You could just as well write the procedure like below. This is probably a little faster, and is how I would've written it were I not working from your code. This also avoids the redundancy of rebuilding the format for each float.

Round3:= proc(x, n::nonnegint:= 1)
local format:= cat("%.", n, "f");
     subsindets(x, float, f-> parse(sprintf(format, f)))
end proc;

@Markiyan Hirnyk I (or my guess at least) stand corrected. You should make it an Answer so that I can vote up. I wonder why the intermediate step of GaussianElimination makes a difference. I would think that NullSpace would do that anyway.

@Markiyan Hirnyk I (or my guess at least) stand corrected. You should make it an Answer so that I can vote up. I wonder why the intermediate step of GaussianElimination makes a difference. I would think that NullSpace would do that anyway.

I think that "somewhat complicated" is an understatement. Your C5 is a dense 6 x 12 Matrix of "somewhat dense" polynomials in 12 variables. I guess (just guessing here) that this is well beyond the capability of any computer or CAS currently in existence.

I got an error trying to load your C4. The code to generate the matrices seems missing.

Briefly, this issue in handled by the output= permutation option to sort in Maple 17. I see from your header that you are using Maple 15. In that case you can do something like this:

Original list:
L:= [2,4,5,0,-1];
                        [2, 4, 5, 0, -1]
Pair each element with its index number:
L1:= [seq]([L[i],i], i= 1..nops(L));
           [[2, 1], [4, 2], [5, 3], [0, 4], [-1, 5]]
sort(L1);
           [[-1, 5], [0, 4], [2, 1], [4, 2], [5, 3]]

Briefly, this issue in handled by the output= permutation option to sort in Maple 17. I see from your header that you are using Maple 15. In that case you can do something like this:

Original list:
L:= [2,4,5,0,-1];
                        [2, 4, 5, 0, -1]
Pair each element with its index number:
L1:= [seq]([L[i],i], i= 1..nops(L));
           [[2, 1], [4, 2], [5, 3], [0, 4], [-1, 5]]
sort(L1);
           [[-1, 5], [0, 4], [2, 1], [4, 2], [5, 3]]

@somayeh Please repost this as a new Question. Also, show a little of the code for how you obtained the vector before you sorted it. It looks like it may actually be a list rather than a Vector.

@somayeh Please repost this as a new Question. Also, show a little of the code for how you obtained the vector before you sorted it. It looks like it may actually be a list rather than a Vector.

@Markiyan Hirnyk "Compromise" has a second definition different from the one used in that Wikipedia article. I see that that secondary meaning is absent from many of the online dictionaries. The secondary definition is "2. Something that combines qualities or elements of different things" from www.thefreedictionary.com or "1b : something intermediate between or blending qualities of two different things" from www.merriam-webster.com/dictionary . I meant the blending of the ideas of high density and low degree, one of which makes the polynomials larger while the other makes them smaller.

First 630 631 632 633 634 635 636 Last Page 632 of 710