G+Smo  24.08.0
Geometry + Simulation Modules
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gsAdditiveOp.hpp
Go to the documentation of this file.
1 
14 namespace gismo
15 {
16 
17 template<typename T>
18 void gsAdditiveOp<T>::apply(const gsMatrix<T>& input, gsMatrix<T>& x) const
19 {
20  GISMO_ASSERT( this->rows() == input.rows(), "The dimensions do not fit." );
21 
22  x.setZero( input.rows(), input.cols() );
23 
24  const index_t n = m_ops.size();
25  gsMatrix<T> res_local, corr_local;
26 
27  for (index_t i=0; i<n; ++i)
28  {
29  res_local.noalias() = m_transfers[i]->transpose()*input;
30  m_ops[i]->apply(res_local, corr_local);
31  x.noalias() += *(m_transfers[i])*corr_local;
32  }
33 }
34 
35 } // namespace gismo
#define index_t
Definition: gsConfig.h:32
#define GISMO_ASSERT(cond, message)
Definition: gsDebug.h:89
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
apply the operator on the input vector and store the result in x
Definition: gsAdditiveOp.hpp:18