Lagrange
Loading...
Searching...
No Matches
EigenArray< _EigenType > Class Template Reference

This class is a thin wrapper around an Eigen matrix. More...

#include <lagrange/experimental/Array.h>

Inheritance diagram for EigenArray< _EigenType >:
ArrayBase

Public Types

using EigenType = _EigenType
 
using Self = EigenArray<EigenType>
 
using Index = ArrayBase::Index
 
using WeightedIndexFunction
 
- Public Types inherited from ArrayBase
using Index = Eigen::Index
 
using IndexFunction = std::function<Index(Index)>
 
using WeightedIndexFunction
 

Public Member Functions

template<typename T>
 EigenArray (const Eigen::MatrixBase< T > &data)
 
template<typename T>
 EigenArray (Eigen::MatrixBase< T > &&data)
 
std::any get_type_info () const override
 
EigenType & get_ref ()
 
const EigenType & get_ref () const
 
template<typename Derived>
void set (Derived &&data)
 
Index rows () const override
 
Index cols () const override
 
bool is_row_major () const override
 
void * data () override
 
const void * data () const override
 
void resize (Index r, Index c) override
 
std::unique_ptr< ArrayBaseclone () const override
 
std::unique_ptr< ArrayBaserow_slice (Index num_rows, const IndexFunction &mapping_fn) const override
 Using index function for row mapping.
 
std::unique_ptr< ArrayBaserow_slice (Index num_rows, const WeightedIndexFunction &mapping_fn) const override
 This is the most generic version of row_slice method.
 
std::string type_name () const override
 
- Public Member Functions inherited from ArrayBase
 ArrayBase (ScalarEnum type)
 
template<typename TargetType>
Eigen::Map< TargetType > view ()
 
template<typename TargetType>
Eigen::Map< const TargetType > view () const
 
template<typename Derived>
bool is_base_of () const
 
template<typename DerivedPtr>
auto down_cast () -> std::add_pointer_t< std::decay_t< std::remove_pointer_t< DerivedPtr > > >
 
template<typename DerivedPtr>
auto down_cast () const -> std::add_pointer_t< std::add_const_t< std::decay_t< std::remove_pointer_t< DerivedPtr > > > >
 
template<typename Derived>
void set (const Eigen::MatrixBase< Derived > &data)
 
template<typename Derived>
void set (Eigen::MatrixBase< Derived > &&data)
 
ScalarEnum get_scalar_type () const
 
template<typename TargetType>
const auto & get () const
 
template<typename TargetType>
auto & get ()
 
template<typename Scalar>
Scalardata ()
 
template<typename Scalar>
const Scalardata () const
 
template<typename T>
std::unique_ptr< ArrayBaserow_slice (const std::vector< T > &row_indices) const
 

Additional Inherited Members

- Protected Member Functions inherited from ArrayBase
template<typename TargetType>
bool is_compatible (bool ignore_storage_order=false) const
 
- Static Protected Member Functions inherited from ArrayBase
template<typename Derived>
static std::unique_ptr< ArrayBaserow_slice_impl (const Eigen::MatrixBase< Derived > &matrix, Index num_rows, const IndexFunction &mapping)
 
template<typename Derived>
static std::enable_if_t< std::is_integral< typename Derived::Scalar >::value, std::unique_ptr< ArrayBase > > row_slice_impl (const Eigen::MatrixBase< Derived > &matrix, Index num_rows, const WeightedIndexFunction &mapping)
 
template<typename Derived>
static std::enable_if_t<!std::is_integral< typename Derived::Scalar >::value, std::unique_ptr< ArrayBase > > row_slice_impl (const Eigen::MatrixBase< Derived > &matrix, Index num_rows, const WeightedIndexFunction &mapping)
 
- Protected Attributes inherited from ArrayBase
const ScalarEnum m_scalar_type
 

Detailed Description

template<typename _EigenType>
class lagrange::experimental::EigenArray< _EigenType >

This class is a thin wrapper around an Eigen matrix.

It takes ownership of the Eigen matrix.

Member Function Documentation

◆ get_type_info()

template<typename _EigenType>
std::any get_type_info ( ) const
inlineoverridevirtual

Implements ArrayBase.

◆ rows()

template<typename _EigenType>
Index rows ( ) const
inlineoverridevirtual

Implements ArrayBase.

◆ cols()

template<typename _EigenType>
Index cols ( ) const
inlineoverridevirtual

Implements ArrayBase.

◆ is_row_major()

template<typename _EigenType>
bool is_row_major ( ) const
inlineoverridevirtual

Implements ArrayBase.

◆ data() [1/2]

template<typename _EigenType>
void * data ( )
inlineoverridevirtual

Implements ArrayBase.

◆ data() [2/2]

template<typename _EigenType>
const void * data ( ) const
inlineoverridevirtual

Implements ArrayBase.

◆ resize()

template<typename _EigenType>
void resize ( Index r,
Index c )
inlineoverridevirtual

Implements ArrayBase.

◆ clone()

template<typename _EigenType>
std::unique_ptr< ArrayBase > clone ( ) const
inlineoverridevirtual

Implements ArrayBase.

◆ row_slice() [1/2]

template<typename _EigenType>
std::unique_ptr< ArrayBase > row_slice ( Index num_rows,
const IndexFunction & mapping_fn ) const
inlineoverridevirtual

Using index function for row mapping.

Parameters
mapping_fnAn index mapping function: input_row_index = mapping_fn(output_row_index)).

Implements ArrayBase.

◆ row_slice() [2/2]

template<typename _EigenType>
std::unique_ptr< ArrayBase > row_slice ( Index num_rows,
const WeightedIndexFunction & mapping_fn ) const
inlineoverridevirtual

This is the most generic version of row_slice method.

Parameters
mapping_fnA mapping function that maps each output row index to a vector of (input_row_index, weight).

Implements ArrayBase.

◆ type_name()

template<typename _EigenType>
std::string type_name ( ) const
inlineoverridevirtual

Implements ArrayBase.


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