boost::shared_ptr<tmv::Matrix<std::complex<double> > > LVector::kBasis( const tmv::ConstVectorView<double>& kx, const tmv::ConstVectorView<double>& ky, int order, double sigma) { assert (ky.size() == kx.size()); const int ndof=PQIndex::size(order); const int npts = kx.size(); boost::shared_ptr<tmv::Matrix<std::complex<double> > > psi_k( new tmv::Matrix<std::complex<double> >(npts, ndof, 0.)); kBasis(kx,ky,psi_k->view(),order,sigma); return psi_k; }
void SBShapelet::SBShapeletImpl::fillKValue( tmv::MatrixView<std::complex<double> > val, const tmv::Matrix<double>& kx, const tmv::Matrix<double>& ky) const { dbg<<"order = "<<_bvec.getOrder()<<", sigma = "<<_sigma<<std::endl; xdbg<<"fillKValue with bvec = "<<_bvec<<std::endl; assert(val.stepi() == 1); assert(val.canLinearize()); const int m = val.colsize(); const int n = val.rowsize(); tmv::Matrix<std::complex<double> > psi_k(m*n,_bvec.size()); LVector::kBasis(kx.constLinearView(),ky.constLinearView(),psi_k.view(), _bvec.getOrder(),_sigma); // Note: the explicit cast to Vector<complex<double> > shouldn't be necessary. // But not doing so fails for Apple's default BLAS library. It should be a pretty // minimal efficiency difference, so we always do the explicit cast to be safe. val.linearView() = psi_k * tmv::Vector<std::complex<double> >(_bvec.rVector()); }