////////////////////////////////////////////////////////////////////// // compute the 2 norm ////////////////////////////////////////////////////////////////////// Real operator^(const VECTOR& x, const VECTOR& y) { assert(x.size() == y.size()); #if __APPLE__ #ifdef SINGLE_PRECISION return cblas_sdot (x.size(), x.dataConst(), 1, y.dataConst(), 1); #else return cblas_ddot (x.size(), x.dataConst(), 1, y.dataConst(), 1); #endif #else return x * y; #endif }