1#ifndef MATRIX_FACTORY_H
2#define MATRIX_FACTORY_H
26 std::unique_ptr<GenericMatrix<T>> createSelectedTypeUnique(
MatrixType type);
27 std::shared_ptr<GenericMatrix<T>> createSelectedTypeShared(
MatrixType type);
77 return std::make_unique<DenseMatrix<T>>();
79 return std::make_unique<CsrSparseMatrix<T>>();
81 throw std::invalid_argument(
"Unknown MatrixType in _create_selected_type_unique");
98 return std::make_shared<DenseMatrix<T>>();
100 return std::make_shared<CsrSparseMatrix<T>>();
102 throw std::invalid_argument(
"Unknown MatrixType in _create_selected_type_shared");
114 return createSelectedTypeUnique(m_default_matrix_type);
127 return createSelectedTypeUnique(
type);
140 return createSelectedTypeShared(m_default_matrix_type);
153 return createSelectedTypeShared(
type);
constexpr MatrixType setMatrixType(const std::string &type)
Definition CoreEnums.h:38
MatrixType
Definition CoreEnums.h:33
Error class to throw when a module chain has circular or missing dependencies. Inherits from std::exc...
Definition ChainManager.h:28
Class that creates empty matrix objects of the specified type.
Definition MatrixFactory.h:22
std::shared_ptr< GenericMatrix< T > > createShared()
Creation function that creates a Matrix based on the default type.
Definition MatrixFactory.h:138
MatrixFactory(MatrixType type)
Constructor from enum (internal use) for the MatrixFactory class.
Definition MatrixFactory.h:60
std::unique_ptr< GenericMatrix< T > > createUnique()
Creation function that creates a Matrix based on the default type.
Definition MatrixFactory.h:112