KADATH
list_comp.hpp
1 /*
2  Copyright 2018 Philippe Grandclement
3 
4  This file is part of Kadath.
5 
6  Kadath is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  Kadath is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Kadath. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef __LIST_COMP_HPP_
21 #define __LIST_COMP_HPP_
22 
23 #include "headcpp.hpp"
24 
25 namespace Kadath {
33 class List_comp {
34  protected:
35  int ncomp ;
36  int valence ;
38 
39  public:
44  List_comp (int nc, int val) ;
45  List_comp (const List_comp&) ;
46 
47  ~List_comp() ;
48 
53  Array<int>* set(int i) ;
54 
59  Array<int>* operator() (int i) const ;
60 
64  int get_ncomp() const {return ncomp ;} ;
65 
69  Array<int>** get_pcomp() const {return pcomp ;} ;
70 
71 } ;
72 
73 }
74 #endif
Class for storing a list of tensorial components.
Definition: list_comp.hpp:33
int get_ncomp() const
Returns the number of components.
Definition: list_comp.hpp:64
~List_comp()
Destructor.
Definition: list_comp.cpp:42
Array< int > ** pcomp
Array of pointers on each componenent.
Definition: list_comp.hpp:37
int valence
Number of indices for each component.
Definition: list_comp.hpp:36
List_comp(int nc, int val)
Standard constructor.
Definition: list_comp.cpp:28
int ncomp
Number of stored components.
Definition: list_comp.hpp:35
Array< int > ** get_pcomp() const
Returns a pointer of the liste.
Definition: list_comp.hpp:69
Array< int > * set(int i)
Read/write of one particular component.
Definition: list_comp.cpp:49
Array< int > * operator()(int i) const
Read/write of one particular component.
Definition: list_comp.cpp:57