Template Class qmatrix#
Defined in File qmatrix.hpp
Class Documentation#
-
template<class T = double>
class qmatrix# Public Functions
-
inline qmatrix(const std::initializer_list<T> inputVec, size_t _row = 0, size_t _column = 0)#
Construct matrix from initializer list.
- Parameters:
inputVec – Initializer list with matrix elements in row-major order
_row – Number of rows (default: 0, compute from size)
_column – Number of columns (default: 0, compute from size)
-
inline void clear()#
Reset the matrix to empty state.
Empties internal storage and resets dimensions to 0.
-
inline qmatrix(size_t N, T populate)#
Square matrix constructor for fill initialization.
- Parameters:
N – number of rows and columns
populate – value for all entries
-
inline qmatrix()#
Default constructor creates an empty matrix.
-
inline size_t size() const#
Return number of elements in matrix storage.
- Returns:
total number of entries, i.e., row * column.
-
inline size_t getrow() const#
Return number of rows.
- Returns:
row count.
-
inline size_t getcolumn() const#
Return number of columns.
- Returns:
column count.
-
inline T &operator()(size_t i, size_t j)#
Element access by linear index in row-major order.
- Parameters:
i – linear index (0-based)
- Returns:
reference to element.
-
inline T absSum() const#
Sum absolute values of all entries.
- Returns:
absolute sum of matrix entries.
-
inline T trace() const#
Trace of the matrix (sum of diagonal elements).
- Throws:
std::runtime_error – if matrix is not square.
- Returns:
trace value.
-
inline auto getdiagonal()#
-
inline auto begin() const#
-
inline auto end() const#
-
inline void display()#
-
inline std::vector<double> diag()#
-
inline qmatrix(const std::initializer_list<T> inputVec, size_t _row = 0, size_t _column = 0)#