roman_pearce

Mr. Roman Pearce

1688 Reputation

19 Badges

20 years, 76 days
CECM/SFU
Research Associate
Abbotsford, British Columbia, Canada

I am a research associate at Simon Fraser University and a member of the Computer Algebra Group at the CECM.

MaplePrimes Activity


These are questions asked by roman_pearce

What is the fastest code for integer dot product in Maple ? I am currently using the inner command, however there seems to be a lot of overhead. It is easily slaughtered by GMP. I was wondering if there is a dedicated external routine or something else that I can call ? I want to avoid linking in a C library just for this. On a related note, I think Maplesoft should develop a companion to the LinearAlgebra:-Modular package that supports fast operations with dense integer matrices in compiled code. I know the LinBox library supports this, maybe it could be linked in ? I actually don't
I have a large set and I would like to do the following efficiently: 1) use selectremove to split off a part of the set, based on a function f 2) map a function g onto the selected set 3) (optional) map a function h onto the removed set I don't actually need 3) however I think it would be useful. My problem is that the function g is easily computed while computing f, so something like the following is 2x too slow:
S, R := selectremove(f, big_set);
S := map(g, S);
On the other hand, g outputs a result of a different type, so I can code g to return the identity unless the condition in f is satisfied:
I am using OpenMaple (kv->rtableCreate or RTableCreate) to allocate large rtables which I then fill with data before returning to Maple. It seems to be slow. For example, a table with 120 Mwords takes 1 second to allocate and 0.640 seconds to fill. I suspect this is because the table is initialized to zero. I would like to skip this initialization and maybe use malloc to allocate the table, however I want it to behave like a normal Maple object (ie: garbage collected if not referenced, etc). The documentation says it is important to set rts->foreign to true, but it doesn't say why. Will this prevent garbage collection ? I would also like to know the purpose of rts->foreign.
Maple needs commands to interpolate and plot large data sets. Consider the following:
# generate data
data := convert(LinearAlgebra[RandomMatrix](10000,2,generator=-100000..100000),listlist):
data := sort(map([op], [op(op(table(map(`=`@op, data))))]), (a,b)->evalb(a[1] < b[1])):
data := Matrix(map(proc(a) [a[1],a[2]/200.] end,data), datatype=float[8]):

# now suppose I take this data and...
f := CurveFitting[BSplineCurve](data, x);
plot(f, 0..100);
Someone trying to do this with real data (and 10000 points is small) will experience the following problems:
Maple needs proper sparse linear algebra. That means a data structure where row or column operations (good luck getting both) can be done in linear time and algorithms such as structured Gaussian elimination or iterative methods run in O(A) time, where A is the number of non-zero elements in the matrix.
1 2 3 Page 2 of 3