1#ifndef MATRIX_FACTORY_H
2#define MATRIX_FACTORY_H
27 std::unique_ptr<GenericMatrix<T>> createSelectedTypeUnique(
MatrixType type);
28 std::shared_ptr<GenericMatrix<T>> createSelectedTypeShared(
MatrixType type);
78 return std::make_unique<DenseMatrix<T>>();
80 return std::make_unique<CsrSparseMatrix<T>>();
82 std::cerr <<
"[MatrixFactory]: Unknown MatrixType in _create_selected_type_unique.\n";
83 throw std::invalid_argument(
static_cast<std::string
>(
84 "[MatrixFactory]: Unknown MatrixType in _create_selected_type_unique."));
101 return std::make_shared<DenseMatrix<T>>();
103 return std::make_shared<CsrSparseMatrix<T>>();
105 std::cerr <<
"[MatrixFactory]: Unknown MatrixType in _create_selected_type_shared.\n";
106 throw std::invalid_argument(
107 "[MatrixFactory]: Unknown MatrixType in _create_selected_type_shared.");
119 return createSelectedTypeUnique(m_default_matrix_type);
132 return createSelectedTypeUnique(
type);
145 return createSelectedTypeShared(m_default_matrix_type);
158 return createSelectedTypeShared(
type);
constexpr MatrixType setMatrixType(const std::string &type)
Definition CoreEnums.h:41
MatrixType
Definition CoreEnums.h:36
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:37
Class that creates empty matrix objects of the specified type.
Definition MatrixFactory.h:23
std::shared_ptr< GenericMatrix< T > > createShared()
Creation function that creates a Matrix based on the default type.
Definition MatrixFactory.h:143
MatrixFactory(MatrixType type)
Constructor from enum (internal use) for the MatrixFactory class.
Definition MatrixFactory.h:61
std::unique_ptr< GenericMatrix< T > > createUnique()
Creation function that creates a Matrix based on the default type.
Definition MatrixFactory.h:117