cryph utilities [subset]  2.0
Subset of the full cryph package of mathematical utilities for points, vectors, and matrices
Functions
Inline.h File Reference
#include <iostream>
#include <math.h>
#include <stdlib.h>
#include <string>

Go to the source code of this file.

Functions

std::string cryph::closeStr (char openStr)
 
double cryph::degreesToRadians (double angleInDegrees)
 
bool cryph::equalScalars (double s1, double s2, double tol)
 
double cryph::radiansToDegrees (double angleInRadians)
 
double cryph::random0To1_next ()
 
void cryph::random0To1_seed (long seedVal)
 
int cryph::roundR2I (double val)
 
void cryph::skipNonblankChars (std::istream &is, int nNonBlankChars)
 
double cryph::square (double s)
 
template<typename T >
cryph::maximum (T s1, T s2)
 
template<typename T >
cryph::minimum (T s1, T s2)
 
template<typename T >
void cryph::swap2 (T &t1, T &t2)
 

Detailed Description

Definitions of common low-level and typically inline functions This is OPEN SOURCE software developed by James R. Miller (jrmil.nosp@m.ler@.nosp@m.ku.ed.nosp@m.u) Original version: ca. 1996. See README_*.txt for more information.

Function Documentation

std::string cryph::closeStr ( char  openStr)
inline

Return the closing bracketing character for the given opening one For example closeStr('(') returns ')'

Parameters
openStrthe opening bracketing character
Returns
the corresponding closing bracketing character (as an std::string)
double cryph::degreesToRadians ( double  angleInDegrees)
inline

Convert the given angle in degrees to radians and return it

Parameters
angleInDegreesthe given angle to be converted to radians
Returns
the angle converted to radians
bool cryph::equalScalars ( double  s1,
double  s2,
double  tol 
)
inline

Determine whether the two given values are equal within the given tolerance

Parameters
s1the first number to be compared
s2the second number to be compared
tolthe tolerance to be used to decide if the values are the same
Returns
true if and only if s1 and s2 are equal within the given tolerance
template<typename T >
T cryph::maximum ( s1,
s2 
)
inline

Return the maximum of the two given quantities

Parameters
s1the first quantity to be compared
s2the second quantity to be compared
Returns
the maximum of the two quantities
template<typename T >
T cryph::minimum ( s1,
s2 
)
inline

Return the minimum of the two given quantities

Parameters
s1the first quantity to be compared
s2the second quantity to be compared
Returns
the minimum of the two quantities
double cryph::radiansToDegrees ( double  angleInRadians)
inline

Convert the given angle in radians to degrees and return it

Parameters
angleInRadiansthe given angle to be converted to degrees
Returns
the angle converted to degrees
double cryph::random0To1_next ( )
inline

Return the next random number in the range 0 <= r < 1

Returns
the next random number
void cryph::random0To1_seed ( long  seedVal)
inline

Set the random number seed

Parameters
seedValthe value to be used as the seed
int cryph::roundR2I ( double  val)
inline

Return the rounded integer for the given floating point value

Parameters
valthe floating point number to be rounded
Returns
the rounded integral value
void cryph::skipNonblankChars ( std::istream &  is,
int  nNonBlankChars 
)
inline

Skip over the given number of non-blank characters

Parameters
isthe input stream on which we wish to skip non-blank characters
nNonBlankCharsthe number of non-blank characters to be skipped
double cryph::square ( double  s)
inline

Return the square of the given number

Parameters
sthe number to be squared
Returns
the square of the given number
template<typename T >
void cryph::swap2 ( T &  t1,
T &  t2 
)
inline

Swap the two given quantities

Parameters
s1the first quantity to be swapped
s2the second quantity to be swapped