xc
LoadCombinationVector.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 //LoadCombinationVector.hxx
22 //Almacena las sumas correspondientes a cada una de las variaciones
23 //de una familia de acciones.
24 
25 #ifndef LOADCOMBINATIONVECTOR_HXX
26 #define LOADCOMBINATIONVECTOR_HXX
27 
28 #include "utility/load_combinations/actions/Action.h"
29 #include "utility/matrices/m_double.h"
30 
31 namespace cmb_acc{
33 //
36 class LoadCombinationVector: public std::vector<Action>, public CommandEntity
37  {
38  private:
39  bool Existe(const Action &f) const;
40  bool Nula(const double &tol) const;
41  size_t CuentaNulas(const double &tol) const;
42  size_t CuentaDistintas(const LoadCombinationVector &s2) const;
44  public:
46  LoadCombinationVector(const size_t &sz= 0);
47  static LoadCombinationVector ProdCartesiano(const LoadCombinationVector &f1,const LoadCombinationVector &f2,const double &tol);
48  static LoadCombinationVector Concat(const LoadCombinationVector &f1,const LoadCombinationVector &f2,const double &tol);
49  void Numera(const std::string &prefix= "H");
50  const LoadCombinationVector &GetDistintas(void) const;
51  const LoadCombinationVector &GetNoNulas(const double &tol) const;
52  m_double getCoefficients(const std::vector<std::string> &) const;
53  boost::python::list getCoefficientsPy(const boost::python::list &) const;
54  void Print(std::ostream &os) const;
55  };
56 
57 std::ostream &operator<<(std::ostream &os,const LoadCombinationVector &vc);
58 
59 } //fin namespace nmb_acc.
60 
61 #endif
Routines to generate combinations of actions.
boost::python::list getCoefficientsPy(const boost::python::list &) const
Return the factors that correspond to the actions in the argument in each of the load combinations of...
Definition: LoadCombinationVector.cc:212
LoadCombinationVector(const size_t &sz=0)
Constructor.
Definition: LoadCombinationVector.cc:27
Action or linear combination of actions.
Definition: Action.h:44
void Numera(const std::string &prefix="H")
Appends the prefix text &#39;HNNN=&#39; to the name of each of the vector components, where NNN is the hypoth...
Definition: LoadCombinationVector.cc:186
static LoadCombinationVector Concat(const LoadCombinationVector &f1, const LoadCombinationVector &f2, const double &tol)
Concatenate the combination of the vector arguments.
Definition: LoadCombinationVector.cc:166
const LoadCombinationVector & GetDistintas(void) const
Return the combinations filtering the repeated ones.
Definition: LoadCombinationVector.cc:83
Objet that can execute python scripts.
Definition: CommandEntity.h:40
void Print(std::ostream &os) const
Print stuff.
Definition: LoadCombinationVector.cc:223
static LoadCombinationVector ProdCartesiano(const LoadCombinationVector &f1, const LoadCombinationVector &f2, const double &tol)
Builds the cartesian product of the combinations from both vectors.
Definition: LoadCombinationVector.cc:145
Combination container.
Definition: LoadCombinationVector.h:36
m_double getCoefficients(const std::vector< std::string > &) const
Return the factors that correspond to the actions in the argument in each of the load combinations of...
Definition: LoadCombinationVector.cc:195
const LoadCombinationVector & GetNoNulas(const double &tol) const
Return the non-zero combinations.
Definition: LoadCombinationVector.cc:51