PhysicsBasedAnimationToolkit 0.0.10
Cross-platform C++20 library of algorithms and data structures commonly used in computer graphics research on physically-based simulation.
Loading...
Searching...
No Matches
pbat::math::CLinearOperator Concept Reference

Concept for operator that satisfies linearity in the mathematical sense. More...

#include <LinearOperator.h>

Concept definition

template<class T>
concept pbat::math::CLinearOperator = requires(T t)
{
{
t.OutputDimensions()
} -> std::convertible_to<int>;
{
t.InputDimensions()
} -> std::convertible_to<int>;
{t.Apply(VectorX{}, std::declval<VectorX&>())};
{t.Apply(MatrixX{}, std::declval<MatrixX&>())};
{
t.ToMatrix()
} -> std::convertible_to<CSCMatrix>;
}
Concept for operator that satisfies linearity in the mathematical sense.
Definition LinearOperator.h:34
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > MatrixX
Dynamic-size matrix type.
Definition Aliases.h:34
Eigen::Vector< Scalar, Eigen::Dynamic > VectorX
Dynamic-size vector type.
Definition Aliases.h:33

Detailed Description

Concept for operator that satisfies linearity in the mathematical sense.

Linear operators satisfy \( L(ax+bz) = a*L(x) + b*L(z) \), hence simply scale and add the input (1st parameter of Apply) prior to the Apply member function to obtain the desired result. Often, the user wishes to obtain the result of multiple applications of linear operators, hence we should not overwrite the out variable (2nd parameter of Apply), but simply add to it. To subtract from it, simply negate the input x, i.e. \( L(-x) = -L(x) \) by linearity.