Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/paramin-beta/netdatacontrol.h
[mareframe] / trunk / paramin-beta / netdatacontrol.h Repository:
ViewVC logotype

Annotation of /trunk/paramin-beta/netdatacontrol.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef netdatacontrol_h
2 :     #define netdatacontrol_h
3 :    
4 :     #include "paramin.h"
5 :     #include "doublevector.h"
6 :    
7 :     /**
8 :     * \class NetInfo
9 :     * \brief The class NetInfo keeps together information concerning status of data that is being sent/received during netcommunication. It contains functions to get information about status of data.
10 :     */
11 :    
12 :     class NetInfo {
13 :     public:
14 :     int set;
15 :     int sent;
16 :     int received;
17 :     int numPendingAnswers;
18 :    
19 :     NetInfo();
20 :     ~NetInfo();
21 :     int hasSet();
22 :     int hasReceived();
23 :     int hasSent();
24 :     int numCopiesSent();
25 :     };
26 :    
27 :     /**
28 :     * \class Coordinates
29 :     * \brief The class Coordinates stores the datapair (x, y) where x is a vector of p paramaters. It contains functions to set and access (x, y) and parameter p in x.
30 :     */
31 :    
32 :     class Coordinates {
33 :     private:
34 :     DoubleVector x;
35 :     double y;
36 :     public:
37 :     Coordinates();
38 :     ~Coordinates();
39 :     const DoubleVector& getX();
40 :     double getParameter(int num);
41 :     double getY();
42 :     void setX(const DoubleVector& v1);
43 :     void setParameter(double p, int num);
44 :     void setY(double y1);
45 :     int getNumParameters();
46 :     };
47 :    
48 :     /**
49 :     * \class NetDataControl
50 :     * \brief The class NetDataControl stores a set of datapairs (x[0..p-1], y) which can be identified with a specific tag and each pair has a unique identity. x[0..p-1] is thought of being sent to a process and y is received from a process using net communication. NetDataControl provides functions to initialize and access each datapair and get information about the status of net communication for the set of datapairs as well as each pair. NetDataControl uses the class coordinates to store each datapair and the class NetInfo to set information about the status of the data pair concerning netcommunication
51 :     */
52 :    
53 :     class NetDataControl {
54 :     private:
55 :     /**
56 :     * \brief identification for the set of datapairs.
57 :     */
58 :     int tag;
59 :     /**
60 :     * \brief number of vectors set, numberOfx <= totalNumx
61 :     */
62 :     int numberOfx;
63 :     /**
64 :     * \brief total number of vectors that can be set,
65 :     */
66 :     int totalNumx;
67 :     /**
68 :     * \brief number of x-vectors that have been sent to processes
69 :     */
70 :     int numberSent;
71 :     /**
72 :     * \brief number of y-s that have been received from processes
73 :     */
74 :     int numberAnswers;
75 :     /**
76 :     * \brief nextAns points to identity of the next data pair
77 :     */
78 :     int nextAns;
79 :     /**
80 :     * \brief number of parameters in vector x
81 :     */
82 :     int numPar;
83 :     /**
84 :     * \brief stores a set data pairs equals totalNumx
85 :     */
86 :     Coordinates** xyCoord;
87 :     /**
88 :     * \brief for each datapair there is a corresponding class which keeps track of the status of netcommunication.
89 :     */
90 :     NetInfo** nInfo;
91 :     /**
92 :     * \brief resendID points to the last x which can be resent
93 :     */
94 :     int resendID;
95 :     public:
96 :     NetDataControl(int numberOfx, int numberOfParameters, int t);
97 :     ~NetDataControl();
98 :     void setX(const DoubleVector& x1);
99 :     void setY(int id, double fx);
100 :     void setDataPair(const DoubleVector& x1, double fx);
101 :     const DoubleVector& getX(int id);
102 :     const DoubleVector& getNextXToSend();
103 :     double getY(int id);
104 :     const DoubleVector& getNextAnsweredX();
105 :     double getNextAnsweredY();
106 :     int getNextSendID();
107 :     int getNextXToResend();
108 :     void sentOne(int id);
109 :     void resentOne(int id);
110 :     int getIDToSetNext();
111 :     int getTag();
112 :     int getNumLeftToSend();
113 :     int allSent();
114 :     int getNumNotAnswered();
115 :     int getTotalReceived();
116 :     int getTotalSet();
117 :     void setFirstAnswered();
118 :     int allReceived();
119 :     int getNumAnswered();
120 :     int getLastSetID();
121 :     int getMaxNumData();
122 :     int hasAnswer(int id);
123 :     int isFull();
124 :     };
125 :    
126 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge