28#ifndef _math_scmat_dim_h
29#define _math_scmat_dim_h
31#include <util/keyval/keyval.h>
32#include <util/state/state.h>
56 SCBlockInfo(
int n,
int nblocks = 0,
const int *blocksizes = 0);
78 int nelem()
const {
return n_; }
80 int nblock()
const {
return nblocks_; }
82 int start(
int i)
const {
return start_[i]; }
84 int size(
int i)
const {
return size_[i]; }
86 int fence(
int i)
const {
return start_[i] + size_[i]; }
88 void elem_to_block(
int i,
int &block,
int &offset);
116 SCDimension(
int n,
int nblocks,
const int *blocksizes = 0,
117 const char*
name = 0);
138 int n()
const {
return n_; }
141 const char*
name()
const {
return name_.c_str(); }
175 operator int()
const;
static std::ostream & out0()
Return an ostream that writes from node 0.
Provides a few utility routines common to all Ref template instantiations.
Definition ref.h:321
The base class for all reference counted objects.
Definition ref.h:192
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition dim.h:152
RefSCDimension()
Initializes the dimension pointer to 0.
RefSCDimension(SCDimension *d)
Make this refer to d.
RefSCDimension & operator=(SCDimension *d)
Make this refer to d.
RefSCDimension(const RefSCDimension &d)
Make this and d refer to the same SCDimension.
RefSCDimension & operator=(const RefSCDimension &d)
Make this and d refer to the same SCDimension.
A template class that maintains references counts.
Definition ref.h:361
SCBlockInfo contains blocking information for the SCDimension class.
Definition dim.h:46
int start(int i) const
Return the starting index for block i.
Definition dim.h:82
SCBlockInfo(const Ref< KeyVal > &keyval)
The KeyVal constructor.
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
void print(std::ostream &o=ExEnv::out0()) const
Print the object to the stream o.
int fence(int i) const
Return the last index + 1 for block i.
Definition dim.h:86
SCBlockInfo(int n, int nblocks=0, const int *blocksizes=0)
Create a SCBlockInfo object.
int size(int i) const
Return the size of block i.
Definition dim.h:84
int nelem() const
Return the total number of elements.
Definition dim.h:78
int nblock() const
Return the number of blocks.
Definition dim.h:80
int equiv(SCBlockInfo *bi)
Return nonzero if this is equivalent to bi.
RefSCDimension subdim(int i)
Retreive subdimension information.
void set_subdim(int i, const RefSCDimension &dim)
Set subdimension information.
The SCDimension class is used to determine the size and blocking of matrices.
Definition dim.h:105
int equiv(const SCDimension *) const
Test to see if two dimensions are equivalent.
int n() const
Return the dimension.
Definition dim.h:138
const Ref< SCBlockInfo > & blocks() const
Return the blocking information for this dimension.
Definition dim.h:144
const char * name() const
Return the name of the dimension.
Definition dim.h:141
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
SCDimension(const Ref< KeyVal > &)
The KeyVal constructor.
SCDimension(int n, const char *name=0)
Create a dimension with an optional name.
void print(std::ostream &o=ExEnv::out0()) const
Print information about this dimension to o.
Base class for objects that can save/restore state.
Definition state.h:45
Restores fundamental and user-defined types from images created with StateOut.
Definition statein.h:79
Serializes fundamental and user-defined types.
Definition stateout.h:71
Contains all MPQC code up to version 3.
Definition mpqcin.h:14