# When to use Compile

I am new to Mathematica and have a general question:

Working with matrices I have the impression that Compile can only be used if the elements of a matrix are ONLY Integers or ONLY Reals. No mixed types are allowed.

But my matrices generally include some missing elements like

m = {{1., 2.}, {Null, 3.}}


Is there a way to compile m*m ?

-
Please note that matrix operations are in general very very fast in Mathematica without using Compile. In fact, it is easily possible that you slow something down. Try to use built-in functions first. Your observation about the types is correct. Compile can only handle tensors of one type.. either Real, Integer, ... but mixed types are not possible. The m you use is not even compilable! –  halirutan May 9 '14 at 22:51
@halirutan - thanks, your answer spared me a lot of trials and errors –  eldo May 10 '14 at 11:22