-
-
Notifications
You must be signed in to change notification settings - Fork 205
Closed
Labels
Description
In Combinatorica 2.0 there are a few compiled modules, and none of them can get compiled.
Here is an example:
RP = Compile[{{n, _Integer}},
Module[{p = Range[n],i,x,t},
Do [x = Random[Integer,{1,i}];
t = p[[i]]; p[[i]] = p[[x]]; p[[x]] = t,
{i,n,2,-1}
];
p
]
]
The error message we get back is:
Compile::comperr: Expression Module[{p = Range[n], i, x, t}, Do[x = Random[Integer, {1, i}] ; t = p[[i]] ; p[[i]] = p[[x]] ; p[[x]] = t, {i, n, 2, -1}] ; p] could not be compiled.
A "could not be compiled" message occurs for all of them, so I suspect this is more about Expression Modules than it is about the construct inside that needs compiling.
By the way, what would be a workaround for this?