40#include "../../misc/constructVector.hpp"
42#include "../../traits/realTraits.hpp"
43#include "delayAccessor.hpp"
45#include "jacobianInterface.hpp"
46#include "staticDummy.hpp"
59 template<
typename T_T,
typename T_Store = std::vector<T_T>>
128 template<
typename T_T,
typename T_Store = std::vector<T_T>>
141 std::vector<int> nonZerosRowVector;
163 nonZerosRowVector.resize(
m);
168 return nonZerosRowVector[i];
174 nonZerosRowVector[i] += 1;
185 template<
typename T_Nested>
189 using T =
typename Nested::T;
212 template<
typename SetT>
214 nested(i, j) = RealTraits::getPassiveValue<SetT>(v);
247 void resize(
size_t const m,
size_t const n) {
#define CODI_INLINE
See codi::Config::ForcedInlines.
Definition config.h:457
#define CODI_INLINE_NO_FA
See codi::Config::ForcedInlines.
Definition config.h:459
#define CODI_DD(Type, Default)
Abbreviation for CODI_DECLARE_DEFAULT.
Definition macros.hpp:94
CoDiPack - Code Differentiation Package.
Definition codi.hpp:90
void CODI_UNUSED(Args const &...)
Disable unused warnings for an arbitrary number of arguments.
Definition macros.hpp:46
V constructVector(size_t const size)
Helper for the construction of vector types provided by the user.
Definition constructVector.hpp:83
Dummy Jacobian. Has size zero and no logic in any call.
Definition jacobian.hpp:219
size_t getM() const
Get size of rows (output variables).
Definition jacobian.hpp:223
DummyValue operator()(size_t const i, size_t const j) const
Value access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:233
void resize(size_t const m, size_t const n)
Resize the Jacobian.
Definition jacobian.hpp:247
DummyValue & operator()(size_t const i, size_t const j)
Reference access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:240
size_t size() const
Get total size of the Jacobian.
Definition jacobian.hpp:252
size_t getN() const
Get size of columns (input variables).
Definition jacobian.hpp:228
Dummy value that can be assigned.
Definition dummy.hpp:43
Wrapper for JacboianInterfaces that requires a passive value conversion.
Definition jacobian.hpp:186
DelayAcc operator()(size_t const i, size_t const j)
Reference access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:207
void setLogic(size_t const i, size_t const j, SetT const &v)
Called by the JacobianDelayAccessor when a value is set.
Definition jacobian.hpp:213
JacobianDelayAccessor< JacobianConvertWrapper > DelayAcc
Return type for reference access.
Definition jacobian.hpp:190
T_Nested Nested
See JacobianConvertWrapper.
Definition jacobian.hpp:188
JacobianConvertWrapper(Nested &nested)
Constructor.
Definition jacobian.hpp:198
typename Nested::T T
See JacobianInterface.
Definition jacobian.hpp:189
T operator()(size_t const i, size_t const j) const
Value access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:201
Adds counting of nonzero entries.
Definition jacobian.hpp:129
JacobianDelayAccessor< JacobianCountNonZerosRow > DelayAcc
Delayed accessor for reference access.
Definition jacobian.hpp:137
int & nonZerosRow(size_t const i)
Reference to the number of nonzero entries for the specified row.
Definition jacobian.hpp:167
void resize(size_t const m, size_t const n)
Resize the Jacobian.
Definition jacobian.hpp:161
JacobianCountNonZerosRow(size_t m, size_t n)
m = rows (output variables), n = columns (input variables)
Definition jacobian.hpp:146
T operator()(size_t const i, size_t const j) const
Value access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:149
DelayAcc operator()(size_t const i, size_t const j)
Reference access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:156
typename Base::T T
See Jacobian.
Definition jacobian.hpp:134
typename Base::Store Store
See Jacobian.
Definition jacobian.hpp:135
void setLogic(size_t const i, size_t const j, T const &v)
Checks if the element is non zero and updates the counter.
Definition jacobian.hpp:172
Definition delayAccessor.hpp:51
General interface for Jacobian access in CoDiPack.
Definition jacobianInterface.hpp:54
Default implementation of the Jacobian interface.
Definition jacobian.hpp:60
size_t n
Number of columns (input variables).
Definition jacobian.hpp:70
Store values
Array store for the data.
Definition jacobian.hpp:67
size_t m
Number of rows (output variables).
Definition jacobian.hpp:69
T_Store Store
See Jacobian.
Definition jacobian.hpp:64
T_T T
See Jacobian.
Definition jacobian.hpp:63
T operator()(size_t const i, size_t const j) const
Value access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:88
size_t size() const
Get total size of the Jacobian.
Definition jacobian.hpp:108
size_t getM() const
Get size of rows (output variables).
Definition jacobian.hpp:78
T & operator()(size_t const i, size_t const j)
Reference access, i in [0, ..., m), j in [0, ..., n).
Definition jacobian.hpp:93
void resize(size_t const m, size_t const n)
Resize the Jacobian.
Definition jacobian.hpp:100
size_t getN() const
Get size of columns (input variables).
Definition jacobian.hpp:83
size_t computeIndex(size_t const i, size_t const j) const
Convert row and column to an index in the storage array.
Definition jacobian.hpp:115
Jacobian(size_t const m, size_t const n)
m = rows (output variables), n = columns (input variables)
Definition jacobian.hpp:75
Static dummy objects for e.g. default reference arguments.
Definition staticDummy.hpp:42