Mumps.cpp
1 #include "SeldonFlag.hxx"
2 
3 #include "SeldonSolverHeader.hxx"
4 #include "SeldonSolverInline.hxx"
5 
6 #ifdef SELDON_WITH_MPI
7 #include "SeldonDistributedHeader.hxx"
8 #include "SeldonDistributedInline.hxx"
9 #endif
10 
11 #ifndef SELDON_WITH_COMPILED_LIBRARY
12 #include "computation/interfaces/direct/Mumps.cxx"
13 #endif
14 
15 namespace Seldon
16 {
17  SELDON_EXTERN template class MatrixMumps<double>;
18  SELDON_EXTERN template class MatrixMumps<complex<double> >;
19 
20  SELDON_EXTERN template void MatrixMumps<double>::FindOrdering(Matrix<double, Symmetric, RowSymSparse>&, IVect&, bool);
21  SELDON_EXTERN template void MatrixMumps<complex<double> >::FindOrdering(Matrix<complex<double> , Symmetric, RowSymSparse>&, IVect&, bool);
22  SELDON_EXTERN template void MatrixMumps<double>::FindOrdering(Matrix<double, Symmetric, ArrayRowSymSparse>&, IVect&, bool);
23  SELDON_EXTERN template void MatrixMumps<complex<double> >::FindOrdering(Matrix<complex<double> , Symmetric, ArrayRowSymSparse>&, IVect&, bool);
24  SELDON_EXTERN template void MatrixMumps<double>::FindOrdering(Matrix<double, General, RowSparse>&, IVect&, bool);
25  SELDON_EXTERN template void MatrixMumps<complex<double> >::FindOrdering(Matrix<complex<double> , General, RowSparse>&, IVect&, bool);
26  SELDON_EXTERN template void MatrixMumps<double>::FindOrdering(Matrix<double, General, ArrayRowSparse>&, IVect&, bool);
27  SELDON_EXTERN template void MatrixMumps<complex<double> >::FindOrdering(Matrix<complex<double> , General, ArrayRowSparse>&, IVect&, bool);
28 
29  SELDON_EXTERN template void MatrixMumps<double>::FactorizeMatrix(Matrix<double, Symmetric, RowSymSparse>&, bool);
30  SELDON_EXTERN template void MatrixMumps<complex<double> >::FactorizeMatrix(Matrix<complex<double> , Symmetric, RowSymSparse>&, bool);
31  SELDON_EXTERN template void MatrixMumps<double>::FactorizeMatrix(Matrix<double, Symmetric, ArrayRowSymSparse>&, bool);
32  SELDON_EXTERN template void MatrixMumps<complex<double> >::FactorizeMatrix(Matrix<complex<double> , Symmetric, ArrayRowSymSparse>&, bool);
33  SELDON_EXTERN template void MatrixMumps<double>::FactorizeMatrix(Matrix<double, General, RowSparse>&, bool);
34  SELDON_EXTERN template void MatrixMumps<complex<double> >::FactorizeMatrix(Matrix<complex<double> , General, RowSparse>&, bool);
35  SELDON_EXTERN template void MatrixMumps<double>::FactorizeMatrix(Matrix<double, General, ArrayRowSparse>&, bool);
36  SELDON_EXTERN template void MatrixMumps<complex<double> >::FactorizeMatrix(Matrix<complex<double> , General, ArrayRowSparse>&, bool);
37 
38  SELDON_EXTERN template void MatrixMumps<double>::PerformAnalysis(Matrix<double, Symmetric, RowSymSparse>&);
39  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformAnalysis(Matrix<complex<double> , Symmetric, RowSymSparse>&);
40  SELDON_EXTERN template void MatrixMumps<double>::PerformAnalysis(Matrix<double, Symmetric, ArrayRowSymSparse>&);
41  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformAnalysis(Matrix<complex<double> , Symmetric, ArrayRowSymSparse>&);
42  SELDON_EXTERN template void MatrixMumps<double>::PerformAnalysis(Matrix<double, General, RowSparse>&);
43  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformAnalysis(Matrix<complex<double> , General, RowSparse>&);
44  SELDON_EXTERN template void MatrixMumps<double>::PerformAnalysis(Matrix<double, General, ArrayRowSparse>&);
45  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformAnalysis(Matrix<complex<double> , General, ArrayRowSparse>&);
46 
47  SELDON_EXTERN template void MatrixMumps<double>::PerformFactorization(Matrix<double, Symmetric, RowSymSparse>&);
48  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformFactorization(Matrix<complex<double> , Symmetric, RowSymSparse>&);
49  SELDON_EXTERN template void MatrixMumps<double>::PerformFactorization(Matrix<double, Symmetric, ArrayRowSymSparse>&);
50  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformFactorization(Matrix<complex<double> , Symmetric, ArrayRowSymSparse>&);
51  SELDON_EXTERN template void MatrixMumps<double>::PerformFactorization(Matrix<double, General, RowSparse>&);
52  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformFactorization(Matrix<complex<double> , General, RowSparse>&);
53  SELDON_EXTERN template void MatrixMumps<double>::PerformFactorization(Matrix<double, General, ArrayRowSparse>&);
54  SELDON_EXTERN template void MatrixMumps<complex<double> >::PerformFactorization(Matrix<complex<double> , General, ArrayRowSparse>&);
55 
56  SELDON_EXTERN template void MatrixMumps<double>::GetSchurMatrix(Matrix<double, Symmetric, RowSymSparse>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
57  SELDON_EXTERN template void MatrixMumps<complex<double> >::GetSchurMatrix(Matrix<complex<double> , Symmetric, RowSymSparse>&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
58  SELDON_EXTERN template void MatrixMumps<double>::GetSchurMatrix(Matrix<double, Symmetric, ArrayRowSymSparse>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
59  SELDON_EXTERN template void MatrixMumps<complex<double> >::GetSchurMatrix(Matrix<complex<double> , Symmetric, ArrayRowSymSparse>&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
60  SELDON_EXTERN template void MatrixMumps<double>::GetSchurMatrix(Matrix<double, General, RowSparse>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
61  SELDON_EXTERN template void MatrixMumps<complex<double> >::GetSchurMatrix(Matrix<complex<double> , General, RowSparse>&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
62  SELDON_EXTERN template void MatrixMumps<double>::GetSchurMatrix(Matrix<double, General, ArrayRowSparse>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
63  SELDON_EXTERN template void MatrixMumps<complex<double> >::GetSchurMatrix(Matrix<complex<double> , General, ArrayRowSparse>&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
64 
65  SELDON_EXTERN template void MatrixMumps<double>::Solve(Vector<double>&);
66  SELDON_EXTERN template void MatrixMumps<double>::Solve(const SeldonTranspose&, Vector<double>&);
67  SELDON_EXTERN template void MatrixMumps<double>::Solve(const SeldonTranspose&, Matrix<double, General, ColMajor>&);
68 
69  SELDON_EXTERN template void MatrixMumps<complex<double> >::Solve(Vector<complex<double> >&);
70  SELDON_EXTERN template void MatrixMumps<complex<double> >::Solve(const SeldonTranspose&, Vector<complex<double> >&);
71  SELDON_EXTERN template void MatrixMumps<complex<double> >::Solve(const SeldonTranspose&, Matrix<complex<double> , General, ColMajor>&);
72 
73  SELDON_EXTERN template void GetLU(Matrix<double, Symmetric, RowSymSparse>&, MatrixMumps<double>&, bool);
74  SELDON_EXTERN template void GetLU(Matrix<complex<double> , Symmetric, RowSymSparse>&, MatrixMumps<complex<double> >&, bool);
75  SELDON_EXTERN template void GetLU(Matrix<double, Symmetric, ArrayRowSymSparse>&, MatrixMumps<double>&, bool);
76  SELDON_EXTERN template void GetLU(Matrix<complex<double> , Symmetric, ArrayRowSymSparse>&, MatrixMumps<complex<double> >&, bool);
77 
78  SELDON_EXTERN template void GetLU(Matrix<double, General, RowSparse>&, MatrixMumps<double>&, bool);
79  SELDON_EXTERN template void GetLU(Matrix<complex<double> , General, RowSparse>&, MatrixMumps<complex<double> >&, bool);
80  SELDON_EXTERN template void GetLU(Matrix<double, General, ArrayRowSparse>&, MatrixMumps<double>&, bool);
81  SELDON_EXTERN template void GetLU(Matrix<complex<double> , General, ArrayRowSparse>&, MatrixMumps<complex<double> >&, bool);
82 
83  SELDON_EXTERN template void GetSchurMatrix(Matrix<double, Symmetric, RowSymSparse>&, MatrixMumps<double>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
84  SELDON_EXTERN template void GetSchurMatrix(Matrix<complex<double> , Symmetric, RowSymSparse>&, MatrixMumps<complex<double> >&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
85  SELDON_EXTERN template void GetSchurMatrix(Matrix<double, Symmetric, ArrayRowSymSparse>&, MatrixMumps<double>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
86  SELDON_EXTERN template void GetSchurMatrix(Matrix<complex<double> , Symmetric, ArrayRowSymSparse>&, MatrixMumps<complex<double> >&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
87 
88  SELDON_EXTERN template void GetSchurMatrix(Matrix<double, General, RowSparse>&, MatrixMumps<double>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
89  SELDON_EXTERN template void GetSchurMatrix(Matrix<complex<double> , General, RowSparse>&, MatrixMumps<complex<double> >&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
90  SELDON_EXTERN template void GetSchurMatrix(Matrix<double, General, ArrayRowSparse>&, MatrixMumps<double>&, const IVect&, Matrix<double, General, ColMajor>&, bool);
91  SELDON_EXTERN template void GetSchurMatrix(Matrix<complex<double> , General, ArrayRowSparse>&, MatrixMumps<complex<double> >&, const IVect&, Matrix<complex<double> , General, ColMajor>&, bool);
92 
93  SELDON_EXTERN template void SolveLU(MatrixMumps<double>&, Vector<double>&);
94  SELDON_EXTERN template void SolveLU(const SeldonTranspose&, MatrixMumps<double>&, Vector<double>&);
95  SELDON_EXTERN template void SolveLU(MatrixMumps<double>&, Matrix<double, General, ColMajor>&);
96 
97  SELDON_EXTERN template void SolveLU(MatrixMumps<double>&, Vector<complex<double> >&);
98  SELDON_EXTERN template void SolveLU(const SeldonTranspose&, MatrixMumps<double>&, Vector<complex<double> >&);
99  SELDON_EXTERN template void SolveLU(MatrixMumps<double>&, Matrix<complex<double> , General, ColMajor>&);
100  SELDON_EXTERN template void SolveLU(const SeldonTranspose&, MatrixMumps<double>&, Matrix<complex<double> , General, ColMajor>&);
101 
102  SELDON_EXTERN template void SolveLU(MatrixMumps<complex<double> >&, Vector<double>&);
103  SELDON_EXTERN template void SolveLU(const SeldonTranspose&, MatrixMumps<complex<double> >&, Vector<double>&);
104  SELDON_EXTERN template void SolveLU(MatrixMumps<complex<double> >&, Matrix<double, General, ColMajor>&);
105  SELDON_EXTERN template void SolveLU(const SeldonTranspose&, MatrixMumps<complex<double> >&, Matrix<double, General, ColMajor>&);
106 
107  SELDON_EXTERN template void SolveLU(MatrixMumps<complex<double> >&, Vector<complex<double> >&);
108  SELDON_EXTERN template void SolveLU(const SeldonTranspose&, MatrixMumps<complex<double> >&, Vector<complex<double> >&);
109  SELDON_EXTERN template void SolveLU(MatrixMumps<complex<double> >&, Matrix<complex<double> , General, ColMajor>&);
110  SELDON_EXTERN template void SolveLU(const SeldonTranspose&, MatrixMumps<complex<double> >&, Matrix<complex<double> , General, ColMajor>&);
111 
112 #ifdef SELDON_WITH_MPI
113  SELDON_EXTERN template void MatrixMumps<double >
114  ::SolveDistributed(MPI_Comm&, const SeldonTranspose&, Vector<double >&, const IVect&);
115 
116  SELDON_EXTERN template void MatrixMumps<double >
117  ::SolveDistributed(MPI_Comm&, const SeldonTranspose&,
118  Matrix<double, General, ColMajor>&, const Vector<int>&);
119 
120  SELDON_EXTERN template void MatrixMumps<complex<double> >
121  ::SolveDistributed(MPI_Comm&, const SeldonTranspose&, Vector<complex<double> >&, const IVect&);
122 
123  SELDON_EXTERN template void MatrixMumps<complex<double> >
124  ::SolveDistributed(MPI_Comm&, const SeldonTranspose&,
125  Matrix<complex<double>, General, ColMajor>&, const Vector<int>&);
126 
127 #endif
128 
129 }
130 
131 
132 
Seldon::GetSchurMatrix
void GetSchurMatrix(Matrix< T, Symmetric, Storage, Allocator > &A, MatrixMumps< T > &mat_lu, const IVect &num, MatrixFull &schur_matrix, bool keep_matrix)
computes Schur complement of a symmetric matrix
Definition: Mumps.cxx:1230
Seldon::MatrixMumps::FactorizeMatrix
void FactorizeMatrix(Matrix< T0, Prop, Storage, Allocator > &mat, bool keep_matrix=false)
Factorizes a given matrix.
Definition: Mumps.cxx:375
Seldon::MatrixMumps::FindOrdering
void FindOrdering(Matrix< T0, Prop, Storage, Allocator > &mat, IVect &numbers, bool keep_matrix=false)
Computes an ordering for matrix renumbering.
Definition: Mumps.cxx:336
Seldon::MatrixMumps::PerformAnalysis
void PerformAnalysis(Matrix< T, Prop, Storage, Allocator > &mat)
Symbolic factorization.
Definition: Mumps.cxx:419
Seldon::GetLU
void GetLU(Matrix< T0, Prop0, Storage0, Allocator0 > &A)
Returns the LU factorization of a matrix.
Definition: Functions_Matrix.cxx:2073
Seldon::MatrixMumps::PerformFactorization
void PerformFactorization(Matrix< T, Prop, RowSparse, Allocator > &mat)
Numerical factorization.
Definition: Mumps.cxx:452
Seldon::MatrixMumps::Solve
void Solve(const SeldonTranspose &TransA, Vector< T, VectFull, Allocator2 > &x)
Solves a linear system using the computed factorization.
Definition: Mumps.cxx:630
Seldon
Seldon namespace.
Definition: Array.cxx:24