proj home

Files   Classes   Functions   Hierarchy  

pointsgraphtime Class Reference

Graph in time. X-axis [0,1]. Client adds y-values through push_front/push_back. More...

#include <pointsgraph.h>

Inheritance diagram for pointsgraphtime:
Collaboration diagram for pointsgraphtime:

List of all members.

Public Member Functions

 pointsgraphtime (uintc N_)
 Create N subdivision including endpoints.
void push_front (double yval)
 Start adding to the front.
void push_back (double yval)
 Start adding to the back.


Detailed Description

Graph in time. X-axis [0,1]. Client adds y-values through push_front/push_back.

Definition at line 88 of file pointsgraph.h.


Constructor & Destructor Documentation

pointsgraphtime::pointsgraphtime ( uintc  N_  ) 

Create N subdivision including endpoints.

Definition at line 171 of file pointsgraph.cpp.

00172 {
00173   N = N_;
00174 
00175   assert(N!=1);
00176   assert(N!=0);
00177 
00178   dx = (double)1.0/(N-1);
00179 }


Member Function Documentation

void pointsgraphtime::push_back ( double  yval  ) 

Start adding to the back.

Definition at line 198 of file pointsgraph.cpp.

References pointsgraph::pts.

Referenced by windowscaleD2test::test002().

00199 {
00200   uint imax=pts.size();
00201   for (uint i=0; i<imax; ++i)
00202     { pts[i].x -= dx; }
00203 
00204   if (imax==N)
00205     pts.pop_front();
00206 
00207   pts.push_back( point2<double>(1.0,yval) );
00208 
00209   assert(pts.size()<=N);
00210 }

void pointsgraphtime::push_front ( double  yval  ) 

Start adding to the front.

Definition at line 181 of file pointsgraph.cpp.

References pointsgraph::pts.

00182 {
00183 assert(false); // TODO write this function.
00184   for (uint i=0; i<N; ++i)
00185     { pts[i].x += dx; }
00186 
00187   pts.push_front( point2<double>(0,yval) );
00188 
00189   if (pts.size()==N)
00190   {
00191     pts.pop_back();
00192     return;
00193   }
00194 
00195   assert(pts.size()<N);
00196 }


The documentation for this class was generated from the following files:

Generated on Fri Mar 4 00:50:10 2011 for Chelton Evans Source by  doxygen 1.5.8