Go to the documentation of this file.
20 #ifndef LIBMESH_DENSE_VECTOR_BASE_H
21 #define LIBMESH_DENSE_VECTOR_BASE_H
25 #include "libmesh/libmesh_common.h"
64 virtual void zero() = 0;
69 virtual T
el(
const unsigned int i)
const = 0;
74 virtual T &
el(
const unsigned int i) = 0;
79 virtual unsigned int size()
const = 0;
84 virtual bool empty()
const {
return (this->
size() == 0); }
89 void print(std::ostream & os)
const;
112 #endif // LIBMESH_DENSE_VECTOR_BASE_H
DenseVectorBase()=default
Constructor.
DenseVectorBase & operator=(const DenseVectorBase &)=default
The libMesh namespace provides an interface to certain functionality in the library.
Defines an abstract dense vector base class for use in Finite Element-type computations.
virtual T el(const unsigned int i) const =0
friend std::ostream & operator<<(std::ostream &os, const DenseVectorBase< T > &v)
Same as above, but allows you to print using the usual stream syntax.
virtual bool empty() const
virtual ~DenseVectorBase()=default
virtual unsigned int size() const =0
virtual void zero()=0
Set every element in the vector to 0.
void print_scientific(std::ostream &os, unsigned precision=8) const
Prints the entries of the vector with additional decimal places in scientific notation.
void print(std::ostream &os) const
Pretty-print the vector to stdout.