33 EIGEN_STATIC_ASSERT(Size *
sizeof(T) <= EIGEN_STACK_ALLOCATION_LIMIT, OBJECT_ALLOCATED_ON_STACK_IS_TOO_BIG);
183template<
typename T,
int Size,
int _Rows,
int _Cols,
int _Options>
class DenseStorage
196 if (
this != &other) m_data = other.m_data;
200 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
201 eigen_internal_assert(size==rows*cols && rows==
_Rows && cols==
_Cols);
202 EIGEN_UNUSED_VARIABLE(size);
203 EIGEN_UNUSED_VARIABLE(rows);
204 EIGEN_UNUSED_VARIABLE(cols);
258 m_data = other.m_data;
259 m_rows = other.m_rows;
260 m_cols = other.m_cols;
269 EIGEN_DEVICE_FUNC void conservativeResize(Index, Index rows, Index cols) { m_rows = rows; m_cols = cols; }
270 EIGEN_DEVICE_FUNC void resize(Index, Index rows, Index cols) { m_rows = rows; m_cols = cols; }
342 : m_data(0), m_rows(0), m_cols(0) {}
344 : m_data(internal::conditional_aligned_new_auto<T,(_Options&
DontAlign)==0>(size)), m_rows(rows), m_cols(cols)
346 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
347 eigen_internal_assert(size==rows*cols && rows>=0 && cols >=0);
350 : m_data(internal::conditional_aligned_new_auto<T,(_Options&
DontAlign)==0>(other.m_rows*other.m_cols))
351 , m_rows(other.m_rows)
352 , m_cols(other.m_cols)
354 internal::smart_copy(other.m_data, other.m_data+other.m_rows*other.m_cols, m_data);
365#ifdef EIGEN_HAVE_RVALUE_REFERENCES
368 : m_data(std::move(other.m_data))
369 , m_rows(std::move(other.m_rows))
370 , m_cols(std::move(other.m_cols))
372 other.m_data =
nullptr;
380 swap(m_data, other.m_data);
381 swap(m_rows, other.m_rows);
382 swap(m_cols, other.m_cols);
391 void conservativeResize(Index size, Index rows, Index cols)
393 m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*m_cols);
399 if(size != m_rows*m_cols)
401 internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data, m_rows*m_cols);
403 m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
406 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
425 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
426 eigen_internal_assert(size==rows*cols && rows==
_Rows && cols >=0);
427 EIGEN_UNUSED_VARIABLE(rows);
430 : m_data(internal::conditional_aligned_new_auto<T,(_Options&
DontAlign)==0>(
_Rows*other.m_cols))
431 , m_cols(other.m_cols)
433 internal::smart_copy(other.m_data, other.m_data+
_Rows*m_cols, m_data);
444#ifdef EIGEN_HAVE_RVALUE_REFERENCES
447 : m_data(std::move(other.m_data))
448 , m_cols(std::move(other.m_cols))
450 other.m_data =
nullptr;
457 swap(m_data, other.m_data);
458 swap(m_cols, other.m_cols);
468 m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size,
_Rows*m_cols);
473 if(size !=
_Rows*m_cols)
475 internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data,
_Rows*m_cols);
477 m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
480 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
498 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
499 eigen_internal_assert(size==rows*cols && rows>=0 && cols ==
_Cols);
500 EIGEN_UNUSED_VARIABLE(cols);
503 : m_data(internal::conditional_aligned_new_auto<T,(_Options&
DontAlign)==0>(other.m_rows*
_Cols))
504 , m_rows(other.m_rows)
506 internal::smart_copy(other.m_data, other.m_data+other.m_rows*
_Cols, m_data);
517#ifdef EIGEN_HAVE_RVALUE_REFERENCES
520 : m_data(std::move(other.m_data))
521 , m_rows(std::move(other.m_rows))
523 other.m_data =
nullptr;
530 swap(m_data, other.m_data);
531 swap(m_rows, other.m_rows);
539 void conservativeResize(Index size, Index rows, Index)
541 m_data = internal::conditional_aligned_realloc_new_auto<T,(_Options&DontAlign)==0>(m_data, size, m_rows*
_Cols);
546 if(size != m_rows*
_Cols)
548 internal::conditional_aligned_delete_auto<T,(_Options&DontAlign)==0>(m_data,
_Cols*m_rows);
550 m_data = internal::conditional_aligned_new_auto<T,(_Options&DontAlign)==0>(size);
553 EIGEN_INTERNAL_DENSE_STORAGE_CTOR_PLUGIN
@ DontAlign
Don't require alignment for the matrix itself (the array of coefficients, if dynamically allocated,...
Definition Constants.h:326
NLOHMANN_BASIC_JSON_TPL_DECLARATION void swap(nlohmann::NLOHMANN_BASIC_JSON_TPL &j1, nlohmann::NLOHMANN_BASIC_JSON_TPL &j2) noexcept(//NOLINT(readability-inconsistent-declaration-parameter-name, cert-dcl58-cpp) is_nothrow_move_constructible< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value &&//NOLINT(misc-redundant-expression) is_nothrow_move_assignable< nlohmann::NLOHMANN_BASIC_JSON_TPL >::value)
exchanges the values of two JSON objects
Definition json.hpp:24418