mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-08 09:49:03 +08:00
add first_multiple helper function
This commit is contained in:
parent
90fcaf11cf
commit
aa858cb43a
@ -470,6 +470,13 @@ static inline Index first_aligned(const Scalar* array, Index size)
|
||||
}
|
||||
}
|
||||
|
||||
/** \internal Returns the smallest integer multiple of \a base and greater or equal to \a size
|
||||
*/
|
||||
template<typename Index>
|
||||
inline static Index first_multiple(Index size, Index base)
|
||||
{
|
||||
return ((size+base-1)/base)*base;
|
||||
}
|
||||
|
||||
// std::copy is much slower than memcpy, so let's introduce a smart_copy which
|
||||
// use memcpy on trivial types, i.e., on types that does not require an initialization ctor.
|
||||
|
Loading…
x
Reference in New Issue
Block a user