CppNoddy  0.92
Loading...
Searching...
No Matches
Sequential_Matrix_base.h
Go to the documentation of this file.
1/// \file Sequential_Matrix_base.h
2/// A base matrix class to ensure a consistent interface between
3/// the inheriting dense/banded matrix classes.
4
5#ifndef SEQUENTIALMATRIXBASE_H
6#define SEQUENTIALMATRIXBASE_H
7
8namespace CppNoddy {
9
10 /// A base matrix class for sequential matrices.
11 /// The sparse/banded/dense matrix classes inherit from
12 /// this which allows for
13
14 template < typename _Type >
16
17 public:
18
19 /// An empty constructor
21
23
24 // ACCESS TO ELEMENTS -- virtual access operators.
25 // These are slow if used via the base class
26 virtual const _Type& operator()(const std::size_t& row, const std::size_t& col) const = 0;
27 virtual _Type& operator()(const std::size_t& row, const std::size_t& col) = 0;
28 virtual const _Type& get(const std::size_t& row, const std::size_t& col) const = 0;
29 virtual _Type& set(const std::size_t& row, const std::size_t& col) = 0;
30
31 // ENQUIRIES
32 virtual std::size_t nrows() const = 0;
33 virtual std::size_t ncols() const = 0;
34 virtual std::size_t nelts() const = 0;
35
36 // scaling
37 virtual void scale( const _Type& mult ) = 0;
38
39 // OUTPUT
40 virtual void dump() const = 0;
41
42 private:
43
44 }
45 ; // END CLASS
46
47 template <typename _Type>
49 {}
50
51 template <typename _Type>
53 {}
54
55} // end namespace
56
57
58#endif
A base matrix class for sequential matrices.
virtual void scale(const _Type &mult)=0
virtual const _Type & get(const std::size_t &row, const std::size_t &col) const =0
virtual void dump() const =0
virtual std::size_t nelts() const =0
virtual _Type & operator()(const std::size_t &row, const std::size_t &col)=0
virtual std::size_t nrows() const =0
virtual _Type & set(const std::size_t &row, const std::size_t &col)=0
Sequential_Matrix_base()
An empty constructor.
virtual const _Type & operator()(const std::size_t &row, const std::size_t &col) const =0
virtual std::size_t ncols() const =0
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...

© 2012

R.E. Hewitt