Get some numerical linear algebra lib.

I think you might like Eigen:

Eigen: Main Page
A short ASCII reference with Matlab translations:

http://eigen.tuxfamily.org/dox-devel/AsciiQuickReference.txt
Active and helpful community forum:

Eigen • KDE Community Forums
Blaze is perhaps worth looking into:

Google Code Archive - Long-term storage for Google Code Project Hosting.
Note that preferably you want to focus on the libraries that beat (or at least match up to) Intel MKL, since that's what MATLAB's relying on for its vectorized operations (of course you're going to easily beat it for the non-vectorized ones, but why settle for less), and it seems sub-optimal to use anything slower; that's also the reason I'm suggesting either Eigen or Blaze:

Benchmark - Eigen
Google Code Archive - Long-term storage for Google Code Project Hosting.
// From the above benchmarks, the Armadillo+MKL combination doesn't look bad either, but note that you

*must* get an external BLAS lib (like MKL), otherwise Armadillo is not going to be very useful or fast (it takes a different design approach, relying on an external optimized BLAS instead of providing optimized numerical linear algebra implementation itself -- discussing the relative merits & trade-offs is beyond the scope of this post, but be aware that what it means for the end-user (you) is that you need to get it separately & set it up):

Armadillo: C++ library for linear algebra & scientific computing
From what I can tell, the same is true for Blaze:

"Additionally, for maximum performance Blaze expects you to have a BLAS library installed (

Intel MKL,

ACML,

Atlas,

Goto, ...). If you don't have a BLAS library installed on your system, Blaze will still work and will not be reduced in functionality, but performance may be severely limited. Thus it is strongly recommended to install a BLAS library."

Google Code Archive - Long-term storage for Google Code Project Hosting.
In contrast, Eigen is a standalone library, highly competitive with MKL on its own.

For more choices, see this thread:

http://www.wilmott.com/messageview.cfm?catid=44&threadid=87551
It's worth mentioning that recently the Numerical Template Toolbox (NT²) has restarted its development:

http://github.com/MetaScale/nt2
It's interesting, since "provide a simple, MATLAB-like interface for users" is one of the guiding goals.

For instance, it supports select-all-rows/columns operator (colon in MATLAB, underscore in NT2) and vectorized functions:

```
MATLAB: B = I(:,:,3); ...; V = min(abs(0.5.*R-0.419.*G-0.081.*B),240);
C++ w/NT2: B = I(_,_,3); ...; V = min(abs(0.5*R-0.419*G-0.081*B),240);
```

Presentation:

[PDF]

https://github.com/boostcon/2010_presentations/raw/master/thu/falcou_lapreste_boostcon.pdf
[Video]

http://blip.tv/boostcon/joel-falcou-jean-thierry-lapreste-the-numerical-template-toolbox-boost-ed-generic-array-library-for-high-performance-computing-4204932
However, it's a relatively new (revision of the) library under active development, so for starters you may want to consider one of the aforementioned ones at first.