- #1
ramsey2879
- 841
- 3
In:list5 = Import["Composites.csv"]; (*imports a list of odd integers each less than 1000000*)
Timing[f=Compile[{{Caa,_Integer},{S0,_Integer},{S1,_Integer},{Co,_Integer}},
Module[{xCo=Co,xS0=S0,xS1=S1,Temp},While[Temp=Mod[6 xS1-xS0-6,Caa];xCo>0&&Temp>=1,
xS0=xS1;xS1=Temp;xCo--];
xCo]];
count = Length[list5];
list3=Reap[While[count>0,
Caa= list5[[count]];Sow[Caa];Co=Round[(Caa-2)/2];S0=2;S1=3;
So = f[Caa,S0,S1,Co]; Sow[So];
count--]]]
results in red msg:
{3827} in position 1 should be a machine size Integer,
{13067} in position 1 should be a machine size Integer, etc
These are integers from the imported list. I am at loss as how to correct this error. Please help.
PS when I switched the positions of Caa and Co in the compiled function, I get in red {1913} in position 1 should be a machine sized integer, etc.
Timing[f=Compile[{{Caa,_Integer},{S0,_Integer},{S1,_Integer},{Co,_Integer}},
Module[{xCo=Co,xS0=S0,xS1=S1,Temp},While[Temp=Mod[6 xS1-xS0-6,Caa];xCo>0&&Temp>=1,
xS0=xS1;xS1=Temp;xCo--];
xCo]];
count = Length[list5];
list3=Reap[While[count>0,
Caa= list5[[count]];Sow[Caa];Co=Round[(Caa-2)/2];S0=2;S1=3;
So = f[Caa,S0,S1,Co]; Sow[So];
count--]]]
results in red msg:
{3827} in position 1 should be a machine size Integer,
{13067} in position 1 should be a machine size Integer, etc
These are integers from the imported list. I am at loss as how to correct this error. Please help.
PS when I switched the positions of Caa and Co in the compiled function, I get in red {1913} in position 1 should be a machine sized integer, etc.