SOFA API  1a4bb3e7
Open source framework for multi-physics simuation
sofa::linearalgebra::sparsematrixproduct::IndexValueProduct< Scalar > Class Template Reference

Detailed Description

template<class Scalar>
class sofa::linearalgebra::sparsematrixproduct::IndexValueProduct< Scalar >

Represent a sum of scalar products. It stores:

  • a value for the result
  • a list of pairs of indices to know what scalars were used for the computation

Public Member Functions

const sofa::type::vector< ScalarProduct > & getIndices () const
 
 IndexValueProduct ()=default
 
template<class AnyScalar , typename = std::enable_if_t<std::is_scalar_v<AnyScalar> >>
 IndexValueProduct (AnyScalar s)
 
 operator Scalar () const
 
template<class AnyScalar >
 IndexValueProduct (const IndexValueProduct< AnyScalar > &other)
 
template<class AnyScalar >
void operator+= (const IndexValueProduct< AnyScalar > &other)
 

Friends

template<class ScalarLhs , class ScalarRhs >
IndexValueProduct< decltype(ScalarLhs{} *ScalarRhs{})> operator* (const IndexedValue< ScalarLhs > &lhs, const IndexedValue< ScalarRhs > &rhs)
 

Constructor details

◆ IndexValueProduct() [1/3]

◆ IndexValueProduct() [2/3]

template<class Scalar >
template<class AnyScalar , typename = std::enable_if_t<std::is_scalar_v<AnyScalar> >>
sofa::linearalgebra::sparsematrixproduct::IndexValueProduct< Scalar >::IndexValueProduct ( AnyScalar  s)
inline

◆ IndexValueProduct() [3/3]

template<class Scalar >
template<class AnyScalar >
sofa::linearalgebra::sparsematrixproduct::IndexValueProduct< Scalar >::IndexValueProduct ( const IndexValueProduct< AnyScalar > &  other)
inline

Function details

◆ getIndices()

template<class Scalar >
const sofa::type::vector<ScalarProduct>& sofa::linearalgebra::sparsematrixproduct::IndexValueProduct< Scalar >::getIndices ( ) const
inline

◆ operator Scalar()

template<class Scalar >
sofa::linearalgebra::sparsematrixproduct::IndexValueProduct< Scalar >::operator Scalar ( ) const
inline

◆ operator+=()

template<class Scalar >
template<class AnyScalar >
void sofa::linearalgebra::sparsematrixproduct::IndexValueProduct< Scalar >::operator+= ( const IndexValueProduct< AnyScalar > &  other)
inline

Related details

◆ operator*

template<class Scalar >
template<class ScalarLhs , class ScalarRhs >
IndexValueProduct<decltype(ScalarLhs{} * ScalarRhs{})> operator* ( const IndexedValue< ScalarLhs > &  lhs,
const IndexedValue< ScalarRhs > &  rhs 
)
friend