HubbardGPU
Hubbard diagonalisation on the GPU (and CPU)
 All Classes Files Functions Variables Typedefs Friends Macros
hamsparse2D_CSR.h
Go to the documentation of this file.
1 /* Copyright (C) 2012 Ward Poelmans
2 
3 This file is part of Hubbard-GPU.
4 
5 Hubbard-GPU is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9 
10 Hubbard-GPU is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with Hubbard-GPU. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef HAMSPARSE2D_CSR_H
20 #define HAMSPARSE2D_CSR_H
21 
22 #include "ham2D.h"
23 #include <vector>
24 
30 {
31  public:
32  SparseHamiltonian2D_CSR(int L,int D, int Nu, int Nd, double J, double U);
33  virtual ~SparseHamiltonian2D_CSR();
34 
35  void BuildSparseHam();
36 
37  void PrintSparse() const;
38 
39  void PrintRawCSR() const;
40 
41  virtual void mvprod(double *, double *, double) const;
42 
43  double* Umatrix() const;
44 
45  protected:
46 
48  std::vector<double> Up_data_CSR;
50  std::vector<double> Down_data_CSR;
51 
53  std::vector<unsigned int> Up_col;
55  std::vector<unsigned int> Down_col;
56 
58  std::vector<unsigned int> Up_row;
60  std::vector<unsigned int> Down_row;
61 
62 };
63 
64 #endif /* HAMSPARSE2D_CSR_H */
65 
66 /* vim: set ts=8 sw=4 tw=0 expandtab :*/