PolyFEM
Loading...
Searching...
No Matches
polyfem::mesh::JaggedArray< T > Class Template Reference

Rows of different lengths stored contiguously (compressed rows): row i is data[offsets[i], offsets[i + 1]). More...

#include <Mesh3DStorage.hpp>

Inheritance diagram for polyfem::mesh::JaggedArray< T >:
[legend]

Public Member Functions

int size () const
 Number of rows (a moved-from array has none).
 
bool empty () const
 
size_t n_entries () const
 Total number of entries.
 
ArrayRow< T > operator[] (const int i)
 
ArrayRow< const T > operator[] (const int i) const
 
int row_size (const int i) const
 
void clear ()
 
void reserve (const size_t n_rows, const size_t n_entries)
 
template<typename It >
void push_back (It begin, It end)
 Appends a row.
 
template<typename Range >
void push_back (const Range &row)
 
void push_back (std::initializer_list< T > row)
 
void push_back_filled (const size_t n, const T &value)
 Appends a row of n copies of value.
 
void assign_sizes (const std::vector< uint32_t > &sizes, const T &value=T())
 Replaces the content with rows of the given sizes, filled with value.
 
void append (const JaggedArray &other, const T shift)
 Appends the rows of other, adding shift to every entry.
 
size_t memory () const
 

Private Member Functions

void push_offset ()
 

Private Attributes

std::vector< uint32_t > offsets_ = {0}
 
std::vector< T > data_
 

Detailed Description

template<typename T>
class polyfem::mesh::JaggedArray< T >

Rows of different lengths stored contiguously (compressed rows): row i is data[offsets[i], offsets[i + 1]).

Definition at line 49 of file Mesh3DStorage.hpp.

Member Function Documentation

◆ append()

template<typename T >
void polyfem::mesh::JaggedArray< T >::append ( const JaggedArray< T > &  other,
const T  shift 
)
inline

Appends the rows of other, adding shift to every entry.

Definition at line 109 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, polyfem::mesh::JaggedArray< T >::offsets_, and polyfem::mesh::JaggedArray< T >::size().

Referenced by polyfem::mesh::Mesh3DStorage::append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ assign_sizes()

template<typename T >
void polyfem::mesh::JaggedArray< T >::assign_sizes ( const std::vector< uint32_t > &  sizes,
const T &  value = T() 
)
inline

Replaces the content with rows of the given sizes, filled with value.

Definition at line 99 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, and polyfem::mesh::JaggedArray< T >::offsets_.

Referenced by polyfem::mesh::MeshProcessing3D::build_connectivity().

Here is the caller graph for this function:

◆ clear()

template<typename T >
void polyfem::mesh::JaggedArray< T >::clear ( )
inline

Definition at line 70 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, and polyfem::mesh::JaggedArray< T >::offsets_.

Referenced by polyfem::mesh::CMesh3D::attach_higher_order_nodes(), polyfem::mesh::MeshProcessing3D::build_connectivity(), and polyfem::mesh::MeshProcessing3D::ele_subdivison_levels().

Here is the caller graph for this function:

◆ empty()

template<typename T >
bool polyfem::mesh::JaggedArray< T >::empty ( ) const
inline

Definition at line 54 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::size().

Here is the call graph for this function:

◆ memory()

template<typename T >
size_t polyfem::mesh::JaggedArray< T >::memory ( ) const
inline

Definition at line 122 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, and polyfem::mesh::JaggedArray< T >::offsets_.

Referenced by polyfem::mesh::Mesh3DStorage::memory().

Here is the caller graph for this function:

◆ n_entries()

template<typename T >
size_t polyfem::mesh::JaggedArray< T >::n_entries ( ) const
inline

Total number of entries.

Definition at line 56 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_.

Referenced by polyfem::mesh::JaggedArray< T >::reserve().

Here is the caller graph for this function:

◆ operator[]() [1/2]

template<typename T >
ArrayRow< T > polyfem::mesh::JaggedArray< T >::operator[] ( const int  i)
inline

Definition at line 58 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, polyfem::mesh::JaggedArray< T >::offsets_, and polyfem::mesh::JaggedArray< T >::size().

Here is the call graph for this function:

◆ operator[]() [2/2]

template<typename T >
ArrayRow< const T > polyfem::mesh::JaggedArray< T >::operator[] ( const int  i) const
inline

Definition at line 63 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, polyfem::mesh::JaggedArray< T >::offsets_, and polyfem::mesh::JaggedArray< T >::size().

Here is the call graph for this function:

◆ push_back() [1/3]

template<typename T >
template<typename Range >
void polyfem::mesh::JaggedArray< T >::push_back ( const Range &  row)
inline

Definition at line 89 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::push_back().

Referenced by polyfem::mesh::JaggedArray< T >::push_back().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_back() [2/3]

template<typename T >
template<typename It >
void polyfem::mesh::JaggedArray< T >::push_back ( It  begin,
It  end 
)
inline

Appends a row.

Definition at line 83 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, and polyfem::mesh::JaggedArray< T >::push_offset().

Referenced by polyfem::mesh::MeshProcessing3D::build_connectivity(), polyfem::mesh::CMesh3D::build_storage_from_cells(), polyfem::mesh::CMesh3D::build_topology(), polyfem::mesh::MeshProcessing3D::global_orientation_hexes(), polyfem::mesh::MeshProcessing3D::orient_volume_mesh(), polyfem::mesh::CMesh3D::remove_elements(), and polyfem::mesh::MeshProcessing3D::reorder_hex_mesh_propogation().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_back() [3/3]

template<typename T >
void polyfem::mesh::JaggedArray< T >::push_back ( std::initializer_list< T >  row)
inline

Definition at line 90 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::push_back().

Referenced by polyfem::mesh::JaggedArray< T >::push_back().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_back_filled()

template<typename T >
void polyfem::mesh::JaggedArray< T >::push_back_filled ( const size_t  n,
const T &  value 
)
inline

Appends a row of n copies of value.

Definition at line 92 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, and polyfem::mesh::JaggedArray< T >::push_offset().

Referenced by polyfem::mesh::CMesh3D::build_storage_from_cells().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ push_offset()

template<typename T >
void polyfem::mesh::JaggedArray< T >::push_offset ( )
inlineprivate

Definition at line 125 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, and polyfem::mesh::JaggedArray< T >::offsets_.

Referenced by polyfem::mesh::JaggedArray< T >::push_back(), and polyfem::mesh::JaggedArray< T >::push_back_filled().

Here is the caller graph for this function:

◆ reserve()

template<typename T >
void polyfem::mesh::JaggedArray< T >::reserve ( const size_t  n_rows,
const size_t  n_entries 
)
inline

Definition at line 75 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::data_, polyfem::mesh::JaggedArray< T >::n_entries(), and polyfem::mesh::JaggedArray< T >::offsets_.

Referenced by polyfem::mesh::MeshProcessing3D::build_connectivity().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ row_size()

template<typename T >
int polyfem::mesh::JaggedArray< T >::row_size ( const int  i) const
inline

Definition at line 68 of file Mesh3DStorage.hpp.

References polyfem::mesh::JaggedArray< T >::offsets_.

Referenced by polyfem::mesh::MeshProcessing3D::build_connectivity(), polyfem::mesh::CMesh3D::cell_vertex(), polyfem::mesh::CMesh3D::compute_elements_tag(), polyfem::mesh::Mesh3DStorage::FH(), polyfem::mesh::Mesh3DStorage::FHi(), and polyfem::mesh::MeshProcessing3D::orient_volume_mesh().

Here is the caller graph for this function:

◆ size()

Member Data Documentation

◆ data_

◆ offsets_


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