Skip to content

Commit

Permalink
fix c++11 compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
Soeren Sonnenburg committed Jul 23, 2013
1 parent 68cbe6a commit 36595b2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/mathematics/logdet/DenseMatrixOperator_unittest.cc
Expand Up @@ -93,7 +93,13 @@ TEST(DenseMatrixOperator, shift_apply)
CDenseMatrixOperator<complex64_t, float64_t> op(m);
SGVector<complex64_t> diag=op.get_diagonal();
for (index_t i=0; i<diag.vlen; ++i)
{
#ifdef HAVE_CXX11
diag[i].imag(diag[i].imag()-0.75);
#else
diag[i].imag()-=0.75;
#endif
}
op.set_diagonal(diag);

SGVector<complex64_t> r1=op.apply(b);
Expand All @@ -102,7 +108,13 @@ TEST(DenseMatrixOperator, shift_apply)
// shifting the diagonal directly via matrix
m.set_const(complex64_t(0.5, 0.0));
for (index_t i=0; i<size; ++i)
{
#ifdef HAVE_CXX11
m(i,i).imag(m(i,i).imag()-0.75);
#else
m(i,i).imag()-=0.75;
#endif
}

SGVector<complex64_t> r2=op.apply(b);
Map<VectorXcd> map_r2(r2.vector, r2.vlen);
Expand Down

0 comments on commit 36595b2

Please sign in to comment.