Amesos2 - Direct Sparse Solver Interfaces  Version of the Day
basker_decl.hpp
1 // @HEADER
2 // *****************************************************************************
3 // Basker: A Direct Linear Solver package
4 //
5 // Copyright 2011 NTESS and the Basker contributors.
6 // SPDX-License-Identifier: LGPL-2.1-or-later
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef BASKER_DECL_HPP
11 #define BASKER_DECL_HPP
12 
13 #include "basker_types.hpp"
14 
15 namespace BaskerClassicNS{
16 
17  template <class Int, class Entry>
18  class BaskerClassic
19  {
20 
21  public:
22  BaskerClassic();
23  BaskerClassic(Int nnzL, Int nnzU);
24  ~BaskerClassic();
25  int preorder(Int *row_perm, Int *col_perm);
26  int factor(Int nrow, Int ncol , Int nnz, Int *col_ptr, Int *row_idx, Entry *val);
27  int returnL(Int *dim, Int *nnz, Int **col_ptr, Int **row_idx, Entry **val);
28  int returnU(Int *dim, Int *nnz, Int **col_ptr, Int **row_idx, Entry **val);
29  int returnP(Int **p);
30  int solve( Entry* b, Entry* x);
31  int solveMultiple(Int nrhs, Entry *b, Entry *x);
32 
33  Int get_NnzL();
34  Int get_NnzU();
35  Int get_NnzLU();
36  //int solve();
37 
38  private:
39  int basker_dfs(
40  Int n,
41  Int j,
42  Int *Li,
43  Int *Lp,
44  Int *color,
45  Int *pattern, /* o/p */
46  Int *top, /* o/p */
47 
48  Int *tpinv,
49  Int *stack
50  );
51  void free_factor();
52  void free_perm_matrix();
53  int low_tri_solve_csc(Int n, Int* col_ptr, Int *row_idx, Entry *val, Entry *x, Entry *b);
54  int up_tri_solve_csc(Int n, Int* col_ptr, Int *row_idx, Entry *val, Entry *x, Entry *b);
55  int permute_row(Int *p, basker_matrix<Int,Entry> *B);
56  int permute_column(Int *p, basker_matrix<Int, Entry> *B);
57  int sort_factors();
58  Entry* entry_realloc(Entry *old, Int old_size, Int new_size);
59  Int* int_realloc(Int *old, Int old_size, Int new_size);
60  basker_matrix<Int, Entry> *A;
61  basker_matrix<Int, Entry> *L;
62  basker_matrix<Int, Entry> *U;
63  Int *in_perm;
64  Int *pinv;
65  Int actual_lnnz;
66  Int actual_unnz;
67  bool been_fact;
68  bool perm_flag;
69 
70  };
71 
72 }/*End namespace*/
73 #endif