SyTen

## ◆ addScaled() [2/2]

template<Rank rank, typename Scalar >
 void syten::GenericDenseTensorImpl::addScaled ( GenericDenseTensor< rank, Scalar > & a, GenericDenseTensor< rank, Scalar > const & b, typename IdentityType< Scalar >::type const factor, EliminateZeros const ezeros )
inline

$$a_i = a_i + f b_i$$ for generic dense tensors.

Will fail at runtime if inappropriate dense tensors are supplied.

Parameters
 a the dense tensor to be updated during the call b the second dense tensor, to be scaled by the factor and added to a factor the scaling factor for the second dense tensor ezeros if EliminateZeros::Yes, will set small resulting elements to zero
Remarks
If A is a CUDA tensor, smaller than the threshold size and B is not a CUDA tensor, A is turned into a standard tensor and the default functions are used. If A is a CUDA tensor and either larger than the threshold size or B is also a CUDA tensor, then A is kept as a CUDA tensor and the default functions are used.
If A is not a CUDA tensor but B is a CUDA tensor and smaller than the threshold size, then A and B are made standard tensors and the standard function is used. If A is not a CUDA tensor but B is a CUDA tensor and larger than the threshold size, A is made a CUDA tensor and the CUDA functions are used.
Otherwise, A is made a standard tensor and the default functions are used.
Here is the call graph for this function: