$extrastylesheet
#include <dense_vector_base.h>

Public Member Functions | |
| DenseVectorBase () | |
| virtual | ~DenseVectorBase () |
| virtual void | zero ()=0 |
| virtual T | el (const unsigned int i) const =0 |
| virtual T & | el (const unsigned int i)=0 |
| virtual unsigned int | size () const =0 |
| virtual bool | empty () const |
| void | print (std::ostream &os) const |
| void | print_scientific (std::ostream &os) const |
Friends | |
| std::ostream & | operator<< (std::ostream &os, const DenseVectorBase< T > &v) |
Defines an abstract dense vector base class for use in Finite Element-type computations. Specialized dense vectors, for example DenseSubVectors, can be derived from this class.
Definition at line 46 of file dense_vector_base.h.
| libMesh::DenseVectorBase< T >::DenseVectorBase | ( | ) | [inline] |
| virtual libMesh::DenseVectorBase< T >::~DenseVectorBase | ( | ) | [inline, virtual] |
| virtual T libMesh::DenseVectorBase< T >::el | ( | const unsigned int | i | ) | const [pure virtual] |
(i) element of the vector. Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
Referenced by libMesh::DenseMatrixBase< T >::condense(), and libMesh::DofMap::extract_local_vector().
| virtual T& libMesh::DenseVectorBase< T >::el | ( | const unsigned int | i | ) | [pure virtual] |
(i) element of the vector as a writeable reference. Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
| virtual bool libMesh::DenseVectorBase< T >::empty | ( | ) | const [inline, virtual] |
Reimplemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
Definition at line 85 of file dense_vector_base.h.
Referenced by libMesh::NumericVector< T >::insert().
{ return (this->size() == 0); }
| void libMesh::DenseVectorBase< T >::print | ( | std::ostream & | os | ) | const |
Pretty-print the vector to stdout.
Definition at line 62 of file dense_vector_base.C.
| void libMesh::DenseVectorBase< T >::print_scientific | ( | std::ostream & | os | ) | const |
Prints the entries of the vector with additional decimal places in scientific notation.
Definition at line 30 of file dense_vector_base.C.
{
#ifndef LIBMESH_BROKEN_IOSTREAM
// save the initial format flags
std::ios_base::fmtflags os_flags = os.flags();
// Print the vector entries.
for (unsigned int i=0; i<this->size(); i++)
os << std::setw(10)
<< std::scientific
<< std::setprecision(8)
<< this->el(i)
<< std::endl;
// reset the original format flags
os.flags(os_flags);
#else
// Print the matrix entries.
for (unsigned int i=0; i<this->size(); i++)
os << std::setprecision(8)
<< this->el(i)
<< std::endl;
#endif
}
| virtual unsigned int libMesh::DenseVectorBase< T >::size | ( | ) | const [pure virtual] |
Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
Referenced by libMesh::DenseMatrixBase< T >::condense(), libMesh::DenseVectorBase< Number >::empty(), libMesh::DofMap::extract_local_vector(), and libMesh::NumericVector< T >::insert().
| virtual void libMesh::DenseVectorBase< T >::zero | ( | ) | [pure virtual] |
Set every element in the vector to 0. Needs to be pure virtual since the storage method may be different in derived classes.
Implemented in libMesh::DenseVector< T >, and libMesh::DenseVector< Number >.
Referenced by libMesh::DofMap::extract_local_vector().
| std::ostream& operator<< | ( | std::ostream & | os, |
| const DenseVectorBase< T > & | v | ||
| ) | [friend] |
Same as above, but allows you to print using the usual stream syntax.
Definition at line 96 of file dense_vector_base.h.
{
v.print(os);
return os;
}