xc
Variation.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // xc utils library; general purpose classes and functions.
4 //
5 // Copyright (C) Luis C. Pérez Tato
6 //
7 // XC utils is free software: you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License as published by
9 // the Free Software Foundation, either version 3 of the License, or
10 // (at your option) any later version.
11 //
12 // This software is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program.
19 // If not, see <http://www.gnu.org/licenses/>.
20 //----------------------------------------------------------------------------
21 //Variation.hxx
22 
23 #ifndef VARIATION_HXX
24 #define VARIATION_HXX
25 
26 #include <vector>
27 #include <iostream>
28 
29 namespace cmb_acc{
30 
31 class ActionWrapperList;
32 
34 //
36 class Variation: public std::vector<double>
37  {
38  void print(std::ostream &os) const;
39  public:
41  Variation(const size_t &sz=0,const double &valor=0.0)
42  : std::vector<double>(sz,valor) {}
43  static Variation concat(const Variation &a,const Variation &b);
44  bool compatible(const ActionWrapperList &lvr);
45  friend std::ostream &operator<<(std::ostream &os,const Variation &v);
46  };
47 
48 std::ostream &operator<<(std::ostream &os,const Variation &v);
49 } //fin namespace nmb_acc.
50 
51 #endif
List of representative values of actions (ActionWrapper objects).
Definition: ActionWrapperList.h:42
Routines to generate combinations of actions.
Vector that stores the factors of the linear combination of actions.
Definition: Variation.h:36
static Variation concat(const Variation &a, const Variation &b)
Concatena a la variación a la variación b.
Definition: Variation.cc:41
bool compatible(const ActionWrapperList &lvr)
Return verdadero si las acciones que contiene la variaciónes son compatibles.
Definition: Variation.cc:55
Variation(const size_t &sz=0, const double &valor=0.0)
Constructor.
Definition: Variation.h:41