SparseLibrary  Version 1.6.0
BisectionHilbert.hpp
1 /*
2  * Copyright (c) 2007-2014, A. N. Yzelman, Utrecht University 2007-2011;
3  * KU Leuven 2011-2014.
4  * R. H. Bisseling, Utrecht University 2007-2014.
5  *
6  * This file is part of the Sparse Library.
7  *
8  * This library was developed under supervision of Prof. dr. Rob H. Bisseling at
9  * Utrecht University, from 2007 until 2011. From 2011-2014, development continued
10  * at KU Leuven, where Prof. dr. Dirk Roose contributed significantly to the ideas
11  * behind the newer parts of the library code.
12  *
13  * The Sparse Library is free software: you can redistribute it and/or modify
14  * it under the terms of the GNU General Public License as published by the
15  * Free Software Foundation, either version 3 of the License, or (at your
16  * option) any later version.
17  *
18  * The Sparse Library is distributed in the hope that it will be useful, but
19  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  * for more details.
22  *
23  * You should have received a copy of the GNU General Public License along
24  * with the Sparse Library. If not, see <http://www.gnu.org/licenses/>.
25  */
26 
27 
28 /*
29  * File created by:
30  * A. N. Yzelman, Dept. of Mathematics, Utrecht University, 2010.
31  */
32 
33 
34 #include "BlockHilbert.hpp"
35 
36 #ifndef _H_BISECTIONHILBERT
37 #define _H_BISECTIONHILBERT
38 
43 template< typename T >
44 class BisectionHilbert: public BlockHilbert< T > {
45 
46  private:
47 
48  protected:
49 
50  public:
51 
53  virtual ~BisectionHilbert() {}
54 
57  this->bisection = 1;
58  }
59 
68  BisectionHilbert( std::string file, T zero = 0 ) {
69  this->bisection = 1;
70  this->loadFromFile( file, zero );
71  }
72 
81  BisectionHilbert( std::vector< Triplet< T > >& input, unsigned long int m, unsigned long int n, T zero ) {
82  this->bisection = 1;
83  this->load( input, m, n, zero );
84  }
85 
86 };
87 
88 #endif
89 
The Bisection Hilbert triplet scheme.
Definition: BisectionHilbert.hpp:44
virtual unsigned long int m()
Queries the number of rows this matrix contains.
Definition: SparseMatrix.hpp:107
char bisection
Whether we use fixed block grid or a bisection-based grid.
Definition: BlockHilbert.hpp:59
BisectionHilbert(std::vector< Triplet< T > > &input, unsigned long int m, unsigned long int n, T zero)
Base constructor.
Definition: BisectionHilbert.hpp:81
The Block Hilbert triplet scheme.
Definition: BlockHilbert.hpp:52
void loadFromFile(const std::string file, const T zero=0)
Function which loads a matrix from a matrix market file.
Definition: SparseMatrix.hpp:89
BisectionHilbert()
Base constructor.
Definition: BisectionHilbert.hpp:56
virtual ~BisectionHilbert()
Base deconstructor.
Definition: BisectionHilbert.hpp:53
BisectionHilbert(std::string file, T zero=0)
Base constructor.
Definition: BisectionHilbert.hpp:68
virtual unsigned long int n()
Queries the number of columns this matrix contains.
Definition: SparseMatrix.hpp:115
A single triplet value.
Definition: Triplet.hpp:52
virtual void load(std::vector< Triplet< T > > &input, const LI m, const LI n, const T zero)
Definition: BlockHilbert.hpp:455