Comment cleanup v3: trailing ??, informal language, FIXME/TODO colons

libeigen/eigen!2197

Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
Rasmus Munk Larsen
2026-02-22 21:20:08 -08:00
parent 112c2324bd
commit 78b76986b7
57 changed files with 90 additions and 89 deletions

View File

@@ -491,7 +491,7 @@ LDLT<MatrixType, UpLo_>& LDLT<MatrixType, UpLo_>::compute(const EigenBase<InputT
// Compute matrix L1 norm = max abs column sum.
m_l1_norm = RealScalar(0);
// TODO move this code to SelfAdjointView
// TODO: move this code to SelfAdjointView
for (Index col = 0; col < size; ++col) {
RealScalar abs_col_sum;
if (UpLo_ == Lower)

View File

@@ -406,7 +406,7 @@ LLT<MatrixType, UpLo_>& LLT<MatrixType, UpLo_>::compute(const EigenBase<InputTyp
// Compute matrix L1 norm = max abs column sum.
m_l1_norm = RealScalar(0);
// TODO move this code to SelfAdjointView
// TODO: move this code to SelfAdjointView
for (Index col = 0; col < size; ++col) {
RealScalar abs_col_sum;
if (UpLo_ == Lower)

View File

@@ -360,7 +360,7 @@ class CholmodBase : public SparseSolverBase<Derived> {
this->m_info = NumericalIssue;
return;
}
// TODO optimize this copy by swapping when possible (be careful with alignment, etc.)
// TODO: optimize this copy by swapping when possible (be careful with alignment, etc.)
// NOTE Actually, the copy can be avoided by calling cholmod_solve2 instead of cholmod_solve
dest = Matrix<Scalar, Dest::RowsAtCompileTime, Dest::ColsAtCompileTime>::Map(reinterpret_cast<Scalar*>(x_cd->x),
b.rows(), b.cols());
@@ -386,7 +386,7 @@ class CholmodBase : public SparseSolverBase<Derived> {
this->m_info = NumericalIssue;
return;
}
// TODO optimize this copy by swapping when possible (be careful with alignment, etc.)
// TODO: optimize this copy by swapping when possible (be careful with alignment, etc.)
// NOTE cholmod_spsolve in fact just calls the dense solver for blocks of 4 columns at a time (similar to Eigen's
// sparse solver)
dest.derived() = viewAsEigen<typename DestDerived::Scalar, typename DestDerived::StorageIndex>(*x_cs);

View File

@@ -762,7 +762,7 @@ class generic_dense_assignment_kernel {
DstEvaluatorType& m_dst;
const SrcEvaluatorType& m_src;
const Functor& m_functor;
// TODO find a way to avoid the needs of the original expression
// TODO: find a way to avoid the needs of the original expression
DstXprType& m_dstExpr;
};
@@ -921,7 +921,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(Ds
typedef std::conditional_t<NeedToTranspose, Transpose<Dst>, Dst&> ActualDstType;
ActualDstType actualDst(dst);
// TODO check whether this is the right place to perform these checks:
// TODO: check whether this is the right place to perform these checks:
EIGEN_STATIC_ASSERT_LVALUE(Dst)
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned, Src)
EIGEN_CHECK_BINARY_COMPATIBILIY(Func, typename ActualDstTypeCleaned::Scalar, typename Src::Scalar);
@@ -956,7 +956,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(Ds
template <typename Dst, typename Src, typename Func>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias_no_transpose(Dst& dst, const Src& src,
const Func& func) {
// TODO check whether this is the right place to perform these checks:
// TODO: check whether this is the right place to perform these checks:
EIGEN_STATIC_ASSERT_LVALUE(Dst)
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(Dst, Src)
EIGEN_CHECK_BINARY_COMPATIBILIY(Func, typename Dst::Scalar, typename Src::Scalar);

View File

@@ -116,7 +116,7 @@ struct evaluator<const T> : evaluator<T> {
template <typename ExpressionType>
struct evaluator_base {
// TODO that's not very nice to have to propagate all these traits. They are currently only needed to handle
// TODO: find a way to avoid propagating all these traits. They are currently only needed to handle
// outer,inner indices.
typedef traits<ExpressionType> ExpressionTraits;
@@ -1117,7 +1117,7 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType, StrideType>, IndexBased>
Flags = (evaluator<ArgType>::Flags & (HereditaryBits | LinearAccessBit | DirectAccessBit)),
Alignment = 0 // FIXME it is not very clear why alignment is necessarily lost...
Alignment = 0 // FIXME: clarify why alignment is lost for CwiseUnaryView.
};
EIGEN_DEVICE_FUNC explicit unary_evaluator(const XprType& op) : m_d(op) {
@@ -1159,7 +1159,7 @@ struct unary_evaluator<CwiseUnaryView<UnaryOp, ArgType, StrideType>, IndexBased>
// -------------------- Map --------------------
// FIXME perhaps the PlainObjectType could be provided by Derived::PlainObject ?
// FIXME: consider using Derived::PlainObject for PlainObjectType.
// but that might complicate template specialization
template <typename Derived, typename PlainObjectType>
struct mapbase_evaluator;
@@ -1713,7 +1713,7 @@ struct unary_evaluator<Reverse<ArgType, Direction>> : evaluator_base<Reverse<Arg
CoeffReadCost = evaluator<ArgType>::CoeffReadCost,
// let's enable LinearAccess only with vectorization because of the product overhead
// FIXME enable DirectAccess with negative strides?
// FIXME: consider enabling DirectAccess with negative strides.
Flags0 = evaluator<ArgType>::Flags,
LinearAccess =
((Direction == BothDirections) && (int(Flags0) & PacketAccessBit)) ||
@@ -1723,7 +1723,7 @@ struct unary_evaluator<Reverse<ArgType, Direction>> : evaluator_base<Reverse<Arg
Flags = int(Flags0) & (HereditaryBits | PacketAccessBit | LinearAccess),
Alignment = 0 // FIXME in some rare cases, Alignment could be preserved, like a Vector4f.
Alignment = 0 // FIXME: in some rare cases, Alignment could be preserved.
};
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE explicit unary_evaluator(const XprType& reverse)

View File

@@ -104,7 +104,7 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE constexpr void call_assignment_no_alias(De
using ActualDstType = std::conditional_t<NeedToTranspose, Transpose<Dst>, Dst&>;
ActualDstType actualDst(dst.derived());
// TODO check whether this is the right place to perform these checks:
// TODO: check whether this is the right place to perform these checks:
EIGEN_STATIC_ASSERT_LVALUE(Dst)
EIGEN_STATIC_ASSERT_SAME_MATRIX_SIZE(ActualDstTypeCleaned, Src)
EIGEN_CHECK_BINARY_COMPATIBILIY(Func, typename ActualDstTypeCleaned::Scalar, typename Src::Scalar);

View File

@@ -292,7 +292,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, true> {
typedef std::conditional_t<Dest::IsVectorAtCompileTime, Dest, typename Dest::ColXpr> ActualDest;
enum {
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// FIXME: find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
EvalToDestAtCompileTime = (ActualDest::InnerStrideAtCompileTime == 1),
ComplexByReal = (NumTraits<LhsScalar>::IsComplex) && (!NumTraits<RhsScalar>::IsComplex),
@@ -375,7 +375,7 @@ struct gemv_dense_selector<OnTheRight, RowMajor, true> {
ResScalar actualAlpha = combine_scalar_factors(alpha, lhs, rhs);
enum {
// FIXME find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// FIXME: find a way to allow an inner stride on the result if packet_traits<Scalar>::size==1
// on, the other hand it is good for the cache to pack the vector anyways...
DirectlyUseRhs =
ActualRhsTypeCleaned::InnerStrideAtCompileTime == 1 || ActualRhsTypeCleaned::MaxSizeAtCompileTime == 0
@@ -416,7 +416,7 @@ struct gemv_dense_selector<OnTheRight, ColMajor, false> {
static void run(const Lhs& lhs, const Rhs& rhs, Dest& dest, const typename Dest::Scalar& alpha) {
EIGEN_STATIC_ASSERT((!nested_eval<Lhs, 1>::Evaluate),
EIGEN_INTERNAL_COMPILATION_ERROR_OR_YOU_MADE_A_PROGRAMMING_MISTAKE);
// TODO if rhs is large enough it might be beneficial to make sure that dest is sequentially stored in memory,
// TODO: if rhs is large enough it might be beneficial to make sure that dest is sequentially stored in memory,
// otherwise use a temp
typename nested_eval<Rhs, 1>::type actual_rhs(rhs);
const Index size = rhs.rows();

View File

@@ -65,7 +65,7 @@ struct IOFormat {
fill(_fill),
precision(_precision),
flags(_flags) {
// TODO check if rowPrefix, rowSuffix or rowSeparator contains a newline
// TODO: check if rowPrefix, rowSuffix or rowSeparator contains a newline
// don't add rowSpacer if columns are not to be aligned
if ((flags & DontAlignCols)) return;
int i = int(matPrefix.length()) - 1;

View File

@@ -59,7 +59,7 @@ struct traits<IndexedView<XprType, RowIndices, ColIndices>> : traits<XprType> {
ReturnAsBlock = (!ReturnAsScalar) && IsBlockAlike,
ReturnAsIndexedView = (!ReturnAsScalar) && (!ReturnAsBlock),
// FIXME we deal with compile-time strides if and only if we have DirectAccessBit flag,
// FIXME: we deal with compile-time strides if and only if we have DirectAccessBit flag,
// but this is too strict regarding negative strides...
DirectAccessMask = (int(InnerIncr) != Undefined && int(OuterIncr) != Undefined && InnerIncr >= 0 && OuterIncr >= 0)
? DirectAccessBit

View File

@@ -36,7 +36,7 @@ struct evaluator<Product<Lhs, Rhs, Options>> : public product_evaluator<Product<
};
// Catch "scalar * ( A * B )" and transform it to "(A*scalar) * B"
// TODO we should apply that rule only if that's really helpful
// TODO: we should apply that rule only if that's really helpful
template <typename Lhs, typename Rhs, typename Scalar1, typename Scalar2, typename Plain1>
struct evaluator_assume_aliasing<CwiseBinaryOp<internal::scalar_product_op<Scalar1, Scalar2>,
const CwiseNullaryOp<internal::scalar_constant_op<Scalar1>, Plain1>,
@@ -161,7 +161,7 @@ struct Assignment<DstXprType, Product<Lhs, Rhs, Options>, internal::sub_assign_o
};
// Dense ?= scalar * Product
// TODO we should apply that rule if that's really helpful
// TODO: we should apply that rule if that's really helpful
// for instance, this is not good for inner products
template <typename DstXprType, typename Lhs, typename Rhs, typename AssignFunc, typename Scalar, typename ScalarBis,
typename Plain>
@@ -286,7 +286,7 @@ struct generic_product_impl<Lhs, Rhs, DenseShape, DenseShape, OuterProduct> {
struct is_row_major : bool_constant<(int(T::Flags) & RowMajorBit)> {};
typedef typename Product<Lhs, Rhs>::Scalar Scalar;
// TODO it would be nice to be able to exploit our *_assign_op functors for that purpose
// TODO: it would be nice to be able to exploit our *_assign_op functors for that purpose
struct set {
template <typename Dst, typename Src>
EIGEN_DEVICE_FUNC void operator()(const Dst& dst, const Src& src) const {
@@ -563,7 +563,7 @@ struct product_evaluator<Product<Lhs, Rhs, LazyProduct>, ProductTag, DenseShape,
Flags = ((int(LhsFlags) | int(RhsFlags)) & HereditaryBits & ~RowMajorBit) |
(EvalToRowMajor ? RowMajorBit : 0)
// TODO enable vectorization for mixed types
// TODO: enable vectorization for mixed types
| (SameType && (CanVectorizeLhs || CanVectorizeRhs) ? PacketAccessBit : 0) |
(XprType::IsVectorAtCompileTime ? LinearAccessBit : 0),

View File

@@ -398,8 +398,8 @@ class redux_evaluator : public internal::evaluator<XprType_> {
enum {
MaxRowsAtCompileTime = XprType::MaxRowsAtCompileTime,
MaxColsAtCompileTime = XprType::MaxColsAtCompileTime,
// TODO we should not remove DirectAccessBit and rather find an elegant way to query the alignment offset at runtime
// from the evaluator
// TODO: we should not remove DirectAccessBit and rather find an elegant way to query the alignment offset at
// runtime from the evaluator
Flags = Base::Flags & ~DirectAccessBit,
IsRowMajor = XprType::IsRowMajor,
SizeAtCompileTime = XprType::SizeAtCompileTime,

View File

@@ -30,7 +30,7 @@ struct traits<Replicate<MatrixType, RowFactor, ColFactor> > : traits<MatrixType>
ColsAtCompileTime = ColFactor == Dynamic || int(MatrixType::ColsAtCompileTime) == Dynamic
? Dynamic
: ColFactor * MatrixType::ColsAtCompileTime,
// FIXME we don't propagate the max sizes !!!
// FIXME: propagate MaxRowsAtCompileTime and MaxColsAtCompileTime.
MaxRowsAtCompileTime = RowsAtCompileTime,
MaxColsAtCompileTime = ColsAtCompileTime,
IsRowMajor = MaxRowsAtCompileTime == 1 && MaxColsAtCompileTime != 1 ? 1
@@ -38,7 +38,7 @@ struct traits<Replicate<MatrixType, RowFactor, ColFactor> > : traits<MatrixType>
: (MatrixType::Flags & RowMajorBit) ? 1
: 0,
// FIXME enable DirectAccess with negative strides?
// FIXME: consider enabling DirectAccess with negative strides.
Flags = IsRowMajor ? RowMajorBit : 0
};
};

View File

@@ -23,7 +23,7 @@ struct traits<ReturnByValue<Derived> > : public traits<typename traits<Derived>:
enum {
// We're disabling the DirectAccess because e.g. the constructor of
// the Block-with-DirectAccess expression requires to have a coeffRef method.
// Also, we don't want to have to implement the stride stuff.
// Also, this avoids having to implement stride support.
Flags = (traits<typename traits<Derived>::ReturnType>::Flags | EvalBeforeNestingBit) & ~DirectAccessBit
};
};
@@ -32,7 +32,7 @@ struct traits<ReturnByValue<Derived> > : public traits<typename traits<Derived>:
* So the only way that nesting it in an expression can work, is by evaluating it into a plain matrix.
* So internal::nested always gives the plain return matrix type.
*
* FIXME: I don't understand why we need this specialization: isn't this taken care of by the EvalBeforeNestingBit ??
* FIXME: this specialization may be redundant with EvalBeforeNestingBit.
* Answer: EvalBeforeNestingBit should be deprecated since we have the evaluators
*/
template <typename Derived, int n, typename PlainObject>

View File

@@ -449,7 +449,7 @@ class generic_randaccess_stl_iterator
using Base::m_index;
using Base::mp_xpr;
// TODO currently const Transpose/Reshape expressions never returns const references,
// TODO: currently const Transpose/Reshape expressions never returns const references,
// so lets return by value too.
// typedef std::conditional_t<bool(has_direct_access), const value_type&, const value_type> read_only_ref_t;
typedef const value_type read_only_ref_t;

View File

@@ -57,7 +57,7 @@ class generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT,
m_dst.template writePacket<StoreMode>(index, tmp);
}
// TODO find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I
// TODO: find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I
// mean no CRTP (Gael)
template <int StoreMode, int LoadMode, typename PacketType>
EIGEN_STRONG_INLINE void assignPacketByOuterInner(Index outer, Index inner) {
@@ -82,7 +82,7 @@ class generic_dense_assignment_kernel<DstEvaluatorTypeT, SrcEvaluatorTypeT,
m_dst.template writePacketSegment<StoreMode>(index, tmp, begin, count);
}
// TODO find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I
// TODO: find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I
// mean no CRTP (Gael)
template <int StoreMode, int LoadMode, typename PacketType>
EIGEN_STRONG_INLINE void assignPacketSegmentByOuterInner(Index outer, Index inner, Index begin, Index count) {

View File

@@ -633,7 +633,7 @@ bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const {
namespace internal {
// TODO currently a triangular expression has the form TriangularView<.,.>
// TODO: currently a triangular expression has the form TriangularView<.,.>
// in the future triangular-ness should be defined by the expression traits
// such that Transpose<TriangularView<.,.> > is valid. (currently TriangularBase::transpose() is overloaded to make
// it work)

View File

@@ -1059,7 +1059,7 @@ EIGEN_DONT_INLINE void gemm_pack_rhs<Scalar, Index, DataMapper, 8, ColMajor, Con
const LinearMapper dm3 = rhs.getLinearMapper(0, j2 + 3);
Index k = 0;
if ((PacketSize % 4) == 0) // TODO enable vectorized transposition for PacketSize==2 ??
if ((PacketSize % 4) == 0) // TODO: enable vectorized transposition for PacketSize==2.
{
for (; k < peeled_k; k += PacketSize) {
PacketBlock<Packet, (PacketSize % 4) == 0 ? 4 : PacketSize> kernel;

View File

@@ -41,7 +41,7 @@ typedef __vector signed char Packet16c;
typedef __vector unsigned char Packet16uc;
typedef eigen_packet_wrapper<__vector unsigned short int, 0> Packet8bf;
// We don't want to write the same code all the time, but we need to reuse the constants
// To avoid repeating the same code, but we need to reuse the constants
// and it doesn't really work to declare them global, so we define macros instead
#define EIGEN_DECLARE_CONST_FAST_Packet4f(NAME, X) Packet4f p4f_##NAME = {X, X, X, X}
@@ -1163,7 +1163,7 @@ EIGEN_STRONG_INLINE Packet4i pdiv<Packet4i>(const Packet4i& a, const Packet4i& b
#endif
}
// for some weird reasons, it has to be overloaded for packet of integers
// This overload is required for integer packet types.
template <>
EIGEN_STRONG_INLINE Packet4f pmadd(const Packet4f& a, const Packet4f& b, const Packet4f& c) {
return vec_madd(a, b, c);
@@ -3274,7 +3274,7 @@ EIGEN_STRONG_INLINE Packet2d pdiv<Packet2d>(const Packet2d& a, const Packet2d& b
return vec_div(a, b);
}
// for some weird reasons, it has to be overloaded for packet of integers
// This overload is required for integer packet types.
template <>
EIGEN_STRONG_INLINE Packet2d pmadd(const Packet2d& a, const Packet2d& b, const Packet2d& c) {
return vec_madd(a, b, c);

View File

@@ -364,7 +364,7 @@ EIGEN_STRONG_INLINE Packet1cd pandnot<Packet1cd>(const Packet1cd& a, const Packe
return res;
}
// FIXME force unaligned load, this is a temporary fix
// FIXME: force unaligned load, this is a temporary fix
template <>
EIGEN_STRONG_INLINE Packet1cd pload<Packet1cd>(const std::complex<double>* from) {
EIGEN_DEBUG_ALIGNED_LOAD return Packet1cd(pload<Packet2d>((const double*)from));
@@ -384,7 +384,7 @@ EIGEN_STRONG_INLINE Packet1cd ploaddup<Packet1cd>(const std::complex<double>* fr
return pset1<Packet1cd>(*from);
}
// FIXME force unaligned store, this is a temporary fix
// FIXME: force unaligned store, this is a temporary fix
template <>
EIGEN_STRONG_INLINE void pstore<std::complex<double> >(std::complex<double>* to, const Packet1cd& from) {
EIGEN_DEBUG_ALIGNED_STORE pstore((double*)to, Packet2d(from.v));

View File

@@ -70,7 +70,7 @@ struct packet_traits<float> : default_packet_traits {
Vectorizable = 1,
AlignedOnScalar = 1,
size = 4,
// FIXME check the Has*
// FIXME: verify the Has* flags.
HasDiv = 1,
HasSin = EIGEN_FAST_MATH,
HasCos = EIGEN_FAST_MATH,
@@ -91,7 +91,7 @@ struct packet_traits<int32_t> : default_packet_traits {
Vectorizable = 1,
AlignedOnScalar = 1,
size = 4,
// FIXME check the Has*
// FIXME: verify the Has* flags.
HasDiv = 1,
};
};
@@ -822,7 +822,7 @@ struct packet_traits<double> : default_packet_traits {
Vectorizable = 1,
AlignedOnScalar = 1,
size = 2,
// FIXME check the Has*
// FIXME: verify the Has* flags.
HasDiv = 1,
HasExp = 1,
HasSqrt = 1,

View File

@@ -140,7 +140,7 @@ template <typename Scalar>
struct swap_assign_op {
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void assignCoeff(Scalar& a, const Scalar& b) const {
#ifdef EIGEN_GPUCC
// FIXME is there some kind of cuda::swap?
// FIXME: check whether cuda::swap exists.
Scalar t = b;
const_cast<Scalar&>(b) = a;
a = t;

View File

@@ -55,7 +55,7 @@ struct functor_traits<scalar_sum_op<LhsScalar, RhsScalar>> {
Cost = (int(NumTraits<LhsScalar>::AddCost) + int(NumTraits<RhsScalar>::AddCost)) / 2, // rough estimate!
PacketAccess =
is_same<LhsScalar, RhsScalar>::value && packet_traits<LhsScalar>::HasAdd && packet_traits<RhsScalar>::HasAdd
// TODO vectorize mixed sum
// TODO: vectorize mixed sum
};
};
@@ -94,7 +94,7 @@ struct functor_traits<scalar_product_op<LhsScalar, RhsScalar>> {
Cost = (int(NumTraits<LhsScalar>::MulCost) + int(NumTraits<RhsScalar>::MulCost)) / 2, // rough estimate!
PacketAccess =
is_same<LhsScalar, RhsScalar>::value && packet_traits<LhsScalar>::HasMul && packet_traits<RhsScalar>::HasMul
// TODO vectorize mixed product
// TODO: vectorize mixed product
};
};

View File

@@ -367,7 +367,7 @@ template <typename Scalar>
struct functor_traits<scalar_exp2_op<Scalar>> {
enum {
PacketAccess = packet_traits<Scalar>::HasExp,
Cost = functor_traits<scalar_exp_op<Scalar>>::Cost // TODO measure cost of exp2
Cost = functor_traits<scalar_exp_op<Scalar>>::Cost // TODO: measure cost of exp2
};
};
@@ -389,7 +389,7 @@ template <typename Scalar>
struct functor_traits<scalar_expm1_op<Scalar>> {
enum {
PacketAccess = packet_traits<Scalar>::HasExpm1,
Cost = functor_traits<scalar_exp_op<Scalar>>::Cost // TODO measure cost of expm1
Cost = functor_traits<scalar_exp_op<Scalar>>::Cost // TODO: measure cost of expm1
};
};
@@ -443,7 +443,7 @@ template <typename Scalar>
struct functor_traits<scalar_log1p_op<Scalar>> {
enum {
PacketAccess = packet_traits<Scalar>::HasLog1p,
Cost = functor_traits<scalar_log_op<Scalar>>::Cost // TODO measure cost of log1p
Cost = functor_traits<scalar_log_op<Scalar>>::Cost // TODO: measure cost of log1p
};
};

View File

@@ -189,7 +189,7 @@ void evaluateProductBlockingSizesHeuristic(Index& k, Index& m, Index& n, Index n
#endif
// Early return for small problems because the computation below are time consuming for small problems.
// Perhaps it would make more sense to consider k*n*m??
// Perhaps it would make more sense to consider k*n*m?
// Note that for very tiny problem, this function should be bypassed anyway
// because we use the coefficient-based implementation for them.
if ((numext::maxi)(k, (numext::maxi)(m, n)) < 48) return;
@@ -2173,7 +2173,7 @@ EIGEN_DONT_INLINE void gemm_pack_rhs<Scalar, Index, DataMapper, nr, ColMajor, Co
const LinearMapper dm3 = rhs.getLinearMapper(0, j2 + 3);
Index k = 0;
if ((PacketSize % 4) == 0) // TODO enable vectorized transposition for PacketSize==2 ??
if ((PacketSize % 4) == 0) // TODO: enable vectorized transposition for PacketSize==2.
{
for (; k < peeled_k; k += PacketSize) {
PacketBlock<Packet, (PacketSize % 4) == 0 ? 4 : PacketSize> kernel;

View File

@@ -67,7 +67,7 @@ struct general_matrix_matrix_rankupdate
EIGEN_BLAS_RANKUPDATE_SPECIALIZE(double)
EIGEN_BLAS_RANKUPDATE_SPECIALIZE(float)
// TODO handle complex cases
// TODO: handle complex cases
// EIGEN_BLAS_RANKUPDATE_SPECIALIZE(dcomplex)
// EIGEN_BLAS_RANKUPDATE_SPECIALIZE(scomplex)
@@ -137,7 +137,7 @@ EIGEN_BLAS_RANKUPDATE_R(double, double, dsyrk_)
EIGEN_BLAS_RANKUPDATE_R(float, float, ssyrk_)
#endif
// TODO handle complex cases
// TODO: handle complex cases
// EIGEN_BLAS_RANKUPDATE_C(dcomplex, double, double, zherk_)
// EIGEN_BLAS_RANKUPDATE_C(scomplex, float, float, cherk_)

View File

@@ -108,7 +108,7 @@ selfadjoint_matrix_vector_product<Scalar, Index, StorageOrder, UpLo, ConjugateLh
Packet A1i = ploadu<Packet>(a1It);
a1It += PacketSize;
Packet Bi = ploadu<Packet>(rhsIt);
rhsIt += PacketSize; // FIXME should be aligned in most cases
rhsIt += PacketSize; // FIXME: should be aligned in most cases.
Packet Xi = pload<Packet>(resIt);
Xi = pcj0.pmadd(A0i, ptmp0, pcj0.pmadd(A1i, ptmp1, Xi));

View File

@@ -52,7 +52,7 @@ EIGEN_STRONG_INLINE void trsmKernelL<Scalar, Index, Mode, Conjugate, TriStorageO
// tr solve
for (Index k = 0; k < size; ++k) {
// TODO write a small kernel handling this (can be shared with trsv)
// TODO: write a small kernel handling this (can be shared with trsv)
Index i = IsLower ? k : -k - 1;
Index rs = size - k - 1; // remaining size
Index s = TriStorageOrder == RowMajor ? (IsLower ? 0 : i + 1) : IsLower ? i + 1 : i - rs;

View File

@@ -851,7 +851,7 @@ EIGEN_DEVICE_FUNC static void tridiagonal_qr_step(RealScalar* diag, RealScalar*
// apply the givens rotation to the unit matrix Q = Q * G
if (matrixQ) {
// FIXME if StorageOrder == RowMajor this operation is not very efficient
// FIXME: this operation is inefficient for RowMajor storage order.
Map<Matrix<Scalar, Dynamic, Dynamic, StorageOrder> > q(matrixQ, n, n);
q.applyOnTheRight(k, k + 1, rot);
}

View File

@@ -22,7 +22,7 @@ template <typename MatrixType>
struct TridiagonalizationMatrixTReturnType;
template <typename MatrixType>
struct traits<TridiagonalizationMatrixTReturnType<MatrixType>> : public traits<typename MatrixType::PlainObject> {
typedef typename MatrixType::PlainObject ReturnType; // FIXME shall it be a BandMatrix?
typedef typename MatrixType::PlainObject ReturnType; // FIXME: consider using BandMatrix as ReturnType.
enum { Flags = 0 };
};

View File

@@ -983,7 +983,7 @@ void BDCSVD<MatrixType, Options>::computeSingVals(const ArrayRef& col0, const Ar
// check that we did it right:
eigen_internal_assert(
(numext::isfinite)((col0(k) / leftShifted) * (col0(k) / (diag(k) + shift + leftShifted))));
// I don't understand why the case k==0 would be special there:
// It is unclear why k==0 would need special handling here:
// if (k == 0) rightShifted = right - left; else
rightShifted = (k == actual_n - 1)
? right

View File

@@ -173,7 +173,7 @@ Scalar_& AmbiVector<Scalar_, StorageIndex_>::coeffRef(Index i) {
return m_buffer[i];
else {
ListEl* EIGEN_RESTRICT llElements = reinterpret_cast<ListEl*>(m_buffer);
// TODO factorize the following code to reduce code generation
// TODO: factor out the following code to reduce code generation
eigen_assert(m_mode == IsSparse);
if (m_llSize == 0) {
// this is the first element

View File

@@ -25,7 +25,7 @@ Derived &SparseMatrixBase<Derived>::operator=(const EigenBase<OtherDerived> &oth
template <typename Derived>
template <typename OtherDerived>
Derived &SparseMatrixBase<Derived>::operator=(const ReturnByValue<OtherDerived> &other) {
// TODO use the evaluator mechanism
// TODO: use the evaluator mechanism
other.evalTo(derived());
return derived();
}

View File

@@ -32,7 +32,7 @@ namespace Eigen {
// 4 - dense op dense product dense
// generic dense
//
// TODO to ease compiler job, we could specialize product/quotient with a scalar
// TODO: to ease compiler job, we could specialize product/quotient with a scalar
// and fallback to cwise-unary evaluator using bind1st_op and bind2nd_op.
template <typename BinaryOp, typename Lhs, typename Rhs>

View File

@@ -323,8 +323,8 @@ class Ref<const SparseVector<MatScalar, MatOptions, MatIndex>, Options, StrideTy
namespace internal {
// FIXME shall we introduce a general evaluatior_ref that we can specialize for any sparse object once, and thus remove
// this copy-pasta thing...
// FIXME: consider introducing a general evaluator_ref that we can specialize for any sparse object once, and thus
// remove this copy-pasta thing...
template <typename MatScalar, int MatOptions, typename MatIndex, int Options, typename StrideType>
struct evaluator<Ref<SparseMatrix<MatScalar, MatOptions, MatIndex>, Options, StrideType>>

View File

@@ -126,7 +126,7 @@ class SparseSelfAdjointView : public EigenBase<SparseSelfAdjointView<MatrixType,
SparseSelfAdjointView& rankUpdate(const SparseMatrixBase<DerivedU>& u, const Scalar& alpha = Scalar(1));
/** \returns an expression of P H P^-1 */
// TODO implement twists in a more evaluator friendly fashion
// TODO: implement twists in a more evaluator friendly fashion
SparseSymmetricPermutationProduct<MatrixTypeNested_, Mode> twistedBy(
const PermutationMatrix<Dynamic, Dynamic, StorageIndex>& perm) const {
return SparseSymmetricPermutationProduct<MatrixTypeNested_, Mode>(m_matrix, perm);
@@ -205,7 +205,7 @@ SparseSelfAdjointView<MatrixType, Mode>& SparseSelfAdjointView<MatrixType, Mode>
namespace internal {
// TODO currently a selfadjoint expression has the form SelfAdjointView<.,.>
// TODO: currently a selfadjoint expression has the form SelfAdjointView<.,.>
// in the future selfadjoint-ness should be defined by the expression traits
// such that Transpose<SelfAdjointView<.,.> > is valid. (currently TriangularBase::transpose() is overloaded to
// make it work)

View File

@@ -168,7 +168,7 @@ class SparseVector : public SparseCompressedBase<SparseVector<Scalar_, Options_,
Index startId = 0;
Index p = Index(m_data.size()) - 1;
// TODO smart realloc
// TODO: implement smart reallocation.
m_data.resize(p + 2, 1);
while ((p >= startId) && (m_data.index(p) > i)) {

View File

@@ -75,7 +75,7 @@ class SparseView : public SparseMatrixBase<SparseView<MatrixType> > {
namespace internal {
// TODO find a way to unify the two following variants
// TODO: find a way to unify the two following variants
// This is tricky because implementing an inner iterator on top of an IndexBased evaluator is
// not easy because the evaluators do not expose the sizes of the underlying expression.

View File

@@ -130,7 +130,8 @@ struct sparse_solve_triangular_selector<Lhs, Rhs, Mode, Upper, ColMajor> {
if (!numext::is_exactly_zero(tmp)) // optimization when other is actually sparse
{
if (!(Mode & UnitDiag)) {
// TODO replace this by a binary search. make sure the binary search is safe for partially sorted elements
// TODO: replace this with a binary search. make sure the binary search is safe for partially sorted
// elements
LhsIterator it(lhsEval, i);
while (it && it.index() != i) ++it;
eigen_assert(it && it.index() == i);

View File

@@ -128,7 +128,7 @@ Index SparseLUImpl<Scalar, StorageIndex>::expand(VectorType& vec, Index& length,
* \param n number of columns
* \param annz number of initial nonzeros in the matrix
* \param lwork if lwork=-1, this routine returns an estimated size of the required memory
* \param glu persistent data to facilitate multiple factors : will be deleted later ??
* \param glu persistent data to facilitate multiple factors (may be deleted later).
* \param fillratio estimated ratio of fill in the factors
* \param panel_size Size of a panel
* \return an estimated size of the required memory if lwork = -1; otherwise, return the size of actually allocated

View File

@@ -45,7 +45,7 @@ namespace internal {
* \param dense Store the full representation of the column
* \param tempv working array
* \param segrep segment representative ...
* \param repfnz ??? First nonzero column in each row ??? ...
* \param repfnz first nonzero column in each row ...
* \param fpanelc First column in the current panel
* \param glu Global LU data.
* \return 0 - successful return

View File

@@ -208,7 +208,7 @@ struct SluMatrix : SuperMatrix {
res.setScalarType<typename MatrixType::Scalar>();
// FIXME the following is not very accurate
// FIXME: the following type mapping is approximate.
if (int(MatrixType::Flags) & int(Upper)) res.Mtype = SLU_TRU;
if (int(MatrixType::Flags) & int(Lower)) res.Mtype = SLU_TRL;
@@ -259,7 +259,7 @@ struct SluMatrixMapHelper<SparseMatrixBase<Derived> > {
res.setScalarType<typename MatrixType::Scalar>();
// FIXME the following is not very accurate
// FIXME: the following type mapping is approximate.
if (MatrixType::Flags & Upper) res.Mtype = SLU_TRU;
if (MatrixType::Flags & Lower) res.Mtype = SLU_TRL;

View File

@@ -433,7 +433,7 @@ class ThreadPoolTempl : public Eigen::ThreadPoolInterface {
// If we are shutting down and all worker threads blocked without work,
// that's we are done.
blocked_++;
// TODO is blocked_ required to be unsigned?
// TODO: is blocked_ required to be unsigned?
if (done_ && blocked_ == static_cast<unsigned>(num_threads_)) {
ec_.CancelWait();
// Almost done, but need to re-check queues.

View File

@@ -11,7 +11,7 @@
#define EIGEN_UMFPACKSUPPORT_H
// for compatibility with super old version of umfpack,
// not sure this is really needed, but this is harmless.
// This may not be strictly needed, but it is harmless.
#ifndef SuiteSparse_long
#ifdef UF_long
#define SuiteSparse_long UF_long

View File

@@ -133,7 +133,7 @@ EIGEN_MAKE_CWISE_BINARY_OP(pow, pow)
*/
EIGEN_MAKE_CWISE_BINARY_OP(atan2, atan2)
// TODO code generating macros could be moved to Macros.h and could include generation of documentation
// TODO: code generating macros could be moved to Macros.h and could include generation of documentation
#define EIGEN_MAKE_CWISE_COMP_OP(OP, COMPARATOR) \
template <typename OtherDerived> \
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE const \