math Namespace Reference

math Namespace Reference#

5 min read time

Applies to Linux

rocCV: roccv::detail::math Namespace Reference
roccv::detail::math Namespace Reference

Classes

class  Matrix
 Defines a matrix object. More...
 
class  Vector
 Defines a Vector object. More...
 

Functions

 DEFINE_VECTOR_BINARY_FUNC (fdividef, vfdividef)
 
 DEFINE_VECTOR_BINARY_FUNC (powf, vpowf)
 
 DEFINE_VECTOR_BINARY_OP (+, add)
 
 DEFINE_VECTOR_BINARY_OP (-, sub)
 
 DEFINE_VECTOR_BINARY_OP (/, div)
 
 DEFINE_VECTOR_UNARY_FUNC (rsqrtf, vrsqrtf)
 
 DEFINE_VECTOR_UNARY_FUNC (sqrtf, vsqrtf)
 
template<class T >
constexpr __host__ __device__ T det (const Matrix< T, 0, 0 > &m)
 
template<class T >
constexpr __host__ __device__ T det (const Matrix< T, 1, 1 > &m)
 
template<class T >
constexpr __host__ __device__ T det (const Matrix< T, 2, 2 > &m)
 
template<class T >
constexpr __host__ __device__ T det (const Matrix< T, 3, 3 > &m)
 
template<class T , int N>
__host__ __device__ T dot (const Vector< T, N > &a, const Vector< T, N > &b)
 
template<class T >
constexpr __host__ __device__ Matrix< T, 3, 3 > inv (const Matrix< T, 3, 3 > &m, const T &d)
 
template<class T >
constexpr __host__ __device__ void inv_inplace (Matrix< T, 3, 3 > &m, const T &d)
 
template<class T , int N, class = std::enable_if_t<(N < 4)>>
constexpr __host__ __device__ bool inv_inplace (Matrix< T, N, N > &m)
 
template<class F = float, class T , int N>
__host__ __device__ bool lu_inplace (Matrix< T, N, N > &m, Vector< int, N > &p)
 
template<class T , int N>
__host__ __device__ Vector< T, N > operator- (const Vector< T, N > &v)
 
template<class T , int N>
__host__ __device__ void solve_inplace (const Matrix< T, N, N > &lu, const Vector< int, N > &p, Vector< T, N > &b)
 
template<class T , int N>
__host__ __device__ bool solve_inplace (const Matrix< T, N, N > &m, Vector< T, N > &b)
 
template<class T >
__host__ __device__ void swap (T &a, T &b)
 

Variables

DEFINE_VECTOR_BINARY_OPmul
 

Detailed Description

Copyright (c) 2025 Advanced Micro Devices, Inc. All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Function Documentation

◆ DEFINE_VECTOR_BINARY_FUNC() [1/2]

roccv::detail::math::DEFINE_VECTOR_BINARY_FUNC ( fdividef  ,
vfdividef   
)

◆ DEFINE_VECTOR_BINARY_FUNC() [2/2]

roccv::detail::math::DEFINE_VECTOR_BINARY_FUNC ( powf  ,
vpowf   
)

◆ DEFINE_VECTOR_BINARY_OP() [1/3]

roccv::detail::math::DEFINE_VECTOR_BINARY_OP ( ,
add   
)

◆ DEFINE_VECTOR_BINARY_OP() [2/3]

roccv::detail::math::DEFINE_VECTOR_BINARY_OP ( ,
sub   
)

◆ DEFINE_VECTOR_BINARY_OP() [3/3]

roccv::detail::math::DEFINE_VECTOR_BINARY_OP ( ,
div   
)

◆ DEFINE_VECTOR_UNARY_FUNC() [1/2]

roccv::detail::math::DEFINE_VECTOR_UNARY_FUNC ( rsqrtf  ,
vrsqrtf   
)

◆ DEFINE_VECTOR_UNARY_FUNC() [2/2]

roccv::detail::math::DEFINE_VECTOR_UNARY_FUNC ( sqrtf  ,
vsqrtf   
)

◆ det() [1/4]

template<class T >
constexpr __host__ __device__ T roccv::detail::math::det ( const Matrix< T, 0, 0 > &  m)
constexpr

◆ det() [2/4]

template<class T >
constexpr __host__ __device__ T roccv::detail::math::det ( const Matrix< T, 1, 1 > &  m)
constexpr

◆ det() [3/4]

template<class T >
constexpr __host__ __device__ T roccv::detail::math::det ( const Matrix< T, 2, 2 > &  m)
constexpr

◆ det() [4/4]

template<class T >
constexpr __host__ __device__ T roccv::detail::math::det ( const Matrix< T, 3, 3 > &  m)
constexpr

◆ dot()

template<class T , int N>
__host__ __device__ T roccv::detail::math::dot ( const Vector< T, N > &  a,
const Vector< T, N > &  b 
)

◆ inv()

template<class T >
constexpr __host__ __device__ Matrix<T, 3, 3> roccv::detail::math::inv ( const Matrix< T, 3, 3 > &  m,
const T &  d 
)
constexpr

◆ inv_inplace() [1/2]

template<class T >
constexpr __host__ __device__ void roccv::detail::math::inv_inplace ( Matrix< T, 3, 3 > &  m,
const T &  d 
)
constexpr

◆ inv_inplace() [2/2]

template<class T , int N, class = std::enable_if_t<(N < 4)>>
constexpr __host__ __device__ bool roccv::detail::math::inv_inplace ( Matrix< T, N, N > &  m)
constexpr

◆ lu_inplace()

template<class F = float, class T , int N>
__host__ __device__ bool roccv::detail::math::lu_inplace ( Matrix< T, N, N > &  m,
Vector< int, N > &  p 
)

◆ operator-()

template<class T , int N>
__host__ __device__ Vector<T, N> roccv::detail::math::operator- ( const Vector< T, N > &  v)

◆ solve_inplace() [1/2]

template<class T , int N>
__host__ __device__ void roccv::detail::math::solve_inplace ( const Matrix< T, N, N > &  lu,
const Vector< int, N > &  p,
Vector< T, N > &  b 
)

◆ solve_inplace() [2/2]

template<class T , int N>
__host__ __device__ bool roccv::detail::math::solve_inplace ( const Matrix< T, N, N > &  m,
Vector< T, N > &  b 
)

◆ swap()

template<class T >
__host__ __device__ void roccv::detail::math::swap ( T &  a,
T &  b 
)

Variable Documentation

◆ mul

DEFINE_VECTOR_BINARY_OP* roccv::detail::math::mul