OpenFPM_pdata  4.1.0
Project that contain the implementation of distributed structures
 
Loading...
Searching...
No Matches
Vector.hpp
1/*
2 * Vector.hpp
3 *
4 * Created on: Nov 27, 2015
5 * Author: i-bird
6 */
7
8#ifndef OPENFPM_NUMERICS_SRC_VECTOR_VECTOR_HPP_
9#define OPENFPM_NUMERICS_SRC_VECTOR_VECTOR_HPP_
10
11#include "config.h"
12#include "util/linalgebra_lib.hpp"
13
20template<typename T, unsigned int impl>
21class rval
22{
23};
24
25
26// Eigen::Matrix<T, Eigen::Dynamic, 1>
27
28#ifdef HAVE_EIGEN
29#include <Eigen/Sparse>
30#define DEFAULT_VECTOR = EIGEN_BASE
31#else
32#define DEFAULT_VECTOR = 0
33#endif
34
38template<typename T,unsigned int impl DEFAULT_VECTOR >
39class Vector
40{
43
45 int stub_i;
46
47public:
48
54 Vector(const Vector<T> & v)
55 :stub(0),stub_i(0)
56 {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
57
64 :stub(0),stub_i(0)
65 {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
66
72 Vector(size_t n)
73 :stub(0),stub_i(0)
74 {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
75
78 :stub(0),stub_i(0)
79 {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
80
87 Vector(size_t n, size_t n_row_local)
88 :stub(0),stub_i(0)
89 {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
90
97 void resize(size_t row, size_t row_n) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
98
105 void insert(size_t i, T val) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
106
114 inline T & insert(size_t i) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;return stub;}
115
121 inline const T & insert(size_t i) const {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl; return stub;}
122
130 const T & operator()(size_t i) const {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;return stub;}
131
139 T & operator()(size_t i) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;return stub;}
140
144 void scatter() {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
145
151 void fromFile(std::string file) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl;}
152
153
161 Vector<T> & operator=(const Vector<T> & v) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl; return *this;}
162
170 Vector<T> & operator=(Vector<T> && v) {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl; return *this;}
171
177 int & getVec() {std::cerr << __FILE__ << ":" << __LINE__ << " Error in order to use this class you must compile OpenFPM with linear algebra support" << std::endl; return stub_i;}
178};
179
180#ifdef HAVE_EIGEN
181#include "Vector_eigen.hpp"
182#endif
183
184#ifdef HAVE_PETSC
185#include "Vector_petsc.hpp"
186#endif
187
188#endif /* OPENFPM_NUMERICS_SRC_VECTOR_VECTOR_HPP_ */
Sparse Matrix implementation stub object when OpenFPM is compiled with no linear algebra support.
Definition Vector.hpp:40
Vector(const Vector< T > &v)
stub copy constructor
Definition Vector.hpp:54
void fromFile(std::string file)
fromFile
Definition Vector.hpp:151
int & getVec()
stub getVec
Definition Vector.hpp:177
Vector(Vector< T > &&v)
stub copy constructor
Definition Vector.hpp:63
const T & insert(size_t i) const
stub insert
Definition Vector.hpp:121
const T & operator()(size_t i) const
stub
Definition Vector.hpp:130
void resize(size_t row, size_t row_n)
stub resize
Definition Vector.hpp:97
Vector< T > & operator=(Vector< T > &&v)
stub operator=
Definition Vector.hpp:170
void scatter()
scatter
Definition Vector.hpp:144
Vector(size_t n)
stub constructor from number of rows
Definition Vector.hpp:72
T stub
stub
Definition Vector.hpp:42
T & operator()(size_t i)
stub
Definition Vector.hpp:139
int stub_i
stub
Definition Vector.hpp:45
void insert(size_t i, T val)
stub insert
Definition Vector.hpp:105
Vector()
stub default constructor
Definition Vector.hpp:77
Vector(size_t n, size_t n_row_local)
stub constructor
Definition Vector.hpp:87
Vector< T > & operator=(const Vector< T > &v)
stub operator=
Definition Vector.hpp:161
T & insert(size_t i)
stub insert
Definition Vector.hpp:114
It store one row value of a vector.
Definition Vector.hpp:22