Alec Mihailovs

Dr. Aleksandrs Mihailovs

4495 Reputation

21 Badges

20 years, 343 days
Mihailovs, Inc.
Owner, President, and CEO
Tyngsboro, Massachusetts, United States

Social Networks and Content at Maplesoft.com

Maple Application Center

I received my Ph.D. from the University of Pennsylvania in 1998 and I have been teaching since then at SUNY Oneonta for 1 year, at Shepherd University for 5 years, at Tennessee Tech for 2 years, at Lane College for 1 year, and this year I taught at the University of Massachusetts Lowell. My research interests include Representation Theory and Combinatorics.

MaplePrimes Activity


These are replies submitted by Alec Mihailovs

I don't know a good solution for Standard. I use it mainly for graphics - especially with transparency and other effects that are not available in Classic. Is it actually possible to use it for some calculations?

Alec

I don't know a good solution for Standard. I use it mainly for graphics - especially with transparency and other effects that are not available in Classic. Is it actually possible to use it for some calculations?

Alec

In English, the standard term is "bump".

Alec

In English, the standard term is "bump".

Alec

I have an example of using Watcom compiler supplied with Maple for creating a dll and using it from Maple, in my old blog post, Mktime.

Recently I added an example of writing a dll in C++ and using it in Maple as a comment in Joe Riel's blog, Faster Permutations.

Alec

Alejandro Jakubi showed how to do that in his comment in another thread,

That can be also done as

eval(sol,_F1=curry(`/`,1));
                                       3
                    F(x, y) = (y - 2 x)  (y + 2 x)

Alec

Alejandro Jakubi showed how to do that in his comment in another thread,

That can be also done as

eval(sol,_F1=curry(`/`,1));
                                       3
                    F(x, y) = (y - 2 x)  (y + 2 x)

Alec

I just compared it with next_permutation from STL, and Permute is more than 3 times faster!

Here are the details. First, I made a permute.dll from the cpp file with the following code,

#include <algorithm>
using namespace std;

__declspec(dllexport) BOOL np(int *a, int n){
    return next_permutation(a,a+n);}

Then, in Maple,

next_permutation:=define_external(
'`?np@@YGHPAHH@Z`',
'a'::ARRAY(datatype=integer[4]),
'n'::integer[4],
'RETURN'::boolean[4],
'LIB'="permute.dll"):

First check that it is working,

A:=Array([1,2,3],datatype=integer[4]);

                            A := [1, 2, 3]
next_permutation(A,3);
                                 true
A;
                              [1, 3, 2]

Now, time comparison

N := 10:
P := Permute(N):
time(proc() while not P:-finished() do P:-nextvalue() end do end proc());

                                27.346

A:=Array([$1..10],datatype=integer[4]);

                 A := [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

time(proc() while next_permutation(A,10) do od end());

                                90.801

As I said already, fantastic!

Alec

Also works OK,

Alec

Also works OK,

Alec

That was a very interesting discussion.

I hope there will be more like that.

Alec

That was a very interesting discussion.

I hope there will be more like that.

Alec

Nice pictures, by the way. I tried to find parameters giving nicer pictures, but that wasn't easy. By the way, the manual rotation (in the last plot, for instance), can be replaced with adding orientation = [-90,0] in the plot3d command. Some other changes that can be done can be found in ?plot3d,options .

Alec

Nice pictures, by the way. I tried to find parameters giving nicer pictures, but that wasn't easy. By the way, the manual rotation (in the last plot, for instance), can be replaced with adding orientation = [-90,0] in the plot3d command. Some other changes that can be done can be found in ?plot3d,options .

Alec

if you look at

showstat(`convert/string`);

you'll see that it is the same as sprintf (just with fixed format "%a" that is the most used anyway.)

Alec

First 124 125 126 127 128 129 130 Last Page 126 of 180