1#ifndef PARALLEL_VECTOR_H
2#define PARALLEL_VECTOR_H
28 MPI_Comm communicator);
36 std::unique_ptr<ParallelVector>
MakeCopy()
const override;
37 std::unique_ptr<ParallelVector>
MakeClone()
const override;
41 double*
Data()
override;
45 const double*
Data()
const override;
60 double operator[](int64_t local_id)
const override;
79 void Set(
double value)
override;
85 void Set(
const std::vector<double>& local_vector)
override;
91 void BlockSet(
const std::vector<double>& y,
93 int64_t num_values)
override;
108 int64_t local_offset,
109 int64_t num_values)
override;
116 int64_t local_offset,
117 int64_t num_values)
override;
134 void SetValues(
const std::vector<int64_t>& global_ids,
135 const std::vector<double>& values,
149 void Scale(
double a)
override;
152 void Shift(
double a)
override;
167 std::string
PrintStr()
const override;
179 static std::vector<uint64_t>
180 DefineExtents(uint64_t local_size,
int comm_size, MPI_Comm communicator);
const std::vector< uint64_t > extents_
const std::vector< double > & LocalSTLData() const
void SetValue(int64_t global_id, double value, VecOpType op_type) override
ParallelSTLVector(uint64_t local_size, uint64_t global_size, MPI_Comm communicator)
double ComputeNorm(chi_math::NormType norm_type) const override
std::unique_ptr< ParallelVector > MakeClone() const override
void BlockSet(const std::vector< double > &y, int64_t local_offset, int64_t num_values) override
void SetValues(const std::vector< int64_t > &global_ids, const std::vector< double > &values, VecOpType op_type) override
void PlusAY(const ParallelVector &y, double a) override
void AXPlusY(double a, const ParallelVector &y) override
int FindOwnerPID(uint64_t global_id) const
void operator+=(const ParallelVector &y) override
void Shift(double a) override
std::vector< double > values_
void Scale(double a) override
void BlockCopyLocalValues(const ParallelVector &y, int64_t y_offset, int64_t local_offset, int64_t num_values) override
static std::vector< uint64_t > DefineExtents(uint64_t local_size, int comm_size, MPI_Comm communicator)
void Set(double value) override
double operator[](int64_t local_id) const override
std::vector< Operation > add_cache_
std::string PrintStr() const override
Print the local vectors to stings.
std::vector< double > MakeLocalVector() override
Return a vector containing the locally owned data.
std::vector< Operation > set_cache_
std::pair< int64_t, double > Operation
void CopyLocalValues(const ParallelVector &y) override
std::unique_ptr< ParallelVector > MakeCopy() const override