CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::JacobianCountNonZerosRow< T_T, T_Store > Struct Template Reference

Adds counting of nonzero entries. More...

#include <jacobian.hpp>

Inheritance diagram for codi::JacobianCountNonZerosRow< T_T, T_Store >:

Public Types

using Base = Jacobian< T_T, T_Store >
 Base class abbreviation.
 
using DelayAcc = JacobianDelayAccessor< JacobianCountNonZerosRow >
 Delayed accessor for reference access.
 
using Store = typename Base::Store
 See Jacobian.
 
using T = typename Base::T
 See Jacobian.
 
- Public Types inherited from codi::Jacobian< T_T, T_Store >
using Store = T_Store
 See Jacobian.
 
using T = T_T
 See Jacobian.
 
- Public Types inherited from codi::JacobianInterface< T_T >
using T = T_T
 See JacobianInterface.
 

Public Member Functions

 JacobianCountNonZerosRow (size_t m, size_t n)
 m = rows (output variables), n = columns (input variables)
 
int & nonZerosRow (size_t const i)
 Reference to the number of nonzero entries for the specified row.
 
DelayAcc operator() (size_t const i, size_t const j)
 Reference access, i in [0, ..., m), j in [0, ..., n).
 
T operator() (size_t const i, size_t const j) const
 Value access, i in [0, ..., m), j in [0, ..., n).
 
void resize (size_t const m, size_t const n)
 Resize the Jacobian.
 
void setLogic (size_t const i, size_t const j, T const &v)
 Checks if the element is non zero and updates the counter.
 
- Public Member Functions inherited from codi::Jacobian< T_T, T_Store >
size_t getM () const
 Get size of rows (output variables).
 
size_t getN () const
 Get size of columns (input variables).
 
 Jacobian (size_t const m, size_t const n)
 m = rows (output variables), n = columns (input variables)
 
Toperator() (size_t const i, size_t const j)
 Reference access, i in [0, ..., m), j in [0, ..., n).
 
T operator() (size_t const i, size_t const j) const
 Value access, i in [0, ..., m), j in [0, ..., n).
 
void resize (size_t const m, size_t const n)
 Resize the Jacobian.
 
size_t size () const
 Get total size of the Jacobian.
 
- Public Member Functions inherited from codi::JacobianInterface< T_T >
size_t getM () const
 Get size of rows (output variables).
 
size_t getN () const
 Get size of columns (input variables).
 
Toperator() (size_t const i, size_t const j)
 Reference access, i in [0, ..., m), j in [0, ..., n).
 
T operator() (size_t const i, size_t const j) const
 Value access, i in [0, ..., m), j in [0, ..., n).
 
void resize (size_t const m, size_t const n)
 Resize the Jacobian.
 
void setLogic (size_t const i, size_t const j, T const &v)
 Interface for the JacobianDelayAccessor.
 
size_t size () const
 Get total size of the Jacobian.
 

Additional Inherited Members

- Protected Member Functions inherited from codi::Jacobian< T_T, T_Store >
size_t computeIndex (size_t const i, size_t const j) const
 Convert row and column to an index in the storage array.
 
- Protected Attributes inherited from codi::Jacobian< T_T, T_Store >
size_t m
 Number of rows (output variables).
 
size_t n
 Number of columns (input variables).
 
Store values
 Array store for the data.
 

Detailed Description

template<typename T_T, typename T_Store = std::vector<T_T>>
struct codi::JacobianCountNonZerosRow< T_T, T_Store >

Adds counting of nonzero entries.

The user has to manually reset the count.

Template Parameters
T_TThe data type in the Jacobian.
T_StoreStorage allocator. Should implement the standard vector interface.

Constructor & Destructor Documentation

◆ JacobianCountNonZerosRow()

template<typename T_T , typename T_Store = std::vector<T_T>>
codi::JacobianCountNonZerosRow< T_T, T_Store >::JacobianCountNonZerosRow ( size_t  m,
size_t  n 
)
inlineexplicit

m = rows (output variables), n = columns (input variables)

Member Function Documentation

◆ operator()() [1/2]

template<typename T_T , typename T_Store = std::vector<T_T>>
DelayAcc codi::JacobianCountNonZerosRow< T_T, T_Store >::operator() ( size_t const  i,
size_t const  j 
)
inline

Reference access, i in [0, ..., m), j in [0, ..., n).

Implementation: Returns an object for the delayed access. This object calls then the access logic which updates the number of nonzero elements.

◆ operator()() [2/2]

template<typename T_T , typename T_Store = std::vector<T_T>>
T codi::JacobianCountNonZerosRow< T_T, T_Store >::operator() ( size_t const  i,
size_t const  j 
) const
inline

Value access, i in [0, ..., m), j in [0, ..., n).

◆ resize()

template<typename T_T , typename T_Store = std::vector<T_T>>
void codi::JacobianCountNonZerosRow< T_T, T_Store >::resize ( size_t const  m,
size_t const  n 
)
inline

Resize the Jacobian.


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