Psi4
vector_base.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License along
22  * with this program; if not, write to the Free Software Foundation, Inc.,
23  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24  *
25  * @END LICENSE
26  */
27 
28 #ifndef _psi_src_lib_libmemtrix_vector_base_h_
29 #define _psi_src_lib_libmemtrix_vector_base_h_
30 
32 #include <cstring> // for size_t
33 
34 namespace psi{ namespace mcscf{
35 
37 {
38 public:
39  VectorBase();
40  VectorBase(int rows);
41  ~VectorBase();
42 
43  //Inlines
44  int get_elements() {return(elements_);}
45  void set(int i, double value) {vector_[i] = value;}
46  void add(int i, double value) {vector_[i] += value;}
47  double get(int i) {return(vector_[i]);}
48  double* get_vector() {return(vector_);}
49 
50  void print();
51  void copy(VectorBase& source);
52 private:
53  // Vector size
54  size_t elements_;
55 
56  // Vector data
57  double* vector_;
58 };
59 
60 }}
61 
62 #endif // _psi_src_lib_libmemtrix_vector_base_h_
size_t elements_
Definition: vector_base.h:54
double * get_vector()
Definition: vector_base.h:48
Definition: pointgrp.h:105
void copy(VectorBase &source)
Definition: vector_base.cc:62
SharedWavefunction mcscf(SharedWavefunction, Options &)
Definition: mcscf.cc:72
double * vector_
Definition: vector_base.h:57
void print()
Definition: vector_base.cc:54
void add(int i, double value)
Definition: vector_base.h:46
Definition: vector_base.h:36
int get_elements()
Definition: vector_base.h:44
void set(int i, double value)
Definition: vector_base.h:45
~VectorBase()
Definition: vector_base.cc:49