proxsuite 0.6.7
The Advanced Proximal Optimization Toolbox
Loading...
Searching...
No Matches
proxsuite::linalg::sparse Namespace Reference

Namespaces

namespace  _detail
 
namespace  concepts
 
namespace  tags
 
namespace  util
 

Classes

struct  DenseVecMut
 
struct  DenseVecRef
 
struct  MatMut
 
struct  MatRef
 
struct  SymbolicMatMut
 
struct  SymbolicMatRef
 
struct  VecRef
 

Enumerations

enum struct  Ordering : unsigned char { natural , user_provided , amd , ENUM_END }
 

Functions

 VEG_TAG (from_eigen, FromEigen)
 
template<typename I >
auto transpose_req (proxsuite::linalg::veg::Tag< I >, isize nrows) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename T , typename I >
void transpose (MatMut< T, I > at, MatRef< T, I > a, DynStackMut stack) noexcept(VEG_CONCEPT(nothrow_copyable< T >))
 
template<typename I >
auto transpose_symbolic_req (proxsuite::linalg::veg::Tag< I >, isize nrows) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename I >
void transpose_symbolic (SymbolicMatMut< I > at, SymbolicMatRef< I > a, DynStackMut stack) noexcept
 
template<typename T , typename I >
void dense_lsolve (DenseVecMut< T > x, MatRef< T, I > l) noexcept(false)
 
template<typename T , typename I >
void dense_ltsolve (DenseVecMut< T > x, MatRef< T, I > l) noexcept(false)
 
template<typename I >
auto etree_req (proxsuite::linalg::veg::Tag< I >, isize n) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename I >
VEG_INLINE void etree (I *parent, SymbolicMatRef< I > a, DynStackMut stack) noexcept
 
template<typename I >
auto postorder_req (proxsuite::linalg::veg::Tag< I >, isize n) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename I >
void postorder (I *post, I const *parent, isize n, DynStackMut stack) noexcept
 
template<typename I >
auto column_counts_req (proxsuite::linalg::veg::Tag< I > tag, isize n, isize nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename I >
void column_counts (I *counts, SymbolicMatRef< I > a, I const *parent, I const *post, DynStackMut stack) noexcept
 
template<typename I >
auto amd_req (proxsuite::linalg::veg::Tag< I >, isize, isize nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename I >
void amd (I *perm, SymbolicMatRef< I > mat, DynStackMut stack) noexcept
 
template<typename I >
auto factorize_symbolic_req (proxsuite::linalg::veg::Tag< I > tag, isize n, isize nnz, Ordering o) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename I >
void factorize_symbolic_non_zeros (I *nnz_per_col, I *etree, I *perm_inv, I const *perm, SymbolicMatRef< I > a, DynStackMut stack) noexcept
 
template<typename I >
void factorize_symbolic_col_counts (I *col_ptrs, I *etree, I *perm_inv, I const *perm, SymbolicMatRef< I > a, DynStackMut stack) noexcept
 
template<typename T , typename I >
auto factorize_numeric_req (proxsuite::linalg::veg::Tag< T >, proxsuite::linalg::veg::Tag< I >, isize n, isize a_nnz, Ordering o) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename T , typename I >
void factorize_numeric (T *values, I *row_indices, proxsuite::linalg::veg::DoNotDeduce< T const * > diag_to_add, proxsuite::linalg::veg::DoNotDeduce< I const * > perm, I const *col_ptrs, I const *etree, I const *perm_inv, MatRef< T, I > a, DynStackMut stack) noexcept(false)
 
template<typename T , typename I >
auto delete_row_req (proxsuite::linalg::veg::Tag< T >, proxsuite::linalg::veg::Tag< I >, isize n, isize max_nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename T , typename I >
auto delete_row (MatMut< T, I > ld, I *etree, I const *perm_inv, isize pos, DynStackMut stack) noexcept(false) -> MatMut< T, I >
 
template<typename T , typename I >
auto add_row_req (proxsuite::linalg::veg::Tag< T >, proxsuite::linalg::veg::Tag< I >, isize n, bool id_perm, isize nnz, isize max_nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename T , typename I >
auto add_row (MatMut< T, I > ld, I *etree, I const *perm_inv, isize pos, VecRef< T, I > new_col, proxsuite::linalg::veg::DoNotDeduce< T > diag_element, DynStackMut stack) noexcept(false) -> MatMut< T, I >
 
template<typename I >
auto merge_second_col_into_first_req (proxsuite::linalg::veg::Tag< I >, isize second_size) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename T , typename I >
auto merge_second_col_into_first (I *difference, T *first_values, I *first_ptr, PROXSUITE_MAYBE_UNUSED isize first_full_len, isize first_initial_len, Slice< I > second, proxsuite::linalg::veg::DoNotDeduce< I > ignore_threshold_inclusive, bool move_values, DynStackMut stack) noexcept(false) -> proxsuite::linalg::veg::Tuple< SliceMut< T >, SliceMut< I >, SliceMut< I > >
 
template<typename T , typename I >
auto rank1_update_req (proxsuite::linalg::veg::Tag< T >, proxsuite::linalg::veg::Tag< I >, isize n, bool id_perm, isize col_nnz) noexcept -> proxsuite::linalg::veg::dynstack::StackReq
 
template<typename T , typename I >
auto rank1_update (MatMut< T, I > ld, I *etree, I const *perm_inv, VecRef< T, I > w, proxsuite::linalg::veg::DoNotDeduce< T > alpha, DynStackMut stack) noexcept(false) -> MatMut< T, I >
 

Enumeration Type Documentation

◆ Ordering

Enumerator
natural 
user_provided 
amd 
ENUM_END 

Definition at line 915 of file factorize.hpp.

Function Documentation

◆ transpose_req()

template<typename I >
auto proxsuite::linalg::sparse::transpose_req ( proxsuite::linalg::veg::Tag< I > ,
isize nrows ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Definition at line 17 of file factorize.hpp.

◆ transpose()

template<typename T , typename I >
void proxsuite::linalg::sparse::transpose ( MatMut< T, I > at,
MatRef< T, I > a,
DynStackMut stack )
noexcept

Definition at line 26 of file factorize.hpp.

◆ transpose_symbolic_req()

template<typename I >
auto proxsuite::linalg::sparse::transpose_symbolic_req ( proxsuite::linalg::veg::Tag< I > ,
isize nrows ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Definition at line 86 of file factorize.hpp.

◆ transpose_symbolic()

template<typename I >
void proxsuite::linalg::sparse::transpose_symbolic ( SymbolicMatMut< I > at,
SymbolicMatRef< I > a,
DynStackMut stack )
noexcept

Definition at line 95 of file factorize.hpp.

◆ dense_lsolve()

template<typename T , typename I >
void proxsuite::linalg::sparse::dense_lsolve ( DenseVecMut< T > x,
MatRef< T, I > l )

l is unit lower triangular whose diagonal elements are ignored. Solves l×y = x and store the solution in x.

Parameters
xRHS of the system, solution storage.
lmatrix to be inverted.

Definition at line 149 of file factorize.hpp.

◆ dense_ltsolve()

template<typename T , typename I >
void proxsuite::linalg::sparse::dense_ltsolve ( DenseVecMut< T > x,
MatRef< T, I > l )

l is unit lower triangular whose diagonal elements are ignored. Solves l.T×y = x and store the solution in x.

Parameters
xRHS of the system, solution storage.
lmatrix to be inverted.

Definition at line 188 of file factorize.hpp.

◆ etree_req()

template<typename I >
auto proxsuite::linalg::sparse::etree_req ( proxsuite::linalg::veg::Tag< I > ,
isize n ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Computes the stack memory requirements of etree computation.

Parameters
ndimension of the matrix.

Definition at line 252 of file factorize.hpp.

◆ etree()

template<typename I >
VEG_INLINE void proxsuite::linalg::sparse::etree ( I * parent,
SymbolicMatRef< I > a,
DynStackMut stack )
noexcept

Computes the elimination tree of the cholesky factor of a of size n. a is considered symmetric but should only contain terms from the upper triangular part.

Parameters
parentpointer to the elimination tree storage, of size n.
asymbolic structure of the matrix to be factorized.
stacktemporary allocation stack

Definition at line 269 of file factorize.hpp.

◆ postorder_req()

template<typename I >
auto proxsuite::linalg::sparse::postorder_req ( proxsuite::linalg::veg::Tag< I > ,
isize n ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Computes the memory requirements of the postordering of the cholesky factorization.

Parameters
ndimension of the matrix to be factorized.

Definition at line 459 of file factorize.hpp.

◆ postorder()

template<typename I >
void proxsuite::linalg::sparse::postorder ( I * post,
I const * parent,
isize n,
DynStackMut stack )
noexcept

Computes the postordering of the cholesky factorization of dimension n.

Parameters
poststorage for the postordering, of size n
parentpointer to the elimination tree
ndimension of the matrix to be factorized
stacktemporary allocation stack

Definition at line 475 of file factorize.hpp.

◆ column_counts_req()

template<typename I >
auto proxsuite::linalg::sparse::column_counts_req ( proxsuite::linalg::veg::Tag< I > tag,
isize n,
isize nnz ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Definition at line 582 of file factorize.hpp.

◆ column_counts()

template<typename I >
void proxsuite::linalg::sparse::column_counts ( I * counts,
SymbolicMatRef< I > a,
I const * parent,
I const * post,
DynStackMut stack )
noexcept

Definition at line 596 of file factorize.hpp.

◆ amd_req()

template<typename I >
auto proxsuite::linalg::sparse::amd_req ( proxsuite::linalg::veg::Tag< I > ,
isize ,
isize nnz ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Definition at line 719 of file factorize.hpp.

◆ amd()

template<typename I >
void proxsuite::linalg::sparse::amd ( I * perm,
SymbolicMatRef< I > mat,
DynStackMut stack )
noexcept

Definition at line 728 of file factorize.hpp.

◆ factorize_symbolic_req()

template<typename I >
auto proxsuite::linalg::sparse::factorize_symbolic_req ( proxsuite::linalg::veg::Tag< I > tag,
isize n,
isize nnz,
Ordering o ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Computes the stack memory requirements of symbolic factorization.

Parameters
ndimension of the matrix to be factorized.
nnznumber of non zeros of the matrix to be factorized.
othe kind of permutation that is applied to the matrix before factorization.

Definition at line 933 of file factorize.hpp.

◆ factorize_symbolic_non_zeros()

template<typename I >
void proxsuite::linalg::sparse::factorize_symbolic_non_zeros ( I * nnz_per_col,
I * etree,
I * perm_inv,
I const * perm,
SymbolicMatRef< I > a,
DynStackMut stack )
noexcept

Performs symbolic factorization and computed the number of non-zeros in each column of the cholesky factor of dimension n.

Parameters
nnz_per_colstorage for non-zeros per column, of size n
etreestorage for elimination tree, of size n
perm_invstorage for inverse permutation, of size n
permoptionally user-provided permutation, either null or of size n
amatrix to be symbolically factorized
stacktemporary allocation stack

Definition at line 987 of file factorize.hpp.

◆ factorize_symbolic_col_counts()

template<typename I >
void proxsuite::linalg::sparse::factorize_symbolic_col_counts ( I * col_ptrs,
I * etree,
I * perm_inv,
I const * perm,
SymbolicMatRef< I > a,
DynStackMut stack )
noexcept

Performs symbolic factorization and computed the column pointers for each column of the cholesky factor of dimension n.

Parameters
col_ptrsstorage for column pointers, of size n + 1
etreestorage for elimination tree, of size n
perm_invstorage for inverse permutation, of size n
permoptionally user-provided permutation, either null or of size n
amatrix to be symbolically factorized
stacktemporary allocation stack

Definition at line 1076 of file factorize.hpp.

◆ factorize_numeric_req()

template<typename T , typename I >
auto proxsuite::linalg::sparse::factorize_numeric_req ( proxsuite::linalg::veg::Tag< T > ,
proxsuite::linalg::veg::Tag< I > ,
isize n,
isize a_nnz,
Ordering o ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Computes the stack memory requirements of numerical factorization.

Parameters
ndimension of the matrix to be factorized.
a_nnznumber of non zeros of the matrix to be factorized.
othe kind of permutation that is applied to the matrix before factorization.

Definition at line 1111 of file factorize.hpp.

◆ factorize_numeric()

template<typename T , typename I >
void proxsuite::linalg::sparse::factorize_numeric ( T * values,
I * row_indices,
proxsuite::linalg::veg::DoNotDeduce< T const * > diag_to_add,
proxsuite::linalg::veg::DoNotDeduce< I const * > perm,
I const * col_ptrs,
I const * etree,
I const * perm_inv,
MatRef< T, I > a,
DynStackMut stack )

Performs numerical LDLT factorization, assuming the symbolic factorization and column counts have already been computed. L and D are stored in the same matrix, with the elements of D replacing the implicit diagonal 1 element of each column of L.

Parameters
valuespointer to the values of the factorization
row_indicespointer to the row indices of the factorization
diag_to_addpointer to a vector that is added to the diagonal of the matrix during factorization, if diag_to_add and perm are both non null
permpointer to the pre-computed permutation that is applied to diag.
col_ptrspointer to the already computed column pointers
etreepointer to the already computed elimination tree
perm_invpointer to the already computed inverse permutation. Must be the inverse of perm
amatrix to be factorized
stacktemporary allocation stack

Definition at line 1159 of file factorize.hpp.

◆ delete_row_req()

template<typename T , typename I >
auto proxsuite::linalg::sparse::delete_row_req ( proxsuite::linalg::veg::Tag< T > ,
proxsuite::linalg::veg::Tag< I > ,
isize n,
isize max_nnz ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Computes the memory requirements for deleting a row and column for the ldlt factors

Parameters
n: dimension of the matrix
max_nnz: upper bound of non zero counts over the columns of the matrix. n is always a valid value.

Definition at line 25 of file rowmod.hpp.

◆ delete_row()

template<typename T , typename I >
auto proxsuite::linalg::sparse::delete_row ( MatMut< T, I > ld,
I * etree,
I const * perm_inv,
isize pos,
DynStackMut stack ) -> MatMut<T, I>

Given the ldlt factors of matrix a, computes the ldlt factors of the matrix a with row and column at position pos replaced by those of the identity matrix It returns a view of the updated factors.

Parameters
ld: the ldlt factors
etreepointer to the elimination tree
perm_invpointer to inverse permutation (for ex AMD). If this is null, the permutation is assumed to be the identity.
posposition of the row and column to be deleted
stackis the memory stack

Definition at line 52 of file rowmod.hpp.

◆ add_row_req()

template<typename T , typename I >
auto proxsuite::linalg::sparse::add_row_req ( proxsuite::linalg::veg::Tag< T > ,
proxsuite::linalg::veg::Tag< I > ,
isize n,
bool id_perm,
isize nnz,
isize max_nnz ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Computes the memory requirements for adding a row and column for the ldlt factors

Parameters
n: dimension of the matrix
id_perm: whether the permutation corresponds to the identity
nnz: number of non zero elements in the added vector
max_nnz: upper bound of non zero counts over the columns of the matrix. n is always a valid value.

Definition at line 143 of file rowmod.hpp.

◆ add_row()

template<typename T , typename I >
auto proxsuite::linalg::sparse::add_row ( MatMut< T, I > ld,
I * etree,
I const * perm_inv,
isize pos,
VecRef< T, I > new_col,
proxsuite::linalg::veg::DoNotDeduce< T > diag_element,
DynStackMut stack ) -> MatMut<T, I>

Given the ldlt factors of matrix a, computes the ldlt factors of the matrix a with added row and column at position pos. It is assumed that the row and column are empty except the diagonal element. It returns a view of the updated factors.

Parameters
ld: the ldlt factors
etreepointer to the elimination tree
perm_invpointer to inverse permutation (for ex AMD). If this is null, the permutation is assumed to be the identity.
posposition of the row and column to be added
new_col: new column to be added without the diagonal element (of size nnz-1)
diag_element: diagonal element of the added row and column
stackis the memory stack

Definition at line 190 of file rowmod.hpp.

◆ merge_second_col_into_first_req()

template<typename I >
auto proxsuite::linalg::sparse::merge_second_col_into_first_req ( proxsuite::linalg::veg::Tag< I > ,
isize second_size ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Definition at line 21 of file update.hpp.

◆ merge_second_col_into_first()

template<typename T , typename I >
auto proxsuite::linalg::sparse::merge_second_col_into_first ( I * difference,
T * first_values,
I * first_ptr,
PROXSUITE_MAYBE_UNUSED isize first_full_len,
isize first_initial_len,
Slice< I > second,
proxsuite::linalg::veg::DoNotDeduce< I > ignore_threshold_inclusive,
bool move_values,
DynStackMut stack ) -> proxsuite::linalg::veg::Tuple<SliceMut<T>, SliceMut<I>, SliceMut<I>>

Definition at line 33 of file update.hpp.

◆ rank1_update_req()

template<typename T , typename I >
auto proxsuite::linalg::sparse::rank1_update_req ( proxsuite::linalg::veg::Tag< T > ,
proxsuite::linalg::veg::Tag< I > ,
isize n,
bool id_perm,
isize col_nnz ) -> proxsuite::linalg::veg::dynstack::StackReq
noexcept

Computes the memory requirements for rank one update.

Parameters
ndimension of matrix
id_permwhether the permutation is implicitly the identity or not
col_nnznumber of nnz elts in the update vector

Definition at line 170 of file update.hpp.

◆ rank1_update()

template<typename T , typename I >
auto proxsuite::linalg::sparse::rank1_update ( MatMut< T, I > ld,
I * etree,
I const * perm_inv,
VecRef< T, I > w,
proxsuite::linalg::veg::DoNotDeduce< T > alpha,
DynStackMut stack ) -> MatMut<T, I>

Performs a rank one update in place. Given ldlt factor l, and d, of a matrix a, this computes the ldlt factors of a + alpha w w.T It returns a view on the updated factors.

Parameters
ld: ldlt factors of a (lower triangular with d on the diagonal)
etreepointer to the elimination tree
perm_invpointer to inverse permutation (for ex AMD). If this is null, the permutation is assumed to be the identity.
wis the update vector
alphais the update coefficient
stackis the memory stack

Definition at line 207 of file update.hpp.