Commit ee305b1e authored by Pratyuksh Bansal's avatar Pratyuksh Bansal

Bugs fixed

parent 96e079fa
......@@ -75,11 +75,11 @@ void pmconv(const Eigen::MatrixBase<Scalar1> &X,const Eigen::MatrixBase<Scalar2>
const idx_t n=X.cols(),m=X.rows();
if ((m!=Y.rows()) || (n!=Y.cols())) throw std::runtime_error("pmconv: size mismatch");
Z.resize(m,n); Eigen::MatrixXcd Xh(m,n),Yh(m,n);
// Step \ding{202}: inverse 2D DFT of \Blue{$\overline{\VY}$}
ifft2(Yh,(Y.template cast<Comp>()).conjugate());
// Step \ding{202}: 2D DFT of \Blue{$\VY$}
fft2(Yh,(Y.template cast<Comp>()));
// Step \ding{203}: 2D DFT of \Blue{$\VX$}
fft2(Xh,(X.template cast<Comp>()));
// Steps \ding{204}, \ding{205}: inverse DFT of component-wise product
ifft2(Z,(m*n)*Xh.cwiseProduct(Yh.conjugate()));
ifft2(Z,Xh.cwiseProduct(Yh));
}
/* SAM_LISTING_END_3 */
......@@ -40,7 +40,7 @@ VectorXd chebexp(const VectorXd& y) {
for (unsigned j = 0; j < c.size(); ++j)
beta(j) = ( std::exp(sc*double(-n+j))*c[j] ).real();
// recover \Blue{$\alpha_j$}, see \eqref{eq:tpdft}
VectorXd alpha = 2*beta.tail(n); alpha(0) = beta(n);
VectorXd alpha = 2*beta.segment(n,n); alpha(0) = beta(n);
return alpha;
}
/* SAM_LISTING_END_0 */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment