proxsuite 0.6.7
The Advanced Proximal Optimization Toolbox
Loading...
Searching...
No Matches
core.hpp File Reference
#include <proxsuite/linalg/veg/util/dbg.hpp>
#include <proxsuite/linalg/veg/util/assert.hpp>
#include <proxsuite/linalg/veg/memory/dynamic_stack.hpp>
#include <immintrin.h>
#include <Eigen/Core>
Include dependency graph for core.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  proxsuite::linalg::dense::_detail::_simd::Pack< T, 1 >
 
struct  proxsuite::linalg::dense::_detail::_simd::NativePackInfo< T >
 
struct  proxsuite::linalg::dense::_detail::NoCopy
 
struct  proxsuite::linalg::dense::_detail::nb::max2
 
struct  proxsuite::linalg::dense::_detail::nb::min2
 
struct  proxsuite::linalg::dense::_detail::ElemAddrImpl< false >
 
struct  proxsuite::linalg::dense::_detail::ElemAddrImpl< true >
 
struct  proxsuite::linalg::dense::_detail::RowColAccessImpl< true >
 
struct  proxsuite::linalg::dense::_detail::RowColAccessImpl< false >
 

Namespaces

namespace  proxsuite
 
namespace  proxsuite::linalg
 
namespace  proxsuite::linalg::dense
 
namespace  proxsuite::linalg::dense::_detail
 
namespace  proxsuite::linalg::dense::_detail::_simd
 
namespace  proxsuite::linalg::dense::_detail::nb
 
namespace  proxsuite::linalg::dense::util
 

Macros

#define LDLT_ID(id)   __VEG_PP_CAT(id, __LINE__)
 
#define __LDLT_TEMP_VEC_IMPL(Type, Name, Rows, Stack, Make)
 
#define __LDLT_TEMP_MAT_IMPL(Type, Name, Rows, Cols, Stack, Make)
 
#define LDLT_TEMP_VEC(Type, Name, Rows, Stack)    __LDLT_TEMP_VEC_IMPL(Type, Name, Rows, Stack, make_new)
 
#define LDLT_TEMP_VEC_UNINIT(Type, Name, Rows, Stack)    __LDLT_TEMP_VEC_IMPL(Type, Name, Rows, Stack, make_new_for_overwrite)
 
#define LDLT_TEMP_MAT(Type, Name, Rows, Cols, Stack)    __LDLT_TEMP_MAT_IMPL(Type, Name, Rows, Cols, Stack, make_new)
 
#define LDLT_TEMP_MAT_UNINIT(Type, Name, Rows, Cols, Stack)    __LDLT_TEMP_MAT_IMPL(Type, Name, Rows, Cols, Stack, make_new_for_overwrite)
 
#define DENSE_LDLT_FP_PRAGMA
 
#define LDLT_FN_IMPL3(Fn, Prefix, Suffix)
 
#define LDLT_ARITHMETIC_IMPL(Prefix, Suffix)
 
#define LDLT_LOAD_STORE(Prefix, Suffix)
 
#define LAZY_PRODUCT(a, b)   a.lazyProduct(b)
 

Typedefs

using proxsuite::linalg::dense::f32 = float
 
using proxsuite::linalg::dense::f64 = double
 
template<typename T >
using proxsuite::linalg::dense::_detail::_simd::NativePack = typename NativePackInfo<T>::Type
 
template<bool COND, typename T >
using proxsuite::linalg::dense::_detail::const_if = proxsuite::linalg::veg::meta::if_t<COND, T const, T>
 
template<typename T >
using proxsuite::linalg::dense::_detail::ptr_is_const
 
template<typename T >
using proxsuite::linalg::dense::_detail::should_vectorize = proxsuite::linalg::veg::meta::bool_constant<false>
 
template<typename T >
using proxsuite::linalg::dense::_detail::OwnedMatrix
 
template<typename T >
using proxsuite::linalg::dense::_detail::OwnedAll
 
template<typename T >
using proxsuite::linalg::dense::_detail::OwnedRows
 
template<typename T >
using proxsuite::linalg::dense::_detail::OwnedCols
 
template<typename T >
using proxsuite::linalg::dense::_detail::OwnedColVector
 
template<typename T >
using proxsuite::linalg::dense::_detail::OwnedRowVector
 
template<typename T >
using proxsuite::linalg::dense::_detail::StrideOf
 

Functions

template<typename T >
constexpr auto proxsuite::linalg::dense::_detail::round_up (T a, T b) noexcept -> T
 
template<typename T >
auto proxsuite::linalg::dense::_detail::adjusted_stride (isize n) noexcept -> isize
 
template<typename T >
auto proxsuite::linalg::dense::_detail::align () noexcept -> isize
 
 proxsuite::linalg::dense::_detail::VEG_NIEBLOID (min2)
 
 proxsuite::linalg::dense::_detail::VEG_NIEBLOID (max2)
 
template<typename T >
void proxsuite::linalg::dense::_detail::set_zero (T *dest, usize n)
 
template<bool COLMAJOR, typename T >
auto proxsuite::linalg::dense::util::elem_addr (T *ptr, isize row, isize col, isize outer_stride, isize inner_stride) noexcept -> T *
 
template<typename Mat >
auto proxsuite::linalg::dense::util::matrix_elem_addr (Mat &&mat, isize row, isize col) noexcept -> decltype(mat.data())
 
template<typename T >
auto proxsuite::linalg::dense::util::col (T &&mat, isize col_idx) noexcept -> typename _detail::RowColAccessImpl< !bool(proxsuite::linalg::veg::uncvref_t< T >::IsRowMajor)>::template Col< T >
 
template<typename T >
auto proxsuite::linalg::dense::util::row (T &&mat, isize row_idx) noexcept -> typename _detail::RowColAccessImpl< !bool(proxsuite::linalg::veg::uncvref_t< T >::IsRowMajor)>::template Row< T >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::trans (Mat &&mat) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, Eigen::Matrix< typename proxsuite::linalg::veg::uncvref_t< Mat >::Scalar, proxsuite::linalg::veg::uncvref_t< Mat >::ColsAtCompileTime, proxsuite::linalg::veg::uncvref_t< Mat >::RowsAtCompileTime, bool(proxsuite::linalg::veg::uncvref_t< Mat >::IsRowMajor) ? Eigen::ColMajor :Eigen::RowMajor > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::diagonal (Mat &&mat) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, Eigen::Matrix< typename proxsuite::linalg::veg::uncvref_t< Mat >::Scalar, Eigen::Dynamic, 1, Eigen::ColMajor > >, Eigen::Unaligned, Eigen::InnerStride< Eigen::Dynamic > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::submatrix (Mat &&mat, isize row_start, isize col_start, isize nrows, isize ncols) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, _detail::OwnedMatrix< proxsuite::linalg::veg::uncvref_t< Mat > > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::to_view (Mat &&mat) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, _detail::OwnedAll< proxsuite::linalg::veg::uncvref_t< Mat > > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::to_view_dyn_rows (Mat &&mat) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, _detail::OwnedRows< proxsuite::linalg::veg::uncvref_t< Mat > > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::to_view_dyn_cols (Mat &&mat) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, _detail::OwnedCols< proxsuite::linalg::veg::uncvref_t< Mat > > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::to_view_dyn (Mat &&mat) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, _detail::OwnedMatrix< proxsuite::linalg::veg::uncvref_t< Mat > > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::subrows (Mat &&mat, isize row_start, isize nrows) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, _detail::OwnedRows< proxsuite::linalg::veg::uncvref_t< Mat > > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Mat >
auto proxsuite::linalg::dense::util::subcols (Mat &&mat, isize col_start, isize ncols) noexcept -> Eigen::Map< _detail::const_if< _detail::ptr_is_const< decltype(mat.data())>::value, _detail::OwnedCols< proxsuite::linalg::veg::uncvref_t< Mat > > >, Eigen::Unaligned, _detail::StrideOf< proxsuite::linalg::veg::uncvref_t< Mat > > >
 
template<typename Dst , typename Lhs , typename Rhs , typename T >
void proxsuite::linalg::dense::_detail::noalias_mul_add_impl (Dst dst, Lhs lhs, Rhs rhs, T factor)
 
template<typename Dst , typename Lhs , typename Rhs , typename T >
void proxsuite::linalg::dense::util::noalias_mul_add (Dst &&dst, Lhs const &lhs, Rhs const &rhs, T factor)
 
template<typename T >
auto proxsuite::linalg::dense::temp_mat_req (proxsuite::linalg::veg::Tag< T >, isize rows, isize cols) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename T >
auto proxsuite::linalg::dense::temp_vec_req (proxsuite::linalg::veg::Tag< T >, isize rows) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 

Macro Definition Documentation

◆ LDLT_ID

#define LDLT_ID ( id)    __VEG_PP_CAT(id, __LINE__)

Definition at line 25 of file core.hpp.

◆ __LDLT_TEMP_VEC_IMPL

#define __LDLT_TEMP_VEC_IMPL ( Type,
Name,
Rows,
Stack,
Make )
Value:
auto LDLT_ID(vec_storage) = (Stack).Make( \
(Rows), \
Type)>()); \
auto Name /* NOLINT */ = ::Eigen::Map< \
::Eigen::Matrix<__VEG_PP_REMOVE_PAREN(Type), ::Eigen::Dynamic, 1>, \
::Eigen::Unaligned, \
::Eigen::Stride<::Eigen::Dynamic, 1>>{ \
LDLT_ID(vec_storage).ptr_mut(), \
LDLT_ID(vec_storage).len(), \
::Eigen::Stride<::Eigen::Dynamic, 1>{ \
LDLT_ID(vec_storage).len(), \
1, \
}, \
}; \
static_assert(true, ".")
#define LDLT_ID(id)
Definition core.hpp:25
auto align() noexcept -> isize
Definition core.hpp:340
#define __VEG_PP_REMOVE_PAREN(...)

Definition at line 27 of file core.hpp.

◆ __LDLT_TEMP_MAT_IMPL

#define __LDLT_TEMP_MAT_IMPL ( Type,
Name,
Rows,
Cols,
Stack,
Make )
Value:
__VEG_PP_REMOVE_PAREN(Type)>(LDLT_ID(rows)); \
auto LDLT_ID(vec_storage) = (Stack).Make( \
LDLT_ID(stride) * LDLT_ID(cols), \
Type)>()); \
auto Name /* NOLINT */ = \
::Eigen::Map<::Eigen::Matrix<__VEG_PP_REMOVE_PAREN(Type), \
::Eigen::Dynamic, \
::Eigen::Dynamic, \
::Eigen::ColMajor>, \
::Eigen::Unaligned, \
::Eigen::Stride<::Eigen::Dynamic, 1>>{ \
LDLT_ID(vec_storage).ptr_mut(), \
LDLT_ID(rows), \
LDLT_ID(cols), \
::Eigen::Stride<::Eigen::Dynamic, 1>{ \
LDLT_ID(stride), \
1, \
}, \
}; \
static_assert(true, ".")
auto adjusted_stride(isize n) noexcept -> isize
Definition core.hpp:327
_detail::_meta::make_signed< usize >::Type isize
Definition typedefs.hpp:43

Definition at line 46 of file core.hpp.

◆ LDLT_TEMP_VEC

#define LDLT_TEMP_VEC ( Type,
Name,
Rows,
Stack )    __LDLT_TEMP_VEC_IMPL(Type, Name, Rows, Stack, make_new)

Definition at line 74 of file core.hpp.

◆ LDLT_TEMP_VEC_UNINIT

#define LDLT_TEMP_VEC_UNINIT ( Type,
Name,
Rows,
Stack )    __LDLT_TEMP_VEC_IMPL(Type, Name, Rows, Stack, make_new_for_overwrite)

Definition at line 76 of file core.hpp.

◆ LDLT_TEMP_MAT

#define LDLT_TEMP_MAT ( Type,
Name,
Rows,
Cols,
Stack )    __LDLT_TEMP_MAT_IMPL(Type, Name, Rows, Cols, Stack, make_new)

Definition at line 79 of file core.hpp.

◆ LDLT_TEMP_MAT_UNINIT

#define LDLT_TEMP_MAT_UNINIT ( Type,
Name,
Rows,
Cols,
Stack )    __LDLT_TEMP_MAT_IMPL(Type, Name, Rows, Cols, Stack, make_new_for_overwrite)

Definition at line 81 of file core.hpp.

◆ DENSE_LDLT_FP_PRAGMA

#define DENSE_LDLT_FP_PRAGMA

Definition at line 100 of file core.hpp.

◆ LDLT_FN_IMPL3

#define LDLT_FN_IMPL3 ( Fn,
Prefix,
Suffix )
Value:
VEG_INLINE static auto Fn(Pack a, Pack b, Pack c) noexcept -> Pack \
{ \
return Pack{ simde_mm##Prefix##_##Fn##_##Suffix( \
a.inner, b.inner, c.inner) }; \
} \
#define VEG_INLINE
Definition macros.hpp:118
#define VEG_NOM_SEMICOLON
Definition macros.hpp:600

Definition at line 107 of file core.hpp.

◆ LDLT_ARITHMETIC_IMPL

#define LDLT_ARITHMETIC_IMPL ( Prefix,
Suffix )
Value:
LDLT_FN_IMPL3(fmadd, Prefix, Suffix); /* (a * b + c) */ \
LDLT_FN_IMPL3(fnmadd, Prefix, Suffix); /* (-a * b + c) */
#define LDLT_FN_IMPL3(Fn, Prefix, Suffix)
Definition core.hpp:107

Definition at line 115 of file core.hpp.

◆ LDLT_LOAD_STORE

#define LDLT_LOAD_STORE ( Prefix,
Suffix )
Value:
VEG_INLINE static auto load_unaligned( \
ScalarType const* ptr) noexcept -> Pack \
{ \
return Pack{ simde_mm##Prefix##_loadu_##Suffix(ptr) }; \
} \
VEG_INLINE static auto broadcast(ScalarType value) noexcept -> Pack \
{ \
return Pack{ simde_mm##Prefix##_set1_##Suffix(value) }; \
} \
VEG_INLINE void store_unaligned(ScalarType* ptr) const noexcept \
{ \
simde_mm##Prefix##_storeu_##Suffix(ptr, inner); \
} \

Definition at line 119 of file core.hpp.

◆ LAZY_PRODUCT

#define LAZY_PRODUCT ( a,
b )   a.lazyProduct(b)