OOCholmod
 All Classes Functions
factor.h
1 //
2 // factor.h
3 // OOCholmod
4 //
5 // Created by Morten Nobel-Jørgensen / Asger Nyman Christiansen
6 // Copyright (c) 2013 DTU Compute. All rights reserved.
7 // License: LGPL 3.0
8 
9 #pragma once
10 
11 #include <iostream>
12 
13 #include <cholmod.h>
14 
15 
16 namespace oocholmod {
17 
18 
19  class SparseMatrix; // forward declaration
20  class DenseMatrix;
21 
22  class Factor {
23  friend class SparseMatrix;
24  Factor(cholmod_factor *factor);
25  public:
26  Factor();
27  Factor(Factor&& move);
28  Factor& operator=(Factor&& other);
29  virtual ~Factor();
30 
31  // returns true if factorization is done
32  // Throws a OOCException if matrix cannot be factorized
33  void factorize(const SparseMatrix& sparse);
34 
35  friend DenseMatrix solve(const Factor& F, const DenseMatrix& b);
36  friend SparseMatrix solve(const Factor& F, const SparseMatrix& b);
37 
38  bool isInitialized();
39  private:
40  Factor(const Factor& that) {} // prevent copy constructor
41  cholmod_factor *factor;
42  };
43 
44  DenseMatrix solve(const Factor& F, const DenseMatrix& b);
45  SparseMatrix solve(const Factor& F, const SparseMatrix& b);
46 }
47 
Definition: dense_matrix.h:31
Definition: factor.h:22
Definition: sparse_matrix.h:62