vector_norm#
Compute a norm of a vector. Currently L1 and L2 norms are supported.
The order parameter can be either NormOrder::L1` or NormOrder::L2`
-
template<typename Op>
__MATX_INLINE__ auto matx::vector_norm(const Op &op, NormOrder order = NormOrder::NONE)# Compute a vector norm.
Computes various types of matrix and vector norms based on the order
- Template Parameters:
Op – Type of input values to evaluate
- Parameters:
op – Input values to evaluate
order – Order of norm
- Returns:
norm operator
-
template<typename Op, int D>
__MATX_INLINE__ auto matx::vector_norm(const Op &op, const int (&dims)[D], NormOrder order = NormOrder::NONE)# Compute a vector norm.
Computes various types of vector norms based on the order
- Template Parameters:
Op – Type of input values to evaluate
- Parameters:
op – Input values to evaluate
dims – Dimensions to perform norm over
order – Order of norm
- Returns:
norm operator
Examples#
(this->out_v = vector_norm(this->in_v, NormOrder::L1)).run(this->exec);
(this->out_v = vector_norm(this->in_v, NormOrder::L2)).run(this->exec);