gridvector.h
来自「Flens库-一个在C++的矩阵运算库」· C头文件 代码 · 共 150 行
H
150 行
#ifndef POISSON_SOLVER_FLENS_IMPL_GRIDVECTOR_H#define POISSON_SOLVER_FLENS_IMPL_GRIDVECTOR_H 1#include <flens/flens.h>namespace flens {//== GridVector1D ==============================================================class GridVector1D;template <>struct TypeInfo<GridVector1D>{ typedef GridVector1D Impl; typedef double ElementType;};//------------------------------------------------------------------------------class GridVector1D : public Vector<GridVector1D>{ public: typedef DenseVector<Array<double> > Grid; GridVector1D(); GridVector1D(int _rh, int firstIndex=0); GridVector1D & operator=(double value); template <typename RHS> GridVector1D & operator=(const Vector<RHS> &rhs); template <typename RHS> GridVector1D & operator+=(const Vector<RHS> &rhs); int rh; Grid grid;};//------------------------------------------------------------------------------std::ostream &operator<<(std::ostream &out, const GridVector1D &v);//== GridVector2D ==============================================================class GridVector2D;template <>struct TypeInfo<GridVector2D>{ typedef GridVector2D Impl; typedef double ElementType;};//------------------------------------------------------------------------------class GridVector2D : public Vector<GridVector2D>{ public: typedef GeMatrix<FullStorage<double, RowMajor> > Grid; GridVector2D(); GridVector2D(int _rh); GridVector2D & operator=(double value); template <typename RHS> GridVector2D & operator=(const Vector<RHS> &rhs); template <typename RHS> GridVector2D & operator+=(const Vector<RHS> &rhs); template <typename RHS> GridVector2D & operator-=(const Vector<RHS> &rhs); int rh; Grid grid;};//------------------------------------------------------------------------------std::ostream &operator<<(std::ostream &out, const GridVector2D &v);//== StaggeredGridVector2D =====================================================template <bool DirectionX, bool DirectionY>class StaggeredGridVector2D;template <bool DirectionX, bool DirectionY>struct TypeInfo<StaggeredGridVector2D<DirectionX, DirectionY> >{ typedef StaggeredGridVector2D<DirectionX, DirectionY> Impl; typedef double ElementType;};//------------------------------------------------------------------------------template <bool DirectionX, bool DirectionY>class StaggeredGridVector2D : public Vector<StaggeredGridVector2D<DirectionX, DirectionY> >{ public: typedef GeMatrix<FullStorage<double, RowMajor> > Grid; StaggeredGridVector2D(); StaggeredGridVector2D(int _rh); StaggeredGridVector2D & operator=(double value); template <typename RHS> StaggeredGridVector2D & operator=(const Vector<RHS> &rhs); template <typename RHS> StaggeredGridVector2D & operator+=(const Vector<RHS> &rhs); int rh; Grid grid;};//------------------------------------------------------------------------------template <bool DirectionX, bool DirectionY>std::ostream &operator<<(std::ostream &out, const StaggeredGridVector2D<DirectionX, DirectionY> &v);} // namespace flens#include <poisson_solver/flens_impl/gridvector.tcc>#endif // POISSON_SOLVER_FLENS_IMPL_GRIDVECTOR_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?