16 #ifndef MOAB_HYPREPARVECTOR
17 #define MOAB_HYPREPARVECTOR
22 #ifdef MOAB_HAVE_EIGEN3
24 #include <Eigen/Sparse>
26 #error Configure with Eigen3 enabled
34 #include "HYPRE_IJ_mv.h"
35 #include "_hypre_IJ_mv.h"
36 #include "HYPRE_parcsr_ls.h"
38 #include "temp_multivector.h"
41 #error "MOAB does not work with HYPRE's complex numbers support"
56 int own_ParVector, rstart, rend,
size, gsize;
59 hypre_ParVector* x_par;
62 friend class HypreParMatrix;
63 friend class HypreSolver;
73 HypreParVector(
moab::ParallelComm* p_comm, HYPRE_Int glob_size, HYPRE_Int rstart, HYPRE_Int rend );
75 HypreParVector(
const HypreParVector& y );
77 HypreParVector( HypreParMatrix& A,
int tr = 0 );
79 int resize( HYPRE_Int glob_size, HYPRE_Int rstart, HYPRE_Int rend );
88 inline HYPRE_Int* Partitioning()
90 return x->partitioning;
94 inline HYPRE_Int GlobalSize()
const
96 return x->global_num_rows;
100 operator HYPRE_IJVector()
const;
103 operator HYPRE_ParVector()
const;
106 HYPRE_IJVector StealParVector()
113 void SetOwnership(
int own )
119 int GetOwnership()
const
121 return own_ParVector;
125 HypreParVector& operator=(
double d );
126 HypreParVector& operator=(
const HypreParVector& y );
128 HYPRE_Int GetValues(
const int ndata,
const HYPRE_Int* indices, HYPRE_Complex*
const _data )
const;
130 HYPRE_Int SetValues(
const int ndata,
const HYPRE_Int* indices,
const HYPRE_Complex*
const _data );
132 HYPRE_Int AddValues(
const int ndata,
const HYPRE_Int* indices,
const HYPRE_Complex*
const _data );
134 HYPRE_Int GetValue(
const HYPRE_Int index, HYPRE_Complex*
const _data )
const;
136 HYPRE_Int SetValue(
const HYPRE_Int index,
const HYPRE_Complex _data );
138 HYPRE_Int AddValue(
const HYPRE_Int index,
const HYPRE_Complex _data );
143 HYPRE_Int SetData(
double* p_data, HYPRE_Int* p_col = NULL );
148 HYPRE_Int AddData(
double* p_data, HYPRE_Int* p_col = NULL );
150 HYPRE_Int verbosity(
const HYPRE_Int level );
152 HYPRE_Int FinalizeAssembly();
159 void Print(
const char* fname )
const;
164 static double InnerProduct( HypreParVector& x, HypreParVector& y );
168 double InnerProduct( HypreParVector& x, HypreParVector& y );
169 double InnerProduct( HypreParVector* x, HypreParVector* y );