Changeset 758 in Sophya for trunk/SophyaLib
- Timestamp:
- Mar 2, 2000, 5:25:35 PM (26 years ago)
- Location:
- trunk/SophyaLib/Samba
- Files:
-
- 18 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/Samba/alm.h
r729 r758 1 1 #ifndef ALM_SEEN 2 2 #define ALM_SEEN 3 3 4 #include "nbrandom.h" 4 5 #include "nbmath.h" 6 #include "triangmtx.h" 5 7 #include "tvector.h" 6 #include "pexceptions.h"7 /*! Class for inferior triangular matrix (base class for the class Alm) */8 template <class T>9 class TriangularMatrix10 {11 12 public :13 14 TriangularMatrix() {};15 /* instanciate a triangular matrix from the number of rows */16 TriangularMatrix(int rowSize) : long_diag_((uint_4)rowSize) {elem_.ReSize((uint_4) (rowSize*(rowSize+1)/2) ); };17 TriangularMatrix(const TriangularMatrix<T>& a, bool share=false) : elem_(a.elem_, share), long_diag_(a.long_diag_) {;}18 /*! resize the matrix with a new number of rows */19 inline void ReSizeRow(int rowSize)20 {21 long_diag_=(uint_4)rowSize;22 elem_.ReSize(long_diag_*(long_diag_+1)/2);23 }24 inline void SetTemp(bool temp=false) const {elem_.SetTemp(temp);}25 26 inline TriangularMatrix<T>& operator = (const TriangularMatrix<T>& a)27 {28 elem_=a.elem_;29 long_diag_ = a.long_diag_;30 return *this;31 }32 inline T& operator()(int l, int m)33 {34 return elem_(adr_ij(l,m));35 }36 inline T const& operator()(int l, int m) const37 {38 return *(elem_.Begin()+ adr_ij(l,m));39 }40 inline int_4 rowNumber() const {return (int_4)long_diag_;}41 private:42 /*! compute the address of an element in the single array representing the matrix */43 inline uint_4 adr_ij(int i,int j) const44 {45 int adr= i*(i+1)/2+j;46 if ( adr >= elem_.Size() || adr <0 )47 {48 cout << " attention depassement dans triangularMatrix " << endl;49 cout << " l= " << i << " m= " << j << " tableau reserve longueur " << elem_.Size() << endl;50 }51 return(i*(i+1)/2+j);52 }53 54 uint_4 long_diag_;55 NDataBlock<T> elem_;56 57 };58 8 59 9 -
trunk/SophyaLib/Samba/sambainit.cc
r701 r758 1 // Classe d'initialisation du module Outils++ 2 #include <unistd.h> 1 // Classe d'initialisation du module Samba 3 2 4 3 #include "sambainit.h" 5 #include "ppersist.h"6 #include "objfio.h"7 #include "spherethetaphi.h"8 #include "spheregorski.h"9 #include "spherepos.h"10 4 11 5 int SambaInitiator::FgInit = 0; 12 6 13 7 SambaInitiator::SambaInitiator() 14 : PeidaOutilsInitiator()8 : SkyMapInitiator() 15 9 { 16 10 SambaInitiator::FgInit++; 17 11 if (SambaInitiator::FgInit > 1) return; 18 19 // Enregistrement des classes PPersist du modules Outils++ 20 21 PPRegister(FIO_SphereCoordSys); 22 23 PPRegister(FIO_SphereThetaPhi<float>); 24 PPRegister(FIO_SphereThetaPhi<double>); 25 PPRegister(FIO_SphereThetaPhi< complex<float> >); 26 PPRegister(FIO_SphereThetaPhi< complex<double> >); 27 28 PPRegister(FIO_SphereGorski<float>); 29 PPRegister(FIO_SphereGorski<double>); 30 PPRegister(FIO_SphereGorski< complex<float> >); 31 PPRegister(FIO_SphereGorski< complex<double> >); 32 33 12 ntinit = new NToolsInitiator; 34 13 } 35 14 … … 37 16 { 38 17 SambaInitiator::FgInit--; 18 if (FgInit < 1) delete ntinit; 39 19 } 40 20 -
trunk/SophyaLib/Samba/sambainit.h
r518 r758 7 7 8 8 // Classe d''initialisation pour les modules de PEIDA++ 9 #include "outilsinit.h" 9 #include "skymapinit.h" 10 #include "ntoolsinit.h" 10 11 11 class SambaInitiator : public PeidaOutilsInitiator {12 class SambaInitiator : public SkyMapInitiator { 12 13 private: 13 14 static int FgInit; 15 NToolsInitiator * ntinit; 14 16 public: 15 17 SambaInitiator(); … … 17 19 }; 18 20 19 #undef PeidaInit20 #define PeidaInit() SambaInitiator _sambainitiator_21 #undef SophyaInit 22 #define SophyaInit() SambaInitiator sambainitiator 21 23 22 24 #endif
Note:
See TracChangeset
for help on using the changeset viewer.