Wavefunction data structure. More...
#include <ColumnBundle.h>
Public Member Functions | |
int | nCols () const |
number of columns accessor | |
size_t | colLength () const |
column length accessor | |
operator bool () const | |
Test nullness of ColumnBundle. | |
size_t | index (int i, size_t j) const |
Index of the i'th column j'th point into the data array. | |
bool | isSpinor () const |
int | spinorLength () const |
void | init (int nc, size_t len, const Basis *b, const QuantumNumber *q, bool onGpu=false) |
constructor helper | |
void | free () |
Force cleanup. | |
ColumnBundle (int nc=0, size_t len=0, const Basis *b=NULL, const QuantumNumber *q=NULL, bool onGpu=false) | |
ColumnBundle (const ColumnBundle &) | |
copy constructor | |
ColumnBundle (ColumnBundle &&) | |
move constructor | |
ColumnBundle | similar (int ncOverride=-1) const |
ColumnBundle & | operator= (const ColumnBundle &) |
copy-assignment | |
ColumnBundle & | operator= (ColumnBundle &&) |
move-assignment | |
ColumnBundle | getSub (int colStart, int colStop) const |
get a range of columns as a ColumnBundle | |
void | setSub (int colStart, const ColumnBundle &) |
set columns (starting at colStart) from a ColumnBundle, ignoring columns that would go beyond nCols() | |
complexScalarFieldTilde | getColumn (int i, int s) const |
Expand the i'th column and s'th spinor component from reduced to full G-space. | |
void | setColumn (int i, int s, const complexScalarFieldTilde &) |
Redeuce a full G-space vector and store it as the i'th column and s'th spinor component. | |
void | accumColumn (int i, int s, const complexScalarFieldTilde &) |
Redeuce a full G-space vector and accumulate onto the i'th column and s'th spinor component. | |
void | randomize (int colStart, int colStop) |
randomize a selected range of columns | |
Public Member Functions inherited from ManagedMemory< complex > | |
complex * | data () |
Return a pointer to the actual data Return a CPU pointer to the actual data, will move data from GPU to CPU if necessary In GPU mode, care must be taken when calling this from multiple cpu threads Only the "GPU Owner" thread may call this when the data is actually on the GPU. Ideally call once from main thread to get data onto the cpu before launching other cpu threads. | |
const complex * | data () const |
Return a const pointer to the actual data Return a CPU pointer to the actual data, will move data from GPU to CPU if necessary In GPU mode, care must be taken when calling this from multiple cpu threads Only the "GPU Owner" thread may call this when the data is actually on the GPU. Ideally call once from main thread to get data onto the cpu before launching other cpu threads. | |
complex * | dataGpu () |
Get a GPU data pointer (must be called from GPU owner thread) | |
const complex * | dataGpu () const |
Get a const GPU data pointer (must be called from GPU owner thread) | |
size_t | nData () const |
number of data points | |
bool | isOnGpu () const |
Check where the data is (for #ifdef simplicity exposed even when no GPU_ENABLED) | |
complex * | begin () |
pointer to start of array | |
const complex * | begin () const |
const pointer to start of array | |
const complex * | cbegin () const |
const pointer to start of array | |
complex * | end () |
pointer just past end of array | |
const complex * | end () const |
const pointer just past end of array | |
const complex * | cend () const |
const pointer just past end of array | |
complex * | dataPref () |
const complex * | dataPref () const |
void | send (int dest, int tag=0) const |
send to another process | |
void | recv (int src, int tag=0) |
receive from another process | |
void | bcast (int root=0) |
synchronize across processes (using value on specified root process) | |
void | allReduce (MPIUtil::ReduceOp op, bool safeMode=false) |
apply all-to-all reduction (see MPIUtil::allReduce) | |
void | read (const char *fname) |
binary read from a file | |
void | read (FILE *filep) |
binary read from a stream | |
void | write (const char *fname) const |
binary-write to a file | |
void | write (FILE *filep) const |
binary-write toa stream | |
void | read_real (const char *fname) |
binary read real-part from file, setting imaginary parts to 0 | |
void | read_real (FILE *filep) |
binary read real-part from stream, setting imaginary parts to 0 | |
void | write_real (const char *fname) const |
binary write real-parts to file | |
void | write_real (FILE *filep) const |
binary write real-parts to stream | |
void | dump (const char *fname, bool realPartOnly) const |
write as complex or real-part alone and report discarded imaginary part, if any | |
void | zero () |
set all elements to zero | |
Public Attributes | |
const QuantumNumber * | qnum |
const Basis * | basis |
Additional Inherited Members | |
Protected Member Functions inherited from ManagedMemory< complex > | |
ManagedMemory () | |
Initialize a valid state, but don't allocate anything. | |
void | memFree () |
Free memory. | |
void | memInit (string category, size_t nElem, bool onGpu=false) |
Allocate memory. | |
void | memMove (ManagedMemory< complex > &&) |
Steal the other object's data (used for move constructors/assignment) | |
Wavefunction data structure.
ColumnBundle ColumnBundle::similar | ( | int | ncOverride = -1 | ) | const |
Create a column bundle like this (without copying data) optionally with different number of columns (if ncOverride>=0)