1#ifndef MATRIX_FACTORY_H
2#define MATRIX_FACTORY_H
24 std::unique_ptr<GenericMatrix<T>> createSelectedTypeUnique(
MatrixType type);
25 std::shared_ptr<GenericMatrix<T>> createSelectedTypeShared(
MatrixType type);
64 return std::make_unique<DenseMatrix<T>>();
66 std::cerr <<
"[Warning] CsrSparseMatrix type not yet tested!";
67 return std::make_unique<CsrSparseMatrix<T>>();
69 throw std::invalid_argument(
"Unknown MatrixType in _create_selected_type_unique");
82 return std::make_shared<DenseMatrix<T>>();
84 std::cerr <<
"[Warning] CsrSparseMatrix type not yet tested!";
85 return std::make_shared<CsrSparseMatrix<T>>();
87 throw std::invalid_argument(
"Unknown MatrixType in _create_selected_type_shared");
97 return createSelectedTypeUnique(m_default_matrix_type);
106 return createSelectedTypeUnique(
type);
115 return createSelectedTypeShared(m_default_matrix_type);
124 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:20
std::shared_ptr< GenericMatrix< T > > createShared()
Creation function that creates a Matrix based on the default type.
Definition MatrixFactory.h:113
MatrixFactory(MatrixType type)
Constructor from enum (internal use) for the MatrixFactory class.
Definition MatrixFactory.h:51
std::unique_ptr< GenericMatrix< T > > createUnique()
Creation function that creates a Matrix based on the default type.
Definition MatrixFactory.h:95