source: Sophya/trunk/ArchTOIPipe/Kernel/ringphase.h@ 2397

Last change on this file since 2397 was 2385, checked in by aubourg, 22 years ago

rings

File size: 907 bytes
Line 
1// This may look like C code, but it is really -*- C++ -*-
2
3// ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
4// Eric Aubourg
5// Christophe Magneville
6// Reza Ansari
7// $Id: ringphase.h,v 1.1 2003-05-19 23:31:29 aubourg Exp $
8
9#ifndef RINGPHASE_H
10#define RINGPHASE_H
11
12#include "config.h"
13using namespace std;
14
15#ifdef WITH_SOPHYA
16#include "array.h"
17#include "pexceptions.h"
18using namespace SOPHYA;
19#else
20#include "apexceptions.h"
21#endif
22
23class RingPhase {
24public:
25 virtual ~RingPhase() {};
26
27 virtual int getNSamples() const = 0;
28 virtual double getPhase(int i) const = 0;
29
30};
31
32class SimpleRingPhase : public RingPhase {
33public:
34 SimpleRingPhase(int nsamples) : n(nsamples) {}
35
36 int getNSamples() const {return n;}
37 double getPhase(int i) const {return (double)i / n;}
38
39protected:
40 int n;
41};
42
43#endif
Note: See TracBrowser for help on using the repository browser.