I have some sample code:
data1 = {{1, 2, 9}, {4, 5, 6}, {2, 5, 6}};
data2 = {{1, 2, "bob"}, {4, 5, 6}, {2, 5, 6}};
testfn1 = Compile[{{n, _Integer}}, Select[data1, #[[2]] == n &]]
testfn2 = Compile[{{n, _Integer}}, Select[data2, #[[2]] == n &]]
The only difference between data1 and data2 is that the latter has a string element "bob". testfn1 and testfn2 simply splice the matrix.
In[904]:= testfn1[5]
Out[904]= {{4, 5, 6}, {2, 5, 6}}
The above code works fine. However:
In[905]:= testfn2[5]
During evaluation of In[905]:= CompiledFunction::cfte: Compiled expression {{1,2,bob},{4,5,6},{2,5,6}} should be a rank 2 tensor of machine-size real numbers. >>
During evaluation of In[905]:= CompiledFunction::cfex: Could not complete external evaluation at instruction 3; proceeding with uncompiled evaluation. >>
Out[905]= {{4, 5, 6}, {2, 5, 6}}
Why does data2 have to only have Real elements?
Thanks!