dm.hpp
1 /*
2  * This file is part of CasADi.
3  *
4  * CasADi -- A symbolic framework for dynamic optimization.
5  * Copyright (C) 2010-2023 Joel Andersson, Joris Gillis, Moritz Diehl,
6  * KU Leuven. All rights reserved.
7  * Copyright (C) 2011-2014 Greg Horn
8  *
9  * CasADi is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU Lesser General Public
11  * License as published by the Free Software Foundation; either
12  * version 3 of the License, or (at your option) any later version.
13  *
14  * CasADi is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  * Lesser General Public License for more details.
18  *
19  * You should have received a copy of the GNU Lesser General Public
20  * License along with CasADi; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22  *
23  */
24 
25 #ifndef CASADI_DM_HPP
26 #define CASADI_DM_HPP
27 
28 #include "dm_fwd.hpp"
29 #include "matrix_decl.hpp"
30 
31 namespace casadi {
32 
33 
34  template<>
35  DM DM::
36  solve(const DM& A, const DM& b,
37  const std::string& lsolver, const Dict& dict);
38 
39  template<>
40  DM DM::
41  inv(const DM& A,
42  const std::string& lsolver, const Dict& dict);
43  template<>
44  DM DM::
45  pinv(const DM& A, const std::string& lsolver,
46  const Dict& dict);
47 
48  template<>
49  DM DM::
50  rand(const Sparsity& sp); // NOLINT(runtime/threadsafe_fn)
51 
52  template<>
53  DM DM::
54  expm(const DM& A);
55 
56  template<>
57  DM DM::
58  expm_const(const DM& A, const DM& t);
59 
60  template<>
61  DM DM::
62  _logsumexp(const DM& A);
63 
64  template<>
65  std::vector<DM> DM::
66  cse(const std::vector<DM>& e);
67 
68  template<>
69  std::vector<double> DM::call(const Function& f, const std::vector<double>& dep);
70 
71  template<> void DM::export_code(const std::string& lang,
72  std::ostream &stream, const Dict& options) const;
73 
74  template<>
75  Dict DM::info() const;
76 
77  template<>
78  void DM::to_file(const std::string& filename, const Sparsity& sp,
79  const double* nonzeros, const std::string& format);
80 
81  template<>
82  DM DM::from_file(const std::string& filename, const std::string& format_hint);
83 
84 #ifndef CASADI_DM_INSTANTIATOR_CPP
85  extern template class Matrix<double>;
86 #endif // CASADI_DM_INSTANTIATOR_CPP
87 
88 } // namespace casadi
89 
90 #endif // CASADI_DM_HPP
static std::vector< Matrix< double > > call(const Function &f, const std::vector< Matrix< double > > &x)
static Matrix< double > expm_const(const Matrix< double > &A, const Matrix< double > &t)
void export_code(const std::string &lang, std::ostream &stream=casadi::uout(), const Dict &options=Dict()) const
Export matrix in specific language.
static Matrix< double > expm(const Matrix< double > &A)
static Matrix< double > inv(const Matrix< double > &A)
void to_file(const std::string &filename, const std::string &format="") const
static Matrix< double > _logsumexp(const Matrix< double > &x)
static Matrix< double > rand(casadi_int nrow=1, casadi_int ncol=1)
Create a matrix with uniformly distributed random numbers.
static Matrix< double > solve(const Matrix< double > &A, const Matrix< double > &b)
static Matrix< double > from_file(const std::string &filename, const std::string &format_hint="")
static std::vector< Matrix< double > > cse(const std::vector< Matrix< double > > &e)
static Matrix< double > pinv(const Matrix< double > &x)
The casadi namespace.
Definition: archiver.cpp:28
template class CASADI_EXPORT Matrix< double >
GenericType::Dict Dict
C++ equivalent of Python's dict or MATLAB's struct.
Matrix< double > DM
Definition: dm_fwd.hpp:33
std::string filename(const std::string &path)
Definition: ghc.cpp:55