Changeset 758 in Sophya


Ignore:
Timestamp:
Mar 2, 2000, 5:25:35 PM (26 years ago)
Author:
ansari
Message:

Restructuration de Sophya en petits modules (creation de SkyMap en particulier)

Reza 2/3/2000

Location:
trunk/SophyaLib/Samba
Files:
18 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/Samba/alm.h

    r729 r758  
    11#ifndef ALM_SEEN
    22#define ALM_SEEN
     3
    34#include "nbrandom.h"
    45#include "nbmath.h"
     6#include "triangmtx.h"
    57#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 TriangularMatrix
    10   {
    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) const
    37   {
    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) const
    44 {
    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   };
    588
    599
  • 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
    32
    43#include "sambainit.h"
    5 #include "ppersist.h"
    6 #include "objfio.h"
    7 #include "spherethetaphi.h"
    8 #include "spheregorski.h"
    9 #include "spherepos.h"
    104
    115int SambaInitiator::FgInit = 0;
    126
    137SambaInitiator::SambaInitiator()
    14   : PeidaOutilsInitiator()
     8  : SkyMapInitiator()
    159{
    1610  SambaInitiator::FgInit++;
    1711  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;
    3413}
    3514
     
    3716{
    3817  SambaInitiator::FgInit--;
     18  if (FgInit < 1)  delete ntinit;
    3919}
    4020
  • trunk/SophyaLib/Samba/sambainit.h

    r518 r758  
    77
    88// Classe d''initialisation pour les modules de PEIDA++
    9 #include "outilsinit.h"
     9#include "skymapinit.h"
     10#include "ntoolsinit.h"
    1011
    11 class SambaInitiator : public PeidaOutilsInitiator {
     12class SambaInitiator : public SkyMapInitiator {
    1213private:
    1314  static int FgInit;
     15  NToolsInitiator * ntinit;
    1416public:
    1517                        SambaInitiator();
     
    1719};
    1820
    19 #undef PeidaInit
    20 #define PeidaInit() SambaInitiator _sambainitiator_
     21#undef SophyaInit
     22#define SophyaInit() SambaInitiator sambainitiator
    2123
    2224#endif
Note: See TracChangeset for help on using the changeset viewer.