EPEC solve
Solving Equilibrium Problems with Equilibrium Constraints (EPECs)
utils.h
Go to the documentation of this file.
1 #pragma once
2 
7 #include "epecsolve.h"
8 #include <armadillo>
9 #include <fstream>
10 #include <set>
11 
12 using namespace arma;
13 
14 namespace Utils {
15 arma::sp_mat resize_patch(const arma::sp_mat &Mat, const unsigned int nR,
16  const unsigned int nC);
17 
18 arma::mat resize_patch(const arma::mat &Mat, const unsigned int nR,
19  const unsigned int nC);
20 
21 arma::vec resize_patch(const arma::vec &Mat, const unsigned int nR);
22 
23 // Saving and retrieving an arma::vec
24 void appendSave(const vec &matrix, const std::string out,
25  const std::string header = "", bool erase = false);
26 
27 long int appendRead(vec &matrix, const std::string in, long int pos,
28  const std::string header = "");
29 
30 // Saving and retrieving an arma::sp_mat
31 void appendSave(const sp_mat &matrix, const std::string out,
32  const std::string header = "", bool erase = false);
33 
34 long int appendRead(sp_mat &matrix, const std::string in, long int pos,
35  const std::string header = "");
36 
37 // Saving and retrieving an std::vector<double>
38 void appendSave(const std::vector<double> v, const std::string out,
39  const std::string header = "", bool erase = false);
40 
41 long int appendRead(std::vector<double> &v, const std::string in, long int pos,
42  const std::string header = "");
43 
44 // Saving std::string
45 void appendSave(const std::string v, const std::string out, bool erase = false);
46 
47 long int appendRead(std::string &v, const std::string in, long int pos);
48 
49 // Saving A long int
50 void appendSave(const long int v, const std::string out,
51  const std::string header = "", bool erase = false);
52 
53 long int appendRead(long int &v, const std::string in, long int pos,
54  const std::string header = "");
55 
56 // Saving A unsigned int
57 void appendSave(const unsigned int v, const std::string out,
58  const std::string header = "", bool erase = false);
59 
60 long int appendRead(unsigned int &v, const std::string in, long int pos,
61  const std::string header = "");
62 
63 // Binary encoding functions for the LCP class
64 unsigned long int vec_to_num(std::vector<short int> binary);
65 
66 std::vector<short int> num_to_vec(unsigned long int number,
67  const unsigned int &nCompl);
68 } // namespace Utils
69 
70 // namespace Utils
unsigned long int vec_to_num(std::vector< short int > binary)
Definition: Utils.cpp:357
void appendSave(const vector< double > v, const string out, const string header, bool erase)
Definition: Utils.cpp:155
arma::vec resize_patch(const arma::vec &Mat, const unsigned int nR)
Definition: Utils.cpp:60
Definition: utils.h:14
long int appendRead(vector< double > &v, const string in, long int pos, const string header)
Definition: Utils.cpp:167
std::vector< short int > num_to_vec(unsigned long int number, const unsigned int &nCompl)
Definition: Utils.cpp:369