ALPS Home Libraries License Support People ALPS Web Site

PrevUpHomeNext

Class template Point

alps::plot::Point — a class to store a single point in the plot

Synopsis

// In header: <alps/plot.h>

template<typename C> 
class Point {
public:
  // types
  typedef C                           value_type;  // the type for a coordinate 
  typedef std::vector< C >::size_type size_type;   // the type to store the number of coordinates 

  // construct/copy/destruct
  Point();
  Point(C, C);

  // public member functions
  size_type size() const;
  const C & operator[](int) const;
  void push_back(C);
  void clear();
  void output(oxstream &, SetType) const;
};

Description

Point public construct/copy/destruct

  1. Point();
    the default constructor stores no coordinate
  2. Point(C x, C y);
    a constructor storing x and y coordinates of a point

Point public member functions

  1. size_type size() const;
    The number of values stored.

    Error bars in the x and y direction will be stored as additional coordinates, such that the size of a Point with error bars in both directions will be 4 and with error bars in only x or y direction will be 3.

  2. const C & operator[](int i) const;
    returns the i -th coordinate.

    The mapping from coordinate number to meaning is specified by the values of the enum SetType but not stored in each point. For eaxmple a SetType of xdxy means that

    • index 0 is the x-coordinate

    • index 1 is the error on the x-coordinate

    • index 2 is the y-coordinate

  3. void push_back(C data);
    adds another value to the point.
  4. void clear();
    clears the contents, erasing all values
  5. void output(oxstream & out, SetType type) const;

    outputs the Point in XML format, where the mapping to tags is specified by the SetType. E.g. a SetType of xdxy means that

    • the first value will be printed as contents of an <x> tag

    • the second value will be printed as contents of a <dx> tag

    • the third value will be printed as contents of a <y> tag

Copyright © 1994, 2002-2005 Matthias Troyer, Synge Todo

PrevUpHomeNext