ergo
matrix_utilities.cc File Reference
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include "matrix_utilities.h"
#include "output.h"

Classes

struct  CompareClass< RandomAccessIterator >

Functions

mat::SizesAndBlocks prepareMatrixSizesAndBlocks (int n_basis_functions, int sparse_block_size, int factor1, int factor2, int factor3)
template<typename Treal , typename TIndexIterator >
void sortCoord (std::vector< Treal > const &xpos, std::vector< Treal > const &ypos, std::vector< Treal > const &zpos, TIndexIterator first, TIndexIterator last) throw (std::exception)
template<typename Treal >
void permuteAndRecurse (std::vector< Treal > const &xpos, std::vector< Treal > const &ypos, std::vector< Treal > const &zpos, std::vector< int > &index, int const first, int const last, std::vector< int > const &blockSizes, int bSizeIndex)
template<typename Treal >
void getPermutation (std::vector< Treal > const &xpos, std::vector< Treal > const &ypos, std::vector< Treal > const &zpos, std::vector< int > &permutation, std::vector< int > const &blockSizes)
void getMatrixPermutation (const BasisInfoStruct &basisInfo, int sparse_block_size, int factor1, int factor2, int factor3, std::vector< int > &permutation, std::vector< int > &inversePermutation)
void getMatrixPermutation (const BasisInfoStruct &basisInfo, int sparse_block_size, int factor1, int factor2, int factor3, std::vector< int > &permutation)
void fill_matrix_with_random_numbers (int n, symmMatrix &M)
static ergo_real rand_minus1_to_1 ()
void add_random_diag_perturbation (int n, symmMatrix &M, ergo_real eps)
void output_matrix (int n, const ergo_real *matrix, const char *matrixName)

Function Documentation

void add_random_diag_perturbation ( int  n,
symmMatrix M,
ergo_real  eps 
)
void fill_matrix_with_random_numbers ( int  n,
symmMatrix M 
)
void getMatrixPermutation ( const BasisInfoStruct basisInfo,
int  sparse_block_size,
int  factor1,
int  factor2,
int  factor3,
std::vector< int > &  permutation,
std::vector< int > &  inversePermutation 
)
void getMatrixPermutation ( const BasisInfoStruct basisInfo,
int  sparse_block_size,
int  factor1,
int  factor2,
int  factor3,
std::vector< int > &  permutation 
)
template<typename Treal >
void getPermutation ( std::vector< Treal > const &  xpos,
std::vector< Treal > const &  ypos,
std::vector< Treal > const &  zpos,
std::vector< int > &  permutation,
std::vector< int > const &  blockSizes 
)

References permuteAndRecurse().

Referenced by getMatrixPermutation().

void output_matrix ( int  n,
const ergo_real matrix,
const char *  matrixName 
)

Referenced by dft_get_uxc(), and dft_get_xc().

template<typename Treal >
void permuteAndRecurse ( std::vector< Treal > const &  xpos,
std::vector< Treal > const &  ypos,
std::vector< Treal > const &  zpos,
std::vector< int > &  index,
int const  first,
int const  last,
std::vector< int > const &  blockSizes,
int  bSizeIndex 
)

References sortCoord().

Referenced by getPermutation().

mat::SizesAndBlocks prepareMatrixSizesAndBlocks ( int  n_basis_functions,
int  sparse_block_size,
int  factor1,
int  factor2,
int  factor3 
)
static ergo_real rand_minus1_to_1 ( )
static
template<typename Treal , typename TIndexIterator >
void sortCoord ( std::vector< Treal > const &  xpos,
std::vector< Treal > const &  ypos,
std::vector< Treal > const &  zpos,
TIndexIterator  first,
TIndexIterator  last 
) throw (std::exception)

Referenced by permuteAndRecurse().