ergo
random_matrices.h File Reference

Header file containing declarations of functions required for testing purposes. More...

#include "matrix_typedefs.h"
#include "realtype.h"
#include "matrix_utilities.h"
#include "integral_matrix_wrappers.h"
#include "SizesAndBlocks.h"
#include "Matrix.h"
#include "Vector.h"
#include "MatrixSymmetric.h"
#include "MatrixTriangular.h"
#include "MatrixGeneral.h"
#include "VectorGeneral.h"
#include "output.h"
#include "files_dense.h"
#include "files_sparse.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>

Go to the source code of this file.

Macros

#define MAX_DOUBLE   std::numeric_limits<real>::max()
 
#define MIN_DOUBLE   std::numeric_limits<real>::min()
 
#define PI   3.14159265
 

Typedefs

typedef intervalType IntervalType
 
typedef symmMatrix MatrixTypeInner
 
typedef triangMatrix TriangMatrixType
 
typedef normalMatrix MatrixGeneral
 
typedef std::vector< int > VectorTypeInt
 

Functions

void print_matrix (std::vector< ergo_real > const &A)
 
template<typename Matrix >
void init_matrix (Matrix &X, const int N, int blockSizesMultuple)
 Create hierarchical matrix structure. More...
 
void get_random_matrix (int N, MatrixTypeInner &X)
 
void get_all_eigenvalues_of_matrix (std::vector< ergo_real > &eigvalList, const MatrixTypeInner &M)
 
void sprandsym (int N, MatrixTypeInner &X, MatrixGeneral &Q, vector< ergo_real > &D, const double MATRIX_SPARSITY)
 
int get_matrix_from_sparse (char *filename, MatrixTypeInner &X)
 
int get_matrix_from_sparse_vec (char *filename, std::vector< int > &I, std::vector< int > &J, std::vector< real > &val)
 
int get_matrix_from_binary (char *filename, MatrixTypeInner &X)
 
int get_matrix_from_binary_vec (char *filename, std::vector< int > &I, std::vector< int > &J, std::vector< real > &val, int &N)
 
int get_matrix_from_full (char *filename, MatrixTypeInner &X)
 

Detailed Description

Header file containing declarations of functions required for testing purposes.

Functions include generation of the random dense matrices, random sparse symmetric matrices, initialization of the hierarchical matrix structure, work with files and printing matrix to the screen.

Author
Anastasia Kruchinina
See also
random_matrices.cc

Macro Definition Documentation

◆ MAX_DOUBLE

#define MAX_DOUBLE   std::numeric_limits<real>::max()

◆ MIN_DOUBLE

#define MIN_DOUBLE   std::numeric_limits<real>::min()

◆ PI

#define PI   3.14159265

Referenced by sprandsym().

Typedef Documentation

◆ IntervalType

◆ MatrixGeneral

◆ MatrixTypeInner

◆ TriangMatrixType

◆ VectorTypeInt

typedef std::vector<int> VectorTypeInt

Function Documentation

◆ get_all_eigenvalues_of_matrix()

void get_all_eigenvalues_of_matrix ( std::vector< ergo_real > &  eigvalList,
const MatrixTypeInner M 
)

References A, and mat::syev().

Referenced by main().

◆ get_matrix_from_binary()

int get_matrix_from_binary ( char *  filename,
MatrixTypeInner X 
)

References A, and mat::read_matrix().

◆ get_matrix_from_binary_vec()

int get_matrix_from_binary_vec ( char *  filename,
std::vector< int > &  I,
std::vector< int > &  J,
std::vector< real > &  val,
int &  N 
)

References A, and mat::read_matrix().

◆ get_matrix_from_full()

int get_matrix_from_full ( char *  filename,
MatrixTypeInner X 
)

References A, and mat::read_matrix().

◆ get_matrix_from_sparse()

int get_matrix_from_sparse ( char *  filename,
MatrixTypeInner X 
)

◆ get_matrix_from_sparse_vec()

int get_matrix_from_sparse_vec ( char *  filename,
std::vector< int > &  I,
std::vector< int > &  J,
std::vector< real > &  val 
)

◆ get_random_matrix()

void get_random_matrix ( int  N,
MatrixTypeInner X 
)

Referenced by main().

◆ init_matrix()

template<typename Matrix >
void init_matrix ( Matrix &  X,
const int  N,
int  blockSizesMultuple 
)

Create hierarchical matrix structure.

Template Parameters
Matrixtype of the matrix (ex. symmMatrix)

!!

References cols, and rows.

◆ print_matrix()

void print_matrix ( std::vector< ergo_real > const &  A)

References A.

◆ sprandsym()

void sprandsym ( int  N,
MatrixTypeInner X,
MatrixGeneral Q,
vector< ergo_real > &  D,
const double  MATRIX_SPARSITY 
)

References cols, PI, rows, template_blas_cos(), and template_blas_sin().

Referenced by main().