NASA - Jet Propulsion Laboratory
    + View the NASA Portal
Search JPL
Jet Propulsion Laboratory Home Earth Solar System Stars & Galaxies Technology
Introduction Background Software Links

cxxutils.h File Reference

#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include "message_error.h"
#include "lsconstants.h"

Go to the source code of this file.

Functions

template<typename F>
bool approx (F a, F b, F epsilon=1e-5)
template<typename F>
bool abs_approx (F a, F b, F epsilon=1e-5)
template<typename I, typename F>
ifloor (F arg)
template<typename I, typename F>
nearest (F arg)
template<typename T>
weak_modulo (T v1, T v2)
double fmodulo (double v1, double v2)
template<typename I>
imodulo (I v1, I v2)
template<typename T>
sign (const T &signvalue)
template<typename I>
unsigned int isqrt (I arg)
template<typename I>
unsigned int ilog2 (I arg)
double safe_atan2 (double y, double x)
template<typename T>
int interpol_left (const T *begin, int len, const T &val)
template<typename T>
int interpol_nearest (const T *begin, int len, const T &val)
bool file_present (const std::string &filename)
void remove_file (const std::string &filename)
void planck_assert (bool testval, const std::string &msg)
void planck_assert (bool testval, const char *msg)
void assert_present (const std::string &filename)
void assert_not_present (const std::string &filename)
std::string trim (const std::string &orig)
template<typename T>
std::string dataToString (const T &x)
std::string intToString (int x, int width)
template<typename T>
void stringToData (const std::string &x, T &value)
template<typename T>
stringToData (const std::string &x)
void parse_file (const std::string &filename, std::map< std::string, std::string > &dict)
bool equal_nocase (const std::string &a, const std::string &b)
std::string tolower (const std::string &input)
void announce_progress (int now, int total)
void announce_progress (double now, double last, double total)
void end_announce_progress ()
void announce (const std::string &name)
void module_startup (const std::string &name, int argc, const char **argv, int argc_expected, const std::string &argv_expected)
unsigned int healpix_repcount (int npix)


Detailed Description

Various convenience functions used by the Planck LevelS package.

Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Max-Planck-Society

Author:
Martin Reinecke

Reinhard Hell

Definition in file cxxutils.h.


Function Documentation

void announce_progress ( int  now,
int  total 
)

Indicates progress by printing the percentage of now/total.

A message is only printed if it has changed since now-1/total. The output is followed by a carriage return, not a newline.

Definition at line 195 of file cxxutils.cc.

void announce_progress ( double  now,
double  last,
double  total 
)

Indicates progress by printing the percentage of now/total.

A message is only printed if it has changed since last/total. The output is followed by a carriage return, not a newline.

Definition at line 196 of file cxxutils.cc.

void end_announce_progress (  ) 

This function should be called after a sequence of announce_progress() calls has finished.

Definition at line 197 of file cxxutils.cc.

void announce ( const std::string &  name  ) 

Prints a banner containing name. Useful for displaying program names.

void module_startup ( const std::string &  name,
int  argc,
const char **  argv,
int  argc_expected,
const std::string &  argv_expected 
)

Prints a banner containing name and checks if argc==argc_expected. If not, a usage description is given and the program is terminated.

unsigned int healpix_repcount ( int  npix  )  [inline]

Returns an appropriate FITS repetition count for a map with npix pixels.

Definition at line 262 of file cxxutils.h.


Generated on Fri Jun 18 16:12:29 2010 for LevelS C++ support library
Privacy / Copyright
FIRST GOV Contact: NASA Home Page Site Manager:
Webmaster:

CL 03-2650