aboutsummaryrefslogtreecommitdiffhomepage
path: root/demos
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-07-08 07:56:01 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-07-08 07:56:01 +0000
commit6f09d3a67d333d68e7c971147ec77600e86e93f3 (patch)
tree36095d2bb12c0b02b9688775f60ee5531d2b0372 /demos
parentf5791eeb7054b78ded6eb080e9712651da6c6a34 (diff)
- many updates after Cwise change
- fix compilation in product.cpp with std::complex - fix bug in MatrixBase::operator!=
Diffstat (limited to 'demos')
-rw-r--r--demos/mandelbrot/mandelbrot.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/demos/mandelbrot/mandelbrot.cpp b/demos/mandelbrot/mandelbrot.cpp
index 2aaeab1e5..c363b4543 100644
--- a/demos/mandelbrot/mandelbrot.cpp
+++ b/demos/mandelbrot/mandelbrot.cpp
@@ -87,13 +87,13 @@ template<typename Real> void MandelbrotThread::render(int img_width, int img_hei
{
# define ITERATE \
pzr_buf = pzr; \
- pzr = pzr.cwiseAbs2() - pzi.cwiseAbs2() + pcr; \
- pzi = 2 * pzr_buf.cwiseProduct(pzi) + pci;
+ pzr = pzr.cwise().square() - pzi.cwise().square() + pcr; \
+ pzi = (2*pzr_buf).cwise()*pzi + pci;
ITERATE ITERATE ITERATE ITERATE
}
- pix_dont_diverge = (pzr.cwiseAbs2() + pzi.cwiseAbs2())
+ pix_dont_diverge = ((pzr.cwise().square() + pzi.cwise().square())
.eval() // temporary fix as what follows is not yet vectorized by Eigen
- .cwiseLessThan(Packet::constant(4))
+ .cwise() <= Packet::constant(4))
// the 4 here is not a magic value, it's a math fact that if
// the square modulus is >4 then divergence is inevitable.
.template cast<int>();