Advanced Multi-Physics (AMP)
On-Line Documentation
MatrixBuilder.h
Go to the documentation of this file.
1#ifndef included_AMP_MatrixBuider
2#define included_AMP_MatrixBuider
3
4#include "AMP/matrices/Matrix.h"
5#include "AMP/utils/Utilities.h"
6#include "AMP/vectors/Vector.h"
7
8#include <functional>
9#include <string>
10
11
12extern "C" {
13typedef struct _p_Mat *Mat;
14}
15
16
17namespace AMP::LinearAlgebra {
18
19
22
23
40std::shared_ptr<Matrix>
43 const std::string &type = "auto",
44 std::function<std::vector<size_t>( size_t row )> getColumnIDs =
45 std::function<std::vector<size_t>( size_t )>() );
46
64std::shared_ptr<Matrix>
67 AMP::Utilities::Backend accelerationBackend,
68 std::string type = "auto",
69 std::function<std::vector<size_t>( size_t row )> getColumnIDs =
70 std::function<std::vector<size_t>( size_t )>() );
71
72template<typename ConfigOut>
73std::shared_ptr<AMP::LinearAlgebra::Matrix>
74createMatrix( std::shared_ptr<AMP::LinearAlgebra::Matrix> matrix );
75
76template<typename ConfigOut>
77std::shared_ptr<AMP::LinearAlgebra::Matrix>
78createMatrix( std::shared_ptr<AMP::LinearAlgebra::Matrix> matrix,
79 AMP::Utilities::Backend accelerationBackend );
80
81std::shared_ptr<AMP::LinearAlgebra::Matrix>
82createMatrix( std::shared_ptr<AMP::LinearAlgebra::Matrix> matrix,
84
85std::shared_ptr<AMP::LinearAlgebra::Matrix>
86createMatrix( std::shared_ptr<AMP::LinearAlgebra::Matrix> matrix,
88 AMP::Utilities::Backend accelerationBackend );
89
90#if defined( AMP_USE_PETSC )
97std::shared_ptr<Matrix> createMatrix( Mat M, bool deleteable );
98#endif
99
100
101} // namespace AMP::LinearAlgebra
102
103#endif
struct _p_Mat * Mat
std::shared_ptr< Vector > shared_ptr
Shorthand for shared pointer to Vector.
Definition Vector.h:60
std::string getDefaultMatrixType()
Return the default matrix type.
std::shared_ptr< Matrix > createMatrix(AMP::LinearAlgebra::Vector::shared_ptr right, AMP::LinearAlgebra::Vector::shared_ptr left, const std::string &type="auto", std::function< std::vector< size_t >(size_t row)> getColumnIDs=std::function< std::vector< size_t >(size_t)>())
This function will create a matrix from two vectors.
Backend
Enum to store the backend used for gpu acceleration.
Definition Backend.h:21
MemoryType
Enum to store pointer type.
Definition Memory.h:21



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:40.
Comments on this page