28#ifndef _chemistry_qc_ccr12_tensor_h
29#define _chemistry_qc_ccr12_tensor_h
33#include <util/misc/compute.h>
34#include <util/group/memory.h>
35#include <util/group/memregion.h>
36#include <util/group/message.h>
37#include <util/group/thread.h>
38#include <math/distarray4/distarray4.h>
41#define DISK_BASED_SMITH
43#ifdef DISK_BASED_SMITH
63#ifndef DISK_BASED_SMITH
81#ifndef DISK_BASED_SMITH
89 long get_filesize()
const {
return filesize_;};
134#ifndef DISK_BASED_SMITH
static std::ostream & out0()
Return an ostream that writes from node 0.
The MemoryGrpRegion is a MemoryGrp proxy to a region of a MemoryGrp.
Definition memregion.h:46
The base class for all reference counted objects.
Definition ref.h:192
A template class that maintains references counts.
Definition ref.h:361
void set_filesize(long i)
set/get the filesize of the tensor
double ddot(Ref< Tensor > &) const
obtain the ddot of two tensors
void zero()
initialize/clear tensors to zero
std::string filename_
for use in disk-based algorithm
Definition tensor.h:54
void daxpy(const Ref< Tensor > &, double)
perform daxpy of tensors (self+=a*other)
long filesize_
tensor size in double
Definition tensor.h:60
Ref< Tensor > clone() const
return a tensor that have the same hashtable, and is intilaized to zero
void createfile()
create/delete the distributed file for the tensor
bool is_this_local(long tag)
returns if a block associated with long tag resides in a local memory or not
void print(const std::string &label, std::ostream &os=ExEnv::out0()) const
print
bool exists(long tag) const
does this block exist?
std::vector< long > determine_filesizes()
determines the distribution of blocks to nodes
Ref< Tensor > copy() const
return a copy of self
std::fstream * file_
data area
Definition tensor.h:66
void get_block(long tag, double *data)
get a block from the distributed file (non-blocking)
std::fstream * file()
returns MemoryGrpRegion for this tensor
Definition tensor.h:84
void input_offset(long tag, long offset)
input for the hash table
std::string filename() const
returns filename_
Definition tensor.h:78
void assign(double a)
assigns all values to a
void sync() const
sync
Definition tensor.h:137
void scale(double a)
scale self by a
void put_block(long tag, double *data)
put a block to the distributed file (non-blocking)
void add_block(long tag, double *data)
add a block to the distributed file (non-blocking); double* data will be destroyed
double norm() const
obtain the norm of a tensor
std::map< long, long > hash_table_
hash table: hash_table_.insert(key,offset)
Definition tensor.h:57
Contains all MPQC code up to version 3.
Definition mpqcin.h:14
double RMS(const Tensor &t)
Computes the `‘RMS norm’' of the tensor, defined as tensor->norm() divided by the size of the tensor.