Replace assert with eigen_assert.

This commit is contained in:
Antonio Sánchez 2022-10-04 17:11:23 +00:00 committed by Rasmus Munk Larsen
parent 7d6a9925cc
commit e5794873cb
14 changed files with 65 additions and 65 deletions

View File

@ -273,7 +273,7 @@ class BandMatrixWrapper : public BandMatrixBase<BandMatrixWrapper<CoefficientsTy
m_rows(rows), m_supers(supers), m_subs(subs) m_rows(rows), m_supers(supers), m_subs(subs)
{ {
EIGEN_UNUSED_VARIABLE(cols); EIGEN_UNUSED_VARIABLE(cols);
//internal::assert(coeffs.cols()==cols() && (supers()+subs()+1)==coeffs.rows()); // eigen_assert(coeffs.cols()==cols() && (supers()+subs()+1)==coeffs.rows());
} }
/** \returns the number of columns */ /** \returns the number of columns */

View File

@ -1836,7 +1836,7 @@ template <>
EIGEN_STRONG_INLINE Packet16f pblend(const Selector<16>& /*ifPacket*/, EIGEN_STRONG_INLINE Packet16f pblend(const Selector<16>& /*ifPacket*/,
const Packet16f& /*thenPacket*/, const Packet16f& /*thenPacket*/,
const Packet16f& /*elsePacket*/) { const Packet16f& /*elsePacket*/) {
assert(false && "To be implemented"); eigen_assert(false && "To be implemented");
return Packet16f(); return Packet16f();
} }
template <> template <>

View File

@ -594,9 +594,9 @@ void BDCSVD<MatrixType, Options>::divide(Index firstCol, Index lastCol, Index fi
} }
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(m_naiveU.allFinite()); eigen_internal_assert(m_naiveU.allFinite());
assert(m_naiveV.allFinite()); eigen_internal_assert(m_naiveV.allFinite());
assert(m_computed.allFinite()); eigen_internal_assert(m_computed.allFinite());
#endif #endif
if (m_compU) if (m_compU)
@ -633,9 +633,9 @@ void BDCSVD<MatrixType, Options>::divide(Index firstCol, Index lastCol, Index fi
} }
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(m_naiveU.allFinite()); eigen_internal_assert(m_naiveU.allFinite());
assert(m_naiveV.allFinite()); eigen_internal_assert(m_naiveV.allFinite());
assert(m_computed.allFinite()); eigen_internal_assert(m_computed.allFinite());
#endif #endif
m_computed(firstCol + shift, firstCol + shift) = r0; m_computed(firstCol + shift, firstCol + shift) = r0;
@ -654,9 +654,9 @@ void BDCSVD<MatrixType, Options>::divide(Index firstCol, Index lastCol, Index fi
std::cout << "err: " << ((tmp1-tmp2).abs()>1e-12*tmp2.abs()).transpose() << "\n"; std::cout << "err: " << ((tmp1-tmp2).abs()>1e-12*tmp2.abs()).transpose() << "\n";
static int count = 0; static int count = 0;
std::cout << "# " << ++count << "\n\n"; std::cout << "# " << ++count << "\n\n";
assert((tmp1-tmp2).matrix().norm() < 1e-14*tmp2.matrix().norm()); eigen_internal_assert((tmp1-tmp2).matrix().norm() < 1e-14*tmp2.matrix().norm());
// assert(count<681); // eigen_internal_assert(count<681);
// assert(((tmp1-tmp2).abs()<1e-13*tmp2.abs()).all()); // eigen_internal_assert(((tmp1-tmp2).abs()<1e-13*tmp2.abs()).all());
#endif #endif
// Third part: compute SVD of combined matrix // Third part: compute SVD of combined matrix
@ -665,8 +665,8 @@ void BDCSVD<MatrixType, Options>::divide(Index firstCol, Index lastCol, Index fi
computeSVDofM(firstCol + shift, n, UofSVD, singVals, VofSVD); computeSVDofM(firstCol + shift, n, UofSVD, singVals, VofSVD);
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(UofSVD.allFinite()); eigen_internal_assert(UofSVD.allFinite());
assert(VofSVD.allFinite()); eigen_internal_assert(VofSVD.allFinite());
#endif #endif
if (m_compU) if (m_compU)
@ -681,9 +681,9 @@ void BDCSVD<MatrixType, Options>::divide(Index firstCol, Index lastCol, Index fi
if (m_compV) structured_update(m_naiveV.block(firstRowW, firstColW, n, n), VofSVD, (n+1)/2); if (m_compV) structured_update(m_naiveV.block(firstRowW, firstColW, n, n), VofSVD, (n+1)/2);
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(m_naiveU.allFinite()); eigen_internal_assert(m_naiveU.allFinite());
assert(m_naiveV.allFinite()); eigen_internal_assert(m_naiveV.allFinite());
assert(m_computed.allFinite()); eigen_internal_assert(m_computed.allFinite());
#endif #endif
m_computed.block(firstCol + shift, firstCol + shift, n, n).setZero(); m_computed.block(firstCol + shift, firstCol + shift, n, n).setZero();
@ -754,16 +754,16 @@ void BDCSVD<MatrixType, Options>::computeSVDofM(Index firstCol, Index n, MatrixX
{ {
std::cout << "\n\n mus: " << mus.head(actual_n).transpose() << "\n\n"; std::cout << "\n\n mus: " << mus.head(actual_n).transpose() << "\n\n";
std::cout << " check1 (expect0) : " << ((singVals.array()-(shifts+mus)) / singVals.array()).head(actual_n).transpose() << "\n\n"; std::cout << " check1 (expect0) : " << ((singVals.array()-(shifts+mus)) / singVals.array()).head(actual_n).transpose() << "\n\n";
assert((((singVals.array()-(shifts+mus)) / singVals.array()).head(actual_n) >= 0).all()); eigen_internal_assert((((singVals.array()-(shifts+mus)) / singVals.array()).head(actual_n) >= 0).all());
std::cout << " check2 (>0) : " << ((singVals.array()-diag) / singVals.array()).head(actual_n).transpose() << "\n\n"; std::cout << " check2 (>0) : " << ((singVals.array()-diag) / singVals.array()).head(actual_n).transpose() << "\n\n";
assert((((singVals.array()-diag) / singVals.array()).head(actual_n) >= 0).all()); eigen_internal_assert((((singVals.array()-diag) / singVals.array()).head(actual_n) >= 0).all());
} }
#endif #endif
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(singVals.allFinite()); eigen_internal_assert(singVals.allFinite());
assert(mus.allFinite()); eigen_internal_assert(mus.allFinite());
assert(shifts.allFinite()); eigen_internal_assert(shifts.allFinite());
#endif #endif
// Compute zhat // Compute zhat
@ -773,7 +773,7 @@ void BDCSVD<MatrixType, Options>::computeSVDofM(Index firstCol, Index n, MatrixX
#endif #endif
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(zhat.allFinite()); eigen_internal_assert(zhat.allFinite());
#endif #endif
computeSingVecs(zhat, diag, perm, singVals, shifts, mus, U, V); computeSingVecs(zhat, diag, perm, singVals, shifts, mus, U, V);
@ -784,13 +784,13 @@ void BDCSVD<MatrixType, Options>::computeSVDofM(Index firstCol, Index n, MatrixX
#endif #endif
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(m_naiveU.allFinite()); eigen_internal_assert(m_naiveU.allFinite());
assert(m_naiveV.allFinite()); eigen_internal_assert(m_naiveV.allFinite());
assert(m_computed.allFinite()); eigen_internal_assert(m_computed.allFinite());
assert(U.allFinite()); eigen_internal_assert(U.allFinite());
assert(V.allFinite()); eigen_internal_assert(V.allFinite());
// assert((U.transpose() * U - MatrixXr(MatrixXr::Identity(U.cols(),U.cols()))).norm() < 100*NumTraits<RealScalar>::epsilon() * n); // eigen_internal_assert((U.transpose() * U - MatrixXr(MatrixXr::Identity(U.cols(),U.cols()))).norm() < 100*NumTraits<RealScalar>::epsilon() * n);
// assert((V.transpose() * V - MatrixXr(MatrixXr::Identity(V.cols(),V.cols()))).norm() < 100*NumTraits<RealScalar>::epsilon() * n); // eigen_internal_assert((V.transpose() * V - MatrixXr(MatrixXr::Identity(V.cols(),V.cols()))).norm() < 100*NumTraits<RealScalar>::epsilon() * n);
#endif #endif
// Because of deflation, the singular values might not be completely sorted. // Because of deflation, the singular values might not be completely sorted.
@ -811,7 +811,7 @@ void BDCSVD<MatrixType, Options>::computeSVDofM(Index firstCol, Index n, MatrixX
bool singular_values_sorted = (((singVals.segment(1,actual_n-1)-singVals.head(actual_n-1))).array() >= 0).all(); bool singular_values_sorted = (((singVals.segment(1,actual_n-1)-singVals.head(actual_n-1))).array() >= 0).all();
if(!singular_values_sorted) if(!singular_values_sorted)
std::cout << "Singular values are not sorted: " << singVals.segment(1,actual_n).transpose() << "\n"; std::cout << "Singular values are not sorted: " << singVals.segment(1,actual_n).transpose() << "\n";
assert(singular_values_sorted); eigen_internal_assert(singular_values_sorted);
} }
#endif #endif
@ -966,7 +966,7 @@ void BDCSVD<MatrixType, Options>::computeSingVals(const ArrayRef& col0, const Ar
RealScalar fZero = secularEq(muZero, col0, diag, perm, diagShifted, shift); RealScalar fZero = secularEq(muZero, col0, diag, perm, diagShifted, shift);
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert((numext::isfinite)(fZero)); eigen_internal_assert((numext::isfinite)(fZero));
#endif #endif
muPrev = muCur; muPrev = muCur;
@ -1019,11 +1019,11 @@ void BDCSVD<MatrixType, Options>::computeSingVals(const ArrayRef& col0, const Ar
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
if(!(numext::isfinite)(fLeft)) if(!(numext::isfinite)(fLeft))
std::cout << "f(" << leftShifted << ") =" << fLeft << " ; " << left << " " << shift << " " << right << "\n"; std::cout << "f(" << leftShifted << ") =" << fLeft << " ; " << left << " " << shift << " " << right << "\n";
assert((numext::isfinite)(fLeft)); eigen_internal_assert((numext::isfinite)(fLeft));
if(!(numext::isfinite)(fRight)) if(!(numext::isfinite)(fRight))
std::cout << "f(" << rightShifted << ") =" << fRight << " ; " << left << " " << shift << " " << right << "\n"; std::cout << "f(" << rightShifted << ") =" << fRight << " ; " << left << " " << shift << " " << right << "\n";
// assert((numext::isfinite)(fRight)); // eigen_internal_assert((numext::isfinite)(fRight));
#endif #endif
#ifdef EIGEN_BDCSVD_DEBUG_VERBOSE #ifdef EIGEN_BDCSVD_DEBUG_VERBOSE
@ -1081,8 +1081,8 @@ void BDCSVD<MatrixType, Options>::computeSingVals(const ArrayRef& col0, const Ar
std::cout << "found " << singVals[k] << " == " << shift << " + " << muCur << " from " << diag(k) << " .. " << diag(k+1) << "\n"; std::cout << "found " << singVals[k] << " == " << shift << " + " << muCur << " from " << diag(k) << " .. " << diag(k+1) << "\n";
#endif #endif
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(k==0 || singVals[k]>=singVals[k-1]); eigen_internal_assert(k==0 || singVals[k]>=singVals[k-1]);
assert(singVals[k]>=diag(k)); eigen_internal_assert(singVals[k]>=diag(k));
#endif #endif
// perturb singular value slightly if it equals diagonal entry to avoid division by zero later // perturb singular value slightly if it equals diagonal entry to avoid division by zero later
@ -1123,7 +1123,7 @@ void BDCSVD<MatrixType, Options>::perturbCol0(const ArrayRef& col0, const ArrayR
std::cout << "prod = " << "(" << singVals(lastIdx) << " + " << dk << ") * (" << mus(lastIdx) << " + (" << shifts(lastIdx) << " - " << dk << "))" << "\n"; std::cout << "prod = " << "(" << singVals(lastIdx) << " + " << dk << ") * (" << mus(lastIdx) << " + (" << shifts(lastIdx) << " - " << dk << "))" << "\n";
std::cout << " = " << singVals(lastIdx) + dk << " * " << mus(lastIdx) + (shifts(lastIdx) - dk) << "\n"; std::cout << " = " << singVals(lastIdx) + dk << " * " << mus(lastIdx) + (shifts(lastIdx) - dk) << "\n";
} }
assert(prod>=0); eigen_internal_assert(prod>=0);
#endif #endif
for(Index l = 0; l<m; ++l) for(Index l = 0; l<m; ++l)
@ -1154,11 +1154,11 @@ void BDCSVD<MatrixType, Options>::perturbCol0(const ArrayRef& col0, const ArrayR
{ {
std::cout << "k=" << k << ", i=" << i << ", l=" << l << ", perm.size()=" << perm.size() << "\n"; std::cout << "k=" << k << ", i=" << i << ", l=" << l << ", perm.size()=" << perm.size() << "\n";
} }
assert(dk!=Literal(0) || diag(i)!=Literal(0)); eigen_internal_assert(dk!=Literal(0) || diag(i)!=Literal(0));
#endif #endif
prod *= ((singVals(j)+dk) / ((diag(i)+dk))) * ((mus(j)+(shifts(j)-dk)) / ((diag(i)-dk))); prod *= ((singVals(j)+dk) / ((diag(i)+dk))) * ((mus(j)+(shifts(j)-dk)) / ((diag(i)-dk)));
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(prod>=0); eigen_internal_assert(prod>=0);
#endif #endif
#ifdef EIGEN_BDCSVD_DEBUG_VERBOSE #ifdef EIGEN_BDCSVD_DEBUG_VERBOSE
if(i!=k && numext::abs(((singVals(j)+dk)*(mus(j)+(shifts(j)-dk)))/((diag(i)+dk)*(diag(i)-dk)) - 1) > 0.9 ) if(i!=k && numext::abs(((singVals(j)+dk)*(mus(j)+(shifts(j)-dk)))/((diag(i)+dk)*(diag(i)-dk)) - 1) > 0.9 )
@ -1172,7 +1172,7 @@ void BDCSVD<MatrixType, Options>::perturbCol0(const ArrayRef& col0, const ArrayR
#endif #endif
RealScalar tmp = sqrt(prod); RealScalar tmp = sqrt(prod);
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert((numext::isfinite)(tmp)); eigen_internal_assert((numext::isfinite)(tmp));
#endif #endif
zhat(k) = col0(k) > Literal(0) ? RealScalar(tmp) : RealScalar(-tmp); zhat(k) = col0(k) > Literal(0) ? RealScalar(tmp) : RealScalar(-tmp);
} }
@ -1309,9 +1309,9 @@ void BDCSVD<MatrixType, Options>::deflation(Index firstCol, Index lastCol, Index
RealScalar epsilon_coarse = Literal(8) * NumTraits<RealScalar>::epsilon() * numext::maxi<RealScalar>(col0.cwiseAbs().maxCoeff(), maxDiag); RealScalar epsilon_coarse = Literal(8) * NumTraits<RealScalar>::epsilon() * numext::maxi<RealScalar>(col0.cwiseAbs().maxCoeff(), maxDiag);
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(m_naiveU.allFinite()); eigen_internal_assert(m_naiveU.allFinite());
assert(m_naiveV.allFinite()); eigen_internal_assert(m_naiveV.allFinite());
assert(m_computed.allFinite()); eigen_internal_assert(m_computed.allFinite());
#endif #endif
#ifdef EIGEN_BDCSVD_DEBUG_VERBOSE #ifdef EIGEN_BDCSVD_DEBUG_VERBOSE
@ -1348,9 +1348,9 @@ void BDCSVD<MatrixType, Options>::deflation(Index firstCol, Index lastCol, Index
} }
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(m_naiveU.allFinite()); eigen_internal_assert(m_naiveU.allFinite());
assert(m_naiveV.allFinite()); eigen_internal_assert(m_naiveV.allFinite());
assert(m_computed.allFinite()); eigen_internal_assert(m_computed.allFinite());
#endif #endif
#ifdef EIGEN_BDCSVD_DEBUG_VERBOSE #ifdef EIGEN_BDCSVD_DEBUG_VERBOSE
std::cout << "to be sorted: " << diag.transpose() << "\n\n"; std::cout << "to be sorted: " << diag.transpose() << "\n\n";
@ -1454,13 +1454,13 @@ void BDCSVD<MatrixType, Options>::deflation(Index firstCol, Index lastCol, Index
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
for(Index j=2;j<length;++j) for(Index j=2;j<length;++j)
assert(diag(j-1)<=diag(j) || abs(diag(j))<considerZero); eigen_internal_assert(diag(j-1)<=diag(j) || abs(diag(j))<considerZero);
#endif #endif
#ifdef EIGEN_BDCSVD_SANITY_CHECKS #ifdef EIGEN_BDCSVD_SANITY_CHECKS
assert(m_naiveU.allFinite()); eigen_internal_assert(m_naiveU.allFinite());
assert(m_naiveV.allFinite()); eigen_internal_assert(m_naiveV.allFinite());
assert(m_computed.allFinite()); eigen_internal_assert(m_computed.allFinite());
#endif #endif
} // end deflation } // end deflation

View File

@ -483,7 +483,7 @@ struct TensorEvaluator<TensorChippingOp<DimId, ArgType>, Device>
template <typename TensorBlock> template <typename TensorBlock>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock( EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock(
const TensorBlockDesc& desc, const TensorBlock& block) { const TensorBlockDesc& desc, const TensorBlock& block) {
assert(this->m_impl.data() != NULL); eigen_assert(this->m_impl.data() != NULL);
const Index chip_dim = this->m_dim.actualDim(); const Index chip_dim = this->m_dim.actualDim();

View File

@ -874,7 +874,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
lhs_.getSubMapper(m1 * bm_, k * bk_), bk(k), bm(m1)); lhs_.getSubMapper(m1 * bm_, k * bk_), bk(k), bm(m1));
if (!parallel_pack_ && shard_by_col_) { if (!parallel_pack_ && shard_by_col_) {
assert(!use_thread_local); eigen_assert(!use_thread_local);
signal_packing(k); signal_packing(k);
} else { } else {
signal_switch(k + 1); signal_switch(k + 1);
@ -927,7 +927,7 @@ struct TensorEvaluator<const TensorContractionOp<Indices, LeftArgType, RightArgT
signal_kernel(m, n, k, sync, use_thread_local); signal_kernel(m, n, k, sync, use_thread_local);
} }
} else { } else {
assert(!use_thread_local); eigen_assert(!use_thread_local);
signal_packing(k); signal_packing(k);
} }
} }

View File

@ -159,14 +159,14 @@ struct TensorEvaluator
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock
block(TensorBlockDesc& desc, TensorBlockScratch& scratch, block(TensorBlockDesc& desc, TensorBlockScratch& scratch,
bool /*root_of_expr_ast*/ = false) const { bool /*root_of_expr_ast*/ = false) const {
assert(m_data != NULL); eigen_assert(m_data != NULL);
return TensorBlock::materialize(m_data, m_dims, desc, scratch); return TensorBlock::materialize(m_data, m_dims, desc, scratch);
} }
template<typename TensorBlock> template<typename TensorBlock>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock( EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock(
const TensorBlockDesc& desc, const TensorBlock& block) { const TensorBlockDesc& desc, const TensorBlock& block) {
assert(m_data != NULL); eigen_assert(m_data != NULL);
typedef typename TensorBlock::XprType TensorBlockExpr; typedef typename TensorBlock::XprType TensorBlockExpr;
typedef internal::TensorBlockAssignment<Scalar, NumCoords, TensorBlockExpr, typedef internal::TensorBlockAssignment<Scalar, NumCoords, TensorBlockExpr,
@ -331,7 +331,7 @@ struct TensorEvaluator<const Derived, Device>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock
block(TensorBlockDesc& desc, TensorBlockScratch& scratch, block(TensorBlockDesc& desc, TensorBlockScratch& scratch,
bool /*root_of_expr_ast*/ = false) const { bool /*root_of_expr_ast*/ = false) const {
assert(m_data != NULL); eigen_assert(m_data != NULL);
return TensorBlock::materialize(m_data, m_dims, desc, scratch); return TensorBlock::materialize(m_data, m_dims, desc, scratch);
} }

View File

@ -208,7 +208,7 @@ struct TensorEvaluator<const TensorForcedEvalOp<ArgType_>, Device>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock
block(TensorBlockDesc& desc, TensorBlockScratch& scratch, block(TensorBlockDesc& desc, TensorBlockScratch& scratch,
bool /*root_of_expr_ast*/ = false) const { bool /*root_of_expr_ast*/ = false) const {
assert(m_buffer != NULL); eigen_assert(m_buffer != NULL);
return TensorBlock::materialize(m_buffer, m_impl.dimensions(), desc, scratch); return TensorBlock::materialize(m_buffer, m_impl.dimensions(), desc, scratch);
} }

View File

@ -93,7 +93,7 @@
// HIPCC do not support the use of assert on the GPU side. // HIPCC do not support the use of assert on the GPU side.
#define gpu_assert(COND) #define gpu_assert(COND)
#else #else
#define gpu_assert(COND) assert(COND) #define gpu_assert(COND) eigen_assert(COND)
#endif #endif
#endif // gpu_assert #endif // gpu_assert

View File

@ -202,7 +202,7 @@ struct TensorPrinter {
} }
} }
assert(layout == RowMajor); eigen_assert(layout == RowMajor);
typedef std::conditional_t<is_same<Scalar, char>::value || is_same<Scalar, unsigned char>::value || typedef std::conditional_t<is_same<Scalar, char>::value || is_same<Scalar, unsigned char>::value ||
is_same<Scalar, numext::int8_t>::value || is_same<Scalar, numext::uint8_t>::value, is_same<Scalar, numext::int8_t>::value || is_same<Scalar, numext::uint8_t>::value,
int, int,

View File

@ -281,7 +281,7 @@ template<typename NewDimensions, typename ArgType, typename Device>
template <typename TensorBlock> template <typename TensorBlock>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock( EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void writeBlock(
const TensorBlockDesc& desc, const TensorBlock& block) { const TensorBlockDesc& desc, const TensorBlock& block) {
assert(this->m_impl.data() != NULL); eigen_assert(this->m_impl.data() != NULL);
typedef typename TensorBlock::XprType TensorBlockExpr; typedef typename TensorBlock::XprType TensorBlockExpr;
typedef internal::TensorBlockAssignment< typedef internal::TensorBlockAssignment<

View File

@ -256,7 +256,7 @@ struct TensorEvaluator<const TensorShufflingOp<Shuffle, ArgType>, Device>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE TensorBlock
block(TensorBlockDesc& desc, TensorBlockScratch& scratch, block(TensorBlockDesc& desc, TensorBlockScratch& scratch,
bool root_of_expr_ast = false) const { bool root_of_expr_ast = false) const {
assert(m_impl.data() != NULL); eigen_assert(m_impl.data() != NULL);
typedef internal::TensorBlockIO<ScalarNoConst, Index, NumDims, Layout> typedef internal::TensorBlockIO<ScalarNoConst, Index, NumDims, Layout>
TensorBlockIO; TensorBlockIO;

View File

@ -136,7 +136,7 @@ void matrix_log_compute_pade(MatrixType& result, const MatrixType& T, int degree
typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar; typedef typename NumTraits<typename MatrixType::Scalar>::Real RealScalar;
const int minPadeDegree = 3; const int minPadeDegree = 3;
const int maxPadeDegree = 11; const int maxPadeDegree = 11;
assert(degree >= minPadeDegree && degree <= maxPadeDegree); eigen_assert(degree >= minPadeDegree && degree <= maxPadeDegree);
// FIXME this creates float-conversion-warnings if these are enabled. // FIXME this creates float-conversion-warnings if these are enabled.
// Either manually convert each value, or disable the warning locally // Either manually convert each value, or disable the warning locally
const RealScalar nodes[][maxPadeDegree] = { const RealScalar nodes[][maxPadeDegree] = {

View File

@ -430,7 +430,7 @@ HybridNonLinearSolver<FunctorType,Scalar>::solveNumericalDiffOneStep(FVectorType
using std::sqrt; using std::sqrt;
using std::abs; using std::abs;
assert(x.size()==n); // check the caller is not cheating us eigen_assert(x.size()==n); // check the caller is not cheating us
Index j; Index j;
std::vector<JacobiRotation<Scalar> > v_givens(n), w_givens(n); std::vector<JacobiRotation<Scalar> > v_givens(n), w_givens(n);

View File

@ -685,11 +685,11 @@ struct igammac_retval {
template <typename Scalar> template <typename Scalar>
struct cephes_helper { struct cephes_helper {
EIGEN_DEVICE_FUNC EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE Scalar machep() { assert(false && "machep not supported for this type"); return 0.0; } static EIGEN_STRONG_INLINE Scalar machep() { eigen_assert(false && "machep not supported for this type"); return 0.0; }
EIGEN_DEVICE_FUNC EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE Scalar big() { assert(false && "big not supported for this type"); return 0.0; } static EIGEN_STRONG_INLINE Scalar big() { eigen_assert(false && "big not supported for this type"); return 0.0; }
EIGEN_DEVICE_FUNC EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE Scalar biginv() { assert(false && "biginv not supported for this type"); return 0.0; } static EIGEN_STRONG_INLINE Scalar biginv() { eigen_assert(false && "biginv not supported for this type"); return 0.0; }
}; };
template <> template <>