Matrix< T, M, N > Class Template Reference#
4 min read time
Applies to Linux
roccv::detail::math::Matrix< T, M, N > Class Template Reference
Defines a matrix object. More...
#include <math.hpp>
Public Types | |
using | Type = T |
Public Member Functions | |
__host__ __device__ int | cols () const |
Returns the number of columns in the matrix. More... | |
__host__ __device__ void | load (const T *data) |
Loads a row-major array into the matrix. More... | |
__host__ __device__ Vector< T, N > & | operator[] (int i) |
Returns a row of a matrix as a vector reference. More... | |
const __host__ __device__ Vector< T, N > & | operator[] (int i) const |
Returns a row of a matrix as a constant vector reference. More... | |
__host__ __device__ T & | operator[] (int2 c) |
Returns a data reference from the matrix. More... | |
const __host__ __device__ T & | operator[] (int2 c) const |
Returns a constant data reference from the matrix. More... | |
__host__ __device__ int | rows () const |
Returns the number of rows in a matrix. More... | |
__host__ __device__ void | store (T *data) |
Stores data from the matrix into a 1D array in row-major order. More... | |
Public Attributes | |
Vector< T, N > | data_ [M] |
Detailed Description
template<class T, int M, int N = M>
class roccv::detail::math::Matrix< T, M, N >
Defines a matrix object.
- Template Parameters
-
T The type of the matrix. M Number of rows in the matrix. N Number of columns in the matrix.
Member Typedef Documentation
◆ Type
template<class T , int M, int N = M>
using roccv::detail::math::Matrix< T, M, N >::Type = T |
Member Function Documentation
◆ cols()
template<class T , int M, int N = M>
|
inline |
Returns the number of columns in the matrix.
- Returns
- The number of columns in the matrix.
◆ load()
template<class T , int M, int N = M>
|
inline |
Loads a row-major array into the matrix.
- Parameters
-
data An array of type T.
◆ operator[]() [1/4]
template<class T , int M, int N = M>
|
inline |
Returns a row of a matrix as a vector reference.
- Parameters
-
i The row of the matrix to return.
- Returns
- A reference to a vector representing a row of the matrix.
◆ operator[]() [2/4]
template<class T , int M, int N = M>
|
inline |
Returns a row of a matrix as a constant vector reference.
- Parameters
-
i The row to return.
- Returns
- A row of the matrix represented as a vector.
◆ operator[]() [3/4]
template<class T , int M, int N = M>
|
inline |
Returns a data reference from the matrix.
- Parameters
-
c An int2 coordinate in the form {col, row}
- Returns
- A data reference from the matrix.
◆ operator[]() [4/4]
template<class T , int M, int N = M>
|
inline |
Returns a constant data reference from the matrix.
- Parameters
-
c An int2 coordinate in the form {col, row}
- Returns
- A constant data reference from the matrix.
◆ rows()
template<class T , int M, int N = M>
|
inline |
Returns the number of rows in a matrix.
- Returns
- The number of rows in the matrix.
◆ store()
template<class T , int M, int N = M>
|
inline |
Stores data from the matrix into a 1D array in row-major order.
- Parameters
-
data The array to store matrix data in.
Member Data Documentation
◆ data_
template<class T , int M, int N = M>
Vector<T, N> roccv::detail::math::Matrix< T, M, N >::data_[M] |
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/advanced-micro-devices-roccv/checkouts/latest/include/core/detail/math/math.hpp