ergo
sparse_pattern.cc File Reference

Class that can be used to store sparse matrix patterns. More...

#include "output.h"
#include "dft_common.h"
#include "sparse_pattern.h"

Macros

#define USE_CUTHILL_MCKEE   0
 prepares a shell map and matching AO map permuted to optimize performance of the XC code. More...
 

Functions

static void prepareAOMap (const BasisInfoStruct &bis, const int *shellMap, int *aoMap)
 Prepares the AO map given a shell map. More...
 
static void clusterShells (const ShellSpecStruct *shells, const Box &box, const std::vector< int > &inputList, std::vector< int > &result, int depth)
 
void setupShellMap (const BasisInfoStruct &bis, int *shellMap, int *aoMap)
 

Detailed Description

Class that can be used to store sparse matrix patterns.

Author
: Pawel Salek responsible

Macro Definition Documentation

◆ USE_CUTHILL_MCKEE

#define USE_CUTHILL_MCKEE   0

prepares a shell map and matching AO map permuted to optimize performance of the XC code.

We cannot reuse the permutations used in the matrix library because they can are AO based and not shell based.

Parameters
shellMap- previously allocated vector that will be filled with the permutation data.
aoMap- corresponding AO permutation vector, preallocated.

The code uses a variant of the Cuthill-McKee algorithm to determine the shell map. The AO map is trivially generated from the shell map (perhaps it could be a separate function?). Generation of the optimal performance is in general a complex matter but since we use a discrete selection criteria to determine the shell radius, Cuthill-McKee will do.

Function Documentation

◆ clusterShells()

static void clusterShells ( const ShellSpecStruct shells,
const Box box,
const std::vector< int > &  inputList,
std::vector< int > &  result,
int  depth 
)
static

References Box::getMaxDim(), Box::hi, and Box::lo.

Referenced by setupShellMap().

◆ prepareAOMap()

static void prepareAOMap ( const BasisInfoStruct bis,
const int *  shellMap,
int *  aoMap 
)
static

◆ setupShellMap()