EPEC solve
Solving Equilibrium Problems with Equilibrium Constraints (EPECs)
Functions
Utils Namespace Reference

Functions

arma::sp_mat resize_patch (const arma::sp_mat &Mat, const unsigned int nR, const unsigned int nC)
 
arma::mat resize_patch (const arma::mat &Mat, const unsigned int nR, const unsigned int nC)
 
arma::vec resize_patch (const arma::vec &Mat, const unsigned int nR)
 
void appendSave (const vec &matrix, const std::string out, const std::string header="", bool erase=false)
 
long int appendRead (vec &matrix, const std::string in, long int pos, const std::string header="")
 
void appendSave (const sp_mat &matrix, const std::string out, const std::string header="", bool erase=false)
 
long int appendRead (sp_mat &matrix, const std::string in, long int pos, const std::string header="")
 
void appendSave (const std::vector< double > v, const std::string out, const std::string header="", bool erase=false)
 
long int appendRead (std::vector< double > &v, const std::string in, long int pos, const std::string header="")
 
void appendSave (const std::string v, const std::string out, bool erase=false)
 
long int appendRead (std::string &v, const std::string in, long int pos)
 
void appendSave (const long int v, const std::string out, const std::string header="", bool erase=false)
 
long int appendRead (long int &v, const std::string in, long int pos, const std::string header="")
 
void appendSave (const unsigned int v, const std::string out, const std::string header="", bool erase=false)
 
long int appendRead (unsigned int &v, const std::string in, long int pos, const std::string header="")
 
unsigned long int vec_to_num (std::vector< short int > binary)
 
std::vector< short int > num_to_vec (unsigned long int number, const unsigned int &nCompl)
 

Function Documentation

◆ appendRead() [1/6]

long int Utils::appendRead ( vec &  matrix,
const std::string  in,
long int  pos,
const std::string  header = "" 
)

◆ appendRead() [2/6]

long int Utils::appendRead ( sp_mat &  matrix,
const std::string  in,
long int  pos,
const std::string  header = "" 
)

◆ appendRead() [3/6]

long int Utils::appendRead ( std::vector< double > &  v,
const std::string  in,
long int  pos,
const std::string  header = "" 
)

◆ appendRead() [4/6]

long int Utils::appendRead ( std::string &  v,
const std::string  in,
long int  pos 
)

◆ appendRead() [5/6]

long int Utils::appendRead ( long int &  v,
const std::string  in,
long int  pos,
const std::string  header = "" 
)

◆ appendRead() [6/6]

long int Utils::appendRead ( unsigned int &  v,
const std::string  in,
long int  pos,
const std::string  header = "" 
)

◆ appendSave() [1/6]

void Utils::appendSave ( const vec &  matrix,
const std::string  out,
const std::string  header = "",
bool  erase = false 
)

◆ appendSave() [2/6]

void Utils::appendSave ( const sp_mat &  matrix,
const std::string  out,
const std::string  header = "",
bool  erase = false 
)

◆ appendSave() [3/6]

void Utils::appendSave ( const std::vector< double >  v,
const std::string  out,
const std::string  header = "",
bool  erase = false 
)

◆ appendSave() [4/6]

void Utils::appendSave ( const std::string  v,
const std::string  out,
bool  erase = false 
)

◆ appendSave() [5/6]

void Utils::appendSave ( const long int  v,
const std::string  out,
const std::string  header = "",
bool  erase = false 
)

◆ appendSave() [6/6]

void Utils::appendSave ( const unsigned int  v,
const std::string  out,
const std::string  header = "",
bool  erase = false 
)

◆ num_to_vec()

std::vector< short int > Utils::num_to_vec ( unsigned long int  number,
const unsigned int &  nCompl 
)

Definition at line 369 of file Utils.cpp.

◆ resize_patch() [1/3]

arma::sp_mat Utils::resize_patch ( const arma::sp_mat &  Mat,
const unsigned int  nR,
const unsigned int  nC 
)

Armadillo patch for resizing sp_mat

Armadillo sp_mat::resize() is not robust as it initializes garbage values to new columns. This fixes the problem by creating new columns with guaranteed zero values. For arma::sp_mat

Definition at line 10 of file Utils.cpp.

◆ resize_patch() [2/3]

arma::mat Utils::resize_patch ( const arma::mat &  Mat,
const unsigned int  nR,
const unsigned int  nC 
)

Armadillo patch for resizing mat

Armadillo mat::resize() is not robust as it initializes garbage values to new columns. This fixes the problem by creating new columns with guaranteed zero values. For arma::mat

Definition at line 35 of file Utils.cpp.

◆ resize_patch() [3/3]

arma::vec Utils::resize_patch ( const arma::vec &  Mat,
const unsigned int  nR 
)

Armadillo patch for resizing vec

Armadillo vec::resize() is not robust as it initializes garbage values to new columns. This fixes the problem by creating new columns with guaranteed zero values. For arma::vec

Definition at line 60 of file Utils.cpp.

◆ vec_to_num()

unsigned long int Utils::vec_to_num ( std::vector< short int >  binary)

Definition at line 357 of file Utils.cpp.