~njansson/dolfin/hpc

« back to all changes in this revision

Viewing changes to src/kernel/la/dolfin/uBlasFactory.h

  • Committer: Johannes Ring
  • Date: 2008-03-05 22:43:06 UTC
  • Revision ID: johannr@simula.no-20080305224306-2npsdyhfdpl2esji
The BIG commit!

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Copyright (C) 2007 Ola Skavhaug.
2
 
// Licensed under the GNU LGPL Version 2.1.
3
 
//
4
 
// First added:  2007-12-06
5
 
// Last changed: 2007-12-06
6
 
 
7
 
 
8
 
#ifndef __UBLAS_FACTORY_H
9
 
#define __UBLAS_FACTORY_H
10
 
 
11
 
#include <dolfin/uBlasMatrix.h>
12
 
#include <dolfin/uBlasVector.h>
13
 
#include <dolfin/SparsityPattern.h>
14
 
#include <dolfin/LinearAlgebraFactory.h>
15
 
 
16
 
namespace dolfin
17
 
{
18
 
 
19
 
  class uBlasFactory: public LinearAlgebraFactory
20
 
  {
21
 
  public:
22
 
 
23
 
    /// Destructor
24
 
    virtual ~uBlasFactory() {}
25
 
 
26
 
    /// Create empty matrix
27
 
    uBlasMatrix<ublas_sparse_matrix>* createMatrix() const;
28
 
 
29
 
    /// Create empty sparsity pattern 
30
 
    SparsityPattern* createPattern() const;
31
 
 
32
 
    /// Create empty vector
33
 
    uBlasVector* createVector() const;
34
 
 
35
 
    /// Return sigleton instance
36
 
    static uBlasFactory& instance() { return ublasfactory; }
37
 
 
38
 
  private:
39
 
    /// Private Constructor
40
 
    uBlasFactory() {}
41
 
 
42
 
    static uBlasFactory ublasfactory;
43
 
 
44
 
  };
45
 
 
46
 
}
47
 
 
48
 
#endif