SplineWeb Class Reference

#include <spline.h>

Inheritance diagram for SplineWeb:

AnchorEnabled List of all members.

Public Member Functions

void arm ()
 arm all vectors in the web. If already armed, this will disarm() first..
SplinecreateAlongX (const double y, string, Anchor *a=0, Spline *mother=0)
SplinecreateAlongY (const double x, string, Anchor *a=0, Spline *mother=0)
void disarm ()
 disarm the web, if it armed
void dumpAlongX (const double y, string)
void dumpAlongY (const double x, string)
void fitToSingleAlongX (const double y, const pair< double, double > c)
void fitToSingleAlongY (const double x, const pair< double, double > c)
pair< double, double > maximum ()
 find the coordinates of the maximum of the web
const SplineWeboperator *= (const double x)
 Scalar multiply all ydat[] by const double x.
void set (const double x, const double y, const double z)
void shrinkToFit ()
 resize to fit igrid and jgrid, in general, make it smaller to save memory
 SplineWeb (string n="unknown", Anchor *a=0, const int x=3, const int y=3)
double x (int i)
 return i-th x value, *ordered*, not in order of setting
int xSize ()
double y (int i)
 return i-th y value, *ordered*, not in order of setting
int ySize ()
 ~SplineWeb ()

Public Attributes

int igrid
int jgrid
string name
 for internal maximum use
map< double, unsigned int > xgrid
map< double, unsigned int > ygrid

Private Member Functions

pair< double, double > maximum_internal (double a, double b)

Private Attributes

CleanVector< Spline * > X
CleanVector< Spline * > Y

Detailed Description

Very convenient class for handling the common problem of having a 2-D grid of data points which you would like to slice through and print out to some file.

In cosmos and cmbcalc wildly used to store and print transfer functions.

Creating a SplineWeb is particularily easy, you just have to provide the size of the grid in x and y directions.

  SplineWeb myWeb(10,20);
Now you can set data points by
  myWeb.set(3,5,1.234);
This will create 10 Splines pointing in Y-Direction and 20 Splines pointing in X-Direction.

Of course, you then are allowed to set 10 data points in Y-direction and 20 Datapoints in X-direction. As the splines are the limiting factor.

For convenience, you just tell the set() routine the real world number, not the index of the spline.

Make sure that these numbers are always the same for each row and collumn:

In other words, for our example, make sure that you do only give 10 different X-Values and only 20 different Y-values.

But as you usually will be filling the grid by a nested loop, no problem here in practice.

Definition at line 626 of file spline.h.


Constructor & Destructor Documentation

SplineWeb::SplineWeb string  n = "unknown",
Anchor a = 0,
const int  x = 3,
const int  y = 3
 

Definition at line 1932 of file mathobject/spline.cc.

References Spline::generateFamily(), X, and Y.

SplineWeb::~SplineWeb  ) 
 

Definition at line 1938 of file mathobject/spline.cc.


Member Function Documentation

void SplineWeb::arm  ) 
 

arm all vectors in the web. If already armed, this will disarm() first..

Definition at line 1990 of file mathobject/spline.cc.

References Spline::armVector(), disarm(), X, and Y.

Spline * SplineWeb::createAlongX const double  y,
string  nombre,
Anchor a = 0,
Spline mother = 0
 

Create a spline that hast const y-position y and the direction x return pointer to this new spline. It is your responsibility to delete the spline, if you do not use it anymore... (However, specifyig an anchor will make this easier for you) If mother is null the new spline will own its data, if not, mother (or if itself has a mother then this of course) will be the mother to this spline (i.e. hold the x-data)

Definition at line 2044 of file mathobject/spline.cc.

References wmap_tt_beam_ptsrc_chisq::a, Spline::armVector(), igrid, jgrid, CleanVector< T >::resize(), X, and Y.

Referenced by Cosmos::createPower(), CmbCalc::dumpTransfer(), and FlatSkyLensing::epsilongen_().

Spline * SplineWeb::createAlongY const double  x,
string  nombre,
Anchor a = 0,
Spline mother = 0
 

Create a spline that hast const x-position x and the direction y return pointer to this new spline. It is your responsibility to delete the spline, if you do not use it anymore... If mother is null the new spline will own its data, if not, mother (or if itself has a mother then this of course) will be the mother to this spline (i.e. hold the x-data)

Definition at line 2063 of file mathobject/spline.cc.

References wmap_tt_beam_ptsrc_chisq::a, Spline::armVector(), igrid, jgrid, CleanVector< T >::resize(), X, and Y.

Referenced by Cosmos::createLensingPowerLimber(), maximum_internal(), ScalarIntegrator::ScalarIntegrator(), and TensorIntegrator::TensorIntegrator().

void SplineWeb::disarm  ) 
 

disarm the web, if it armed

Definition at line 1996 of file mathobject/spline.cc.

References Spline::disarmVector(), X, and Y.

Referenced by arm().

void SplineWeb::dumpAlongX const double  y,
string  file
 

Dump a spline that hast const y-position y and the direction x

Definition at line 2004 of file mathobject/spline.cc.

References Spline::armVector(), Spline::generateAndDump(), igrid, jgrid, CleanVector< T >::resize(), X, and Y.

void SplineWeb::dumpAlongY const double  x,
string  file
 

Dump a spline that hast const x-position x and the direction y

Definition at line 2021 of file mathobject/spline.cc.

References Spline::armVector(), Spline::generateAndDump(), igrid, jgrid, CleanVector< T >::resize(), X, and Y.

void SplineWeb::fitToSingleAlongX const double  y,
const pair< double, double >  c
 

Definition at line 2074 of file mathobject/spline.cc.

References Spline::arm(), Spline::armVector(), Spline::disarmVector(), Spline::dump(), Spline::fitNeeds(), Spline::fitToSingle(), Spline::generateSpline(), igrid, jgrid, CleanVector< T >::resize(), X, and Y.

void SplineWeb::fitToSingleAlongY const double  x,
const pair< double, double >  c
 

Definition at line 2090 of file mathobject/spline.cc.

References Spline::arm(), Spline::armVector(), Spline::disarmVector(), Spline::fitNeeds(), Spline::generateSpline(), igrid, jgrid, CleanVector< T >::resize(), X, and Y.

pair< double, double > SplineWeb::maximum  ) 
 

find the coordinates of the maximum of the web

Definition at line 2153 of file mathobject/spline.cc.

References maximum_internal(), and Y.

pair< double, double > SplineWeb::maximum_internal double  a,
double  b
[private]
 

This gets the maximum of the spline web.

Definition at line 2130 of file mathobject/spline.cc.

References Spline::arm(), createAlongY(), x(), xgrid, and y().

Referenced by maximum().

const SplineWeb& SplineWeb::operator *= const double  x  )  [inline]
 

Scalar multiply all ydat[] by const double x.

Definition at line 645 of file spline.h.

References X, and Y.

void SplineWeb::set const double  x,
const double  y,
const double  z
 

Definition at line 1947 of file mathobject/spline.cc.

References igrid, xgrid, and ygrid.

Referenced by Cosmos::fillPower(), Cosmos::fillPsiWeb(), and CmbCalc::oneK().

void SplineWeb::shrinkToFit  ) 
 

resize to fit igrid and jgrid, in general, make it smaller to save memory

Definition at line 1984 of file mathobject/spline.cc.

References igrid, jgrid, CleanVector< T >::resize(), X, and Y.

Referenced by CmbCalc::prepareScalarCl().

double SplineWeb::x int  i  ) 
 

return i-th x value, *ordered*, not in order of setting

Expensive walk-through the xgrid map. It just counts from 1...i and iterates through xgrid until it finds it.

Definition at line 2106 of file mathobject/spline.cc.

References xgrid.

Referenced by PlotWidget::autoScale(), maximum_internal(), and PlotWidget::startDrawing().

int SplineWeb::xSize  )  [inline]
 

Definition at line 665 of file spline.h.

References igrid.

double SplineWeb::y int  i  ) 
 

return i-th y value, *ordered*, not in order of setting

Definition at line 2116 of file mathobject/spline.cc.

References ygrid.

Referenced by PlotWidget::autoScale(), maximum_internal(), and PlotWidget::startDrawing().

int SplineWeb::ySize  )  [inline]
 

Definition at line 666 of file spline.h.

References jgrid.


Member Data Documentation

int SplineWeb::igrid
 

Definition at line 636 of file spline.h.

Referenced by PlotWidget::autoScale(), createAlongX(), createAlongY(), dumpAlongX(), dumpAlongY(), fitToSingleAlongX(), fitToSingleAlongY(), set(), shrinkToFit(), PlotWidget::startDrawing(), and xSize().

int SplineWeb::jgrid
 

Definition at line 636 of file spline.h.

Referenced by PlotWidget::autoScale(), createAlongX(), createAlongY(), dumpAlongX(), dumpAlongY(), fitToSingleAlongX(), fitToSingleAlongY(), shrinkToFit(), PlotWidget::startDrawing(), and ySize().

string SplineWeb::name
 

for internal maximum use

Definition at line 634 of file spline.h.

CleanVector<Spline*> SplineWeb::X [private]
 

Definition at line 627 of file spline.h.

Referenced by arm(), createAlongX(), createAlongY(), disarm(), dumpAlongX(), dumpAlongY(), fitToSingleAlongX(), fitToSingleAlongY(), operator *=(), shrinkToFit(), and SplineWeb().

map<double,unsigned int> SplineWeb::xgrid
 

Definition at line 635 of file spline.h.

Referenced by maximum_internal(), set(), and x().

CleanVector<Spline*> SplineWeb::Y [private]
 

Definition at line 628 of file spline.h.

Referenced by arm(), createAlongX(), createAlongY(), disarm(), dumpAlongX(), dumpAlongY(), fitToSingleAlongX(), fitToSingleAlongY(), maximum(), operator *=(), shrinkToFit(), and SplineWeb().

map<double,unsigned int> SplineWeb::ygrid
 

Definition at line 635 of file spline.h.

Referenced by set(), and y().


The documentation for this class was generated from the following files:
Generated on Mon May 5 17:48:36 2008 for cmbeasy by  doxygen 1.4.6