My Project
ElementContainerMatrix.hh
00001 /*
00002 $Id: ElementContainerMatrix.hh 2295 2011-08-10 02:57:13Z jisuzuki $
00003 */
00004 
00005 
00006 #ifndef ELEMENTCONTAINERMATRIX
00007 #define ELEMENTCONTAINERMATRIX
00008 
00009 #include "Header.hh"
00010 #include "NeutronVector.hh"
00011 #include "ElementContainer.hh"
00012 #include "ElementContainerArray.hh"
00013 
00015 
00023 class ElementContainerMatrix 
00024   : public NeutronVector< ElementContainerArray, HeaderBase >
00025 {
00026 public:
00027   using NeutronVector< ElementContainerArray, HeaderBase >::operator();
00028 
00029   ElementContainerMatrix();
00035   ElementContainerMatrix( HeaderBase pheader );
00042   ElementContainerMatrix( const NeutronVector< ElementContainerArray, HeaderBase > &ob );
00044 
00045   ElementContainer*      operator()( UInt4 Mindex, UInt4 Aindex );
00053   vector<Double>*        operator()( UInt4 Mindex, UInt4 Aindex, UInt4 Cindex );
00061   vector<Double>*        operator()( UInt4 Mindex, UInt4 Aindex, string Key );
00070   ElementContainerMatrix( const ElementContainerMatrix &ob );
00071   
00072   vector<UInt4> SaveToBinFile( string key, string FileName );
00083   PyObject *SaveToBinFilePy( string key, string FileName );
00090   void ReadBinFile( string FileName, 
00091                     vector<UInt4> dimensions, 
00092                     string key );
00101   void ReadBinFile( string FileName, PyObject *dimensions, 
00102                     string key );
00111   void AppendErr( string Counts, string Error, Double ErrorValue=0.0 );
00122 
00123   void AllSum(ElementContainer &res) {
00124         for (UInt4 i=0;i<v.size();++i) {
00125           for (UInt4 j=0;j<v[i]->v.size();++j) {
00126                 res += *v[i]->v[j];
00127           }
00128         }
00129   }
00130 
00131   ElementContainerMatrix Transpose();
00139   ElementContainerMatrix Mul( Double d );
00140   ElementContainerMatrix &MulMySelf( Double d );
00141   ElementContainerMatrix Mul( Double d, Double e );
00142   ElementContainerMatrix &MulMySelf( Double d, Double e );
00143   ElementContainerMatrix Mul( pair<Double,Double> &p ){ return Mul(p.first,p.second); }
00144   ElementContainerMatrix &MulMySelf( pair<Double,Double> &p ){ return MulMySelf(p.first,p.second); }
00145 
00146   ElementContainerMatrix Plus( Double d );
00147   ElementContainerMatrix &PlusMySelf( Double d );
00148   ElementContainerMatrix Plus( Double d, Double e );
00149   ElementContainerMatrix &PlusMySelf( Double d, Double e );
00150   ElementContainerMatrix Plus( pair<Double,Double> &p ){ return Plus(p.first,p.second); }
00151   ElementContainerMatrix &PlusMySelf( pair<Double,Double> &p ){ return PlusMySelf(p.first,p.second); }
00152 };
00153 
00154 
00155 #endif
 All Classes Functions Variables Friends