Turi Create  4.0
turi::sparse_sim::dense_triangular_itemitem_container< T > Class Template Reference

#include <toolkits/sparse_similarity/sliced_itemitem_matrix.hpp>

Public Member Functions

void clear ()
 
void reserve (size_t n_elements)
 
void resize (size_t _num_rows, size_t _num_cols)
 
value_type & operator() (size_t row_idx, size_t col_idx)
 
const value_type & operator() (size_t i, size_t j) const
 
template<typename ApplyFunction >
GL_HOT_INLINE_FLATTEN void apply (size_t idx_1, size_t idx_2, ApplyFunction &&apply_f)
 
template<typename ProcessValueFunction >
void apply_all (ProcessValueFunction &&process_interaction)
 

Detailed Description

template<typename T>
class turi::sparse_sim::dense_triangular_itemitem_container< T >

A container to hold a slice of rows of an upper triangular dense matrix. All accesses assume that row_idx < col_idx, and only data conforming to this is stored. In addition, num_rows <= num_cols.

This class is a minimal wrapper around a vector in order to mimic the interface of the sparse item by item array. This has the same interface as the symmetric_2d_array class.

Definition at line 39 of file sliced_itemitem_matrix.hpp.

Member Function Documentation

◆ apply()

template<typename T >
template<typename ApplyFunction >
GL_HOT_INLINE_FLATTEN void turi::sparse_sim::dense_triangular_itemitem_container< T >::apply ( size_t  idx_1,
size_t  idx_2,
ApplyFunction &&  apply_f 
)
inline

Apply a function to a particular element. The apply_f has

Definition at line 103 of file sliced_itemitem_matrix.hpp.

◆ apply_all()

template<typename T >
template<typename ProcessValueFunction >
void turi::sparse_sim::dense_triangular_itemitem_container< T >::apply_all ( ProcessValueFunction &&  process_interaction)
inline

Process all the elements currently in this container.

Definition at line 111 of file sliced_itemitem_matrix.hpp.

◆ clear()

template<typename T >
void turi::sparse_sim::dense_triangular_itemitem_container< T >::clear ( )
inline

Clears all the data and the values, and resets the number of rows and columns to 0.

Definition at line 59 of file sliced_itemitem_matrix.hpp.

◆ operator()() [1/2]

template<typename T >
value_type& turi::sparse_sim::dense_triangular_itemitem_container< T >::operator() ( size_t  row_idx,
size_t  col_idx 
)
inline

Indexible access.

Definition at line 87 of file sliced_itemitem_matrix.hpp.

◆ operator()() [2/2]

template<typename T >
const value_type& turi::sparse_sim::dense_triangular_itemitem_container< T >::operator() ( size_t  i,
size_t  j 
) const
inline

Indexible access. Const overload

Definition at line 94 of file sliced_itemitem_matrix.hpp.

◆ reserve()

template<typename T >
void turi::sparse_sim::dense_triangular_itemitem_container< T >::reserve ( size_t  n_elements)
inline

Reserve a fixed number of elements.

Definition at line 67 of file sliced_itemitem_matrix.hpp.

◆ resize()

template<typename T >
void turi::sparse_sim::dense_triangular_itemitem_container< T >::resize ( size_t  _num_rows,
size_t  _num_cols 
)
inline

Resize and clear the data.

Definition at line 76 of file sliced_itemitem_matrix.hpp.


The documentation for this class was generated from the following file: