contact_matrix.h Source File
|
CPP API
|
contact_matrix.h
Go to the documentation of this file.
59 DampingMatrixExpression(const Eigen::MatrixBase<M>& baseline, const Eigen::MatrixBase<K>& minimum)
75 baseline, Matrix::Zero(Shape::get_shape_of(baseline).rows(), Shape::get_shape_of(baseline).cols()))
88 : DampingMatrixExpression(Matrix::Zero(Shape(shape_args...).rows(), Shape(shape_args...).cols()))
168 return m_baseline == other.m_baseline && m_minimum == other.m_minimum && m_dampings == other.m_dampings;
193 return m_baseline - (m_dampings.get_matrix_at(t).array() * (m_baseline - m_minimum).array()).matrix();
396 return std::accumulate(m_matrices.begin(), m_matrices.end(), FP(0.0), [t, i, j](FP s, auto& m) {
represents a collection of contact frequency matrices that whose sum is the total number of contacts.
Definition: contact_matrix.h:536
static IOResult< ContactMatrixGroup > deserialize(IOContext &io)
deserialize an object of this class.
Definition: contact_matrix.h:554
Eigen::Index get_num_groups() const
get the number of groups.
Definition: contact_matrix.h:544
represents time dependent contact frequencies between groups.
Definition: contact_matrix.h:505
Eigen::Index get_num_groups() const
get the number of groups.
Definition: contact_matrix.h:513
static IOResult< ContactMatrix > deserialize(IOContext &io)
deserialize an object of this class.
Definition: contact_matrix.h:523
represents a collection of DampingMatrixExpressions that are summed up.
Definition: contact_matrix.h:272
typename std::vector< value_type >::const_iterator const_iterator
Definition: contact_matrix.h:278
const value_type & const_reference
Definition: contact_matrix.h:276
static IOResult< DampingMatrixExpressionGroup > deserialize(IOContext &io)
deserialize an object of this class.
Definition: contact_matrix.h:481
std::vector< value_type > m_matrices
Definition: contact_matrix.h:487
T class Derived static IOResult< Derived > deserialize(IOContext &io, Tag< Derived >)
Definition: contact_matrix.h:450
typename std::vector< value_type >::iterator iterator
Definition: contact_matrix.h:277
requires(std::is_constructible_v< Shape, T... >) explicit DampingMatrixExpressionGroup(size_t num_matrices
create a collection.
typename value_type::Shape Shape
Definition: contact_matrix.h:280
typename value_type::DampingsType DampingsType
Definition: contact_matrix.h:282
typename value_type::Matrix Matrix
Definition: contact_matrix.h:281
represents the coefficient wise matrix (or vector) expression B - D * M where B is a baseline,...
Definition: contact_matrix.h:46
friend void PrintTo(const DampingMatrixExpression &self, std::ostream *os)
gtest printer.
Definition: contact_matrix.h:199
requires std::is_constructible_v< Shape, T... > DampingMatrixExpression(T... shape_args)
construct with shape.
Definition: contact_matrix.h:87
bool operator!=(const DampingMatrixExpression &other) const
Definition: contact_matrix.h:170
DampingMatrixExpression(const Eigen::MatrixBase< M > &baseline)
construct with only baseline, minimum and dampings is zero.
Definition: contact_matrix.h:73
void clear_dampings()
remove all dampings.
Definition: contact_matrix.h:114
auto get_matrix_at(SimulationTime< FP > t) const
Applies dampings to compute the real contact frequency at a point in time.
Definition: contact_matrix.h:190
void add_damping(T &&... t)
adds a damping.
Definition: contact_matrix.h:97
const Matrix & get_minimum() const
get the minimum matrix.
Definition: contact_matrix.h:146
auto get_dampings() const
list of dampings.
Definition: contact_matrix.h:122
void remove_damping(size_t i)
remove a damping.
Definition: contact_matrix.h:106
const Matrix & get_baseline() const
get the baseline matrix.
Definition: contact_matrix.h:134
void serialize(IOContext &io) const
serialize this.
Definition: contact_matrix.h:211
static IOResult< DampingMatrixExpression > deserialize(IOContext &io)
deserialize an object of this class.
Definition: contact_matrix.h:254
DampingMatrixExpression(const Eigen::MatrixBase< M > &baseline, const Eigen::MatrixBase< K > &minimum)
construct with baseline and minimum contacts and zero dampings.
Definition: contact_matrix.h:59
static IOResult< Derived > deserialize(IOContext &io, Tag< Derived >)
deserialize an object of a class derived from this.
Definition: contact_matrix.h:224
bool operator==(const DampingMatrixExpression &other) const
equality operators.
Definition: contact_matrix.h:166
typename DampingsType::Shape Shape
Definition: contact_matrix.h:49
Shape get_shape() const
dimensions of the matrix.
Definition: contact_matrix.h:158
void set_automatic_cache_update(bool b)
Enable/disable automatic cache update of the dampings.
Definition: contact_matrix.h:179
A collection of classes to simplify handling of matrix shapes in meta programming.
Definition: models/abm/analyze_result.h:30
requires details::IsElementReference< M > RowMajorIterator< M, false > end(M &m)
create a non-const end iterator for the matrix m.
Definition: eigen_util.h:449
Range(std::pair< I, S > iterator_pair) -> Range< I, S >
Deduction guide to correctly deduce range type when constructed from a pair.
auto failure(const IOStatus &s)
Create an object that is implicitly convertible to an error IOResult<T>.
Definition: io.h:380
@ InvalidValue
void serialize(IOContext &io, const T &t)
Save data that describes an object in a format determined by the given context.
Definition: io.h:836
bool operator==(const Node< T > &n1, const Node< T > &n2)
comparison operator if node property type is equality comparable
Definition: graph.h:100
boost::outcome_v2::in_place_type_t< T > Tag
Type that is used for overload resolution.
Definition: io.h:407
details::ApplyResultT< F, T... > apply(IOContext &io, F f, const IOResult< T > &... rs)
Evaluate a function with zero or more unpacked IOResults as arguments.
Definition: io.h:481
requires(!std::is_trivial_v< T >) void BinarySerializerObject
Definition: binary_serializer.h:333
auto success()
Create an object that is implicitly convertible to a succesful IOResult<void>.
Definition: io.h:359
requires details::IsElementReference< M > RowMajorIterator< M, false > begin(M &m)
create a non-const iterator to first element of the matrix m.
Definition: eigen_util.h:421
void PrintTo(const IOStatus &status, std::ostream *os)
gtest printer for IOStatus.
Definition: io.h:290
boost::outcome_v2::unchecked< T, IOStatus > IOResult
Value-or-error type for operations that return a value but can fail.
Definition: io.h:353
Generated by