20 #ifndef LIBMESH_DENSE_VECTOR_BASE_H
21 #define LIBMESH_DENSE_VECTOR_BASE_H
25 #include "libmesh/libmesh_common.h"
62 virtual void zero() = 0;
69 virtual T
el(
const unsigned int i)
const = 0;
76 virtual T &
el(
const unsigned int i) = 0;
81 virtual unsigned int size()
const = 0;
86 virtual bool empty()
const {
return (this->
size() == 0); }
93 void print(std::ostream & os)
const;
102 friend std::ostream & operator << (std::ostream & os, const DenseVectorBase<T> & v)
121 #endif // LIBMESH_DENSE_VECTOR_BASE_H
void print_scientific(std::ostream &os, unsigned precision=8) const
以科学计数法在额外的小数位数下打印向量的条目。
virtual void zero()=0
将向量中的每个元素设置为0。由于派生类中的存储方法可能不同,需要将其声明为纯虚函数。
DenseVectorBase & operator=(const DenseVectorBase &)=default
virtual unsigned int size() const =0
void print(std::ostream &os) const
将向量漂亮地打印到 stdout。
virtual bool empty() const
virtual ~DenseVectorBase()=default
DenseVectorBase()=default
构造函数。
virtual T el(const unsigned int i) const =0