32 #ifndef _math_scmat_dim_h
33 #define _math_scmat_dim_h
35 #include <util/keyval/keyval.h>
36 #include <util/state/state.h>
60 SCBlockInfo(
int n,
int nblocks = 0,
const int *blocksizes = 0);
82 int nelem()
const {
return n_; }
84 int nblock()
const {
return nblocks_; }
86 int start(
int i)
const {
return start_[i]; }
88 int size(
int i)
const {
return size_[i]; }
90 int fence(
int i)
const {
return start_[i] + size_[i]; }
92 void elem_to_block(
int i,
int &block,
int &offset);
120 SCDimension(
int n,
int nblocks,
const int *blocksizes = 0,
121 const char*
name = 0);
142 int n()
const {
return n_; }
145 const char*
name()
const {
return name_; }
179 operator int()
const;
int equiv(const SCDimension *) const
Test to see if two dimensions are equivalent.
RefSCDimension()
Initializes the dimension pointer to 0.
The SCDimension class is used to determine the size and blocking of matrices.
Definition: dim.h:109
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
A template class that maintains references counts.
Definition: ref.h:332
int nblock() const
Return the number of blocks.
Definition: dim.h:84
void save_data_state(StateOut &)
Save the base classes (with save_data_state) and the members in the same order that the StateIn CTOR ...
SCBlockInfo(int n, int nblocks=0, const int *blocksizes=0)
Create a SCBlockInfo object.
int fence(int i) const
Return the last index + 1 for block i.
Definition: dim.h:90
Provides a few utility routines common to all Ref template instantiations.
Definition: ref.h:292
Restores objects that derive from SavableState.
Definition: statein.h:70
The RefSCDimension class is a smart pointer to an SCDimension specialization.
Definition: dim.h:156
int start(int i) const
Return the starting index for block i.
Definition: dim.h:86
int nelem() const
Return the total number of elements.
Definition: dim.h:82
RefSCDimension & operator=(SCDimension *d)
Make this refer to d.
void print(std::ostream &o=ExEnv::out0()) const
Print information about this dimension to o.
const char * name() const
Return the name of the dimension.
Definition: dim.h:145
Serializes objects that derive from SavableState.
Definition: stateout.h:61
SCBlockInfo contains blocking information for the SCDimension class.
Definition: dim.h:50
int n() const
Return the dimension.
Definition: dim.h:142
int equiv(SCBlockInfo *bi)
Return nonzero if this is equivalent to bi.
static std::ostream & out0()
Return an ostream that writes from node 0.
Base class for objects that can save/restore state.
Definition: state.h:46
The base class for all reference counted objects.
Definition: ref.h:194
void set_subdim(int i, const RefSCDimension &dim)
Set subdimension information.
void print(std::ostream &o=ExEnv::out0()) const
Print the object to the stream o.
RefSCDimension subdim(int i)
Retreive subdimension information.
int size(int i) const
Return the size of block i.
Definition: dim.h:88
Ref< SCBlockInfo > blocks()
Return the blocking information for this dimension.
Definition: dim.h:148
Generated at Sun Jan 26 2020 23:33:03 for MPQC
2.3.1 using the documentation package Doxygen
1.8.16.