Function to compare two LALUnit
structures.
Prototypes | |
int | XLALUnitIsDimensionless (const LALUnit *unit) |
Return 1 if a unit is dimensionless, 0 otherwise. More... | |
REAL8 | XLALUnitPrefactor (const LALUnit *unit) |
Return the unit's prefactor. More... | |
REAL8 | XLALUnitRatio (const LALUnit *unit1, const LALUnit *unit2) |
Return the ratio unit1 / unit2. More... | |
int | XLALUnitCompare (const LALUnit *unit1, const LALUnit *unit2) |
Returns 0 if the the normal form of the two unit structures are the same or > 0 if they are different. More... | |
char * | XLALUnitAsString (char *string, UINT4 length, const LALUnit *input) |
Returns the pointer to the input string , which is populated with the unit string if successful. More... | |
char * | XLALUnitToString (const LALUnit *input) |
Allocates and returns a new string, which is populated with the unit string. More... | |
LALUnit * | XLALParseUnitString (LALUnit *output, const char *string) |
Returns the pointer output upon return or a pointer to newly allocated memory if output was NULL ; on failure, XLALParseUnitString() returns NULL and sets xlalErrno to one of the following values: XLAL_ENOMEM if the routine was unable to allocate memory for the output or XLAL_EFAILED if the routine was unable to parse the unit string. More... | |
int | XLALUnitNormalize (LALUnit *unit) |
Returns 0 upon success or XLAL_FAILURE if the input pointer is NULL , in which case xlalErrno is set to XLAL_EFAULT. More... | |
LALUnit * | XLALUnitMultiply (LALUnit *output, const LALUnit *unit1, const LALUnit *unit2) |
This function multiplies together the LALUnit structures *(input->unitOne) and *(input->unitTwo) , thus allowing a module to eg, multiply two REAL8TimeSeries and give the resulting REAL8TimeSeries the correct units. More... | |
LALUnit * | XLALUnitDivide (LALUnit *output, const LALUnit *unit1, const LALUnit *unit2) |
UNDOCUMENTED. More... | |
LALUnit * | XLALUnitRaiseRAT4 (LALUnit *output, const LALUnit *input, const RAT4 *power) |
Raises a LALUnit structure to a rational power given by the RAT4 structure power . More... | |
LALUnit * | XLALUnitRaiseINT2 (LALUnit *output, const LALUnit *input, INT2 power) |
Raises a LALUnit structure to an integer power power . More... | |
LALUnit * | XLALUnitSquare (LALUnit *output, const LALUnit *input) |
Produces the square of a LALUnit structure. More... | |
LALUnit * | XLALUnitSqrt (LALUnit *output, const LALUnit *input) |
Produces the square-root of a LALUnit structure. More... | |
LALUnit * | XLALUnitInvert (LALUnit *output, const LALUnit *input) |
UNDOCUMENTED. More... | |
Data Structures | |
struct | RAT4 |
A four-byte rational number, used as a parameter structure for XLALUnitRaiseRAT4(). More... | |
Enumerations | |
enum | enumLALUnitNameSize { LALUnitNameSize = sizeof("strain") } |
enum | enumLALUnitTextSize { LALUnitTextSize } |
int XLALUnitIsDimensionless | ( | const LALUnit * | unit | ) |
Return 1 if a unit is dimensionless, 0 otherwise.
Definition at line 36 of file UnitCompare.c.
Return the unit's prefactor.
Definition at line 51 of file UnitCompare.c.
Return the ratio unit1 / unit2.
Definition at line 62 of file UnitCompare.c.
Returns 0 if the the normal form of the two unit structures are the same or > 0 if they are different.
It returns XLAL_FAILURE and xlalErrno is set to XLAL_EFAULT if one of the input pointers is NULL
.
Example:
Definition at line 90 of file UnitCompare.c.
Returns the pointer to the input string
, which is populated with the unit string if successful.
If there is a failure, XLALUnitAsString() returns a NULL
pointer and xlalErrno
is set to one of the following values: XLAL_EFAULT
if one of the input pointers is NULL
or XLAL_EBADLEN
if the length of the string is insufficent for the unit string.
Definition at line 276 of file UnitDefs.c.
char * XLALUnitToString | ( | const LALUnit * | input | ) |
Allocates and returns a new string, which is populated with the unit string.
If there is a failure, returns a NULL
pointer and xlalErrno
is set to one of the error values of XLALUnitAsString
or XLALMalloc
. Caller is responsible for freeing return value with XLALFree
.
Definition at line 332 of file UnitDefs.c.
Returns the pointer output
upon return or a pointer to newly allocated memory if output
was NULL
; on failure, XLALParseUnitString()
returns NULL
and sets xlalErrno to one of the following values: XLAL_ENOMEM if the routine was unable to allocate memory for the output or XLAL_EFAILED if the routine was unable to parse the unit string.
Definition at line 354 of file UnitDefs.c.
int XLALUnitNormalize | ( | LALUnit * | unit | ) |
Returns 0 upon success or XLAL_FAILURE if the input pointer is NULL
, in which case xlalErrno is set to XLAL_EFAULT.
Definition at line 72 of file UnitNormalize.c.
This function multiplies together the LALUnit
structures *(input->unitOne)
and *(input->unitTwo)
, thus allowing a module to eg, multiply two REAL8TimeSeries
and give the resulting REAL8TimeSeries
the correct units.
Definition at line 64 of file UnitMultiply.c.
UNDOCUMENTED.
Definition at line 108 of file UnitMultiply.c.
Raises a LALUnit
structure to a rational power given by the RAT4
structure power
.
Definition at line 56 of file UnitRaise.c.
Raises a LALUnit
structure to an integer power power
.
Definition at line 106 of file UnitRaise.c.
Produces the square of a LALUnit
structure.
Definition at line 120 of file UnitRaise.c.
Produces the square-root of a LALUnit
structure.
Definition at line 133 of file UnitRaise.c.
UNDOCUMENTED.
Definition at line 144 of file UnitRaise.c.
enum enumLALUnitNameSize |
enum enumLALUnitTextSize |
|
extern |
To convert a units structure to a string repesentation, we need to define the names of the basic units.
Definition at line 135 of file UnitDefs.c.
|
extern |
dimensionless units
Definition at line 156 of file UnitDefs.c.
|
extern |
meter [m]
Definition at line 160 of file UnitDefs.c.
|
extern |
kilogram [kg]
Definition at line 161 of file UnitDefs.c.
|
extern |
second [s]
Definition at line 162 of file UnitDefs.c.
|
extern |
Ampere [A].
Definition at line 163 of file UnitDefs.c.
|
extern |
Kelvin [K].
Definition at line 164 of file UnitDefs.c.
|
extern |
Strain [1].
Definition at line 165 of file UnitDefs.c.
|
extern |
ADC count [count].
Definition at line 166 of file UnitDefs.c.
|
extern |
Hertz [Hz].
Definition at line 171 of file UnitDefs.c.
|
extern |
Newton [N].
Definition at line 172 of file UnitDefs.c.
|
extern |
Joule [J].
Definition at line 174 of file UnitDefs.c.
|
extern |
Watt [W ].
Definition at line 175 of file UnitDefs.c.
|
extern |
Pascal [Pa].
Definition at line 173 of file UnitDefs.c.
|
extern |
Coulomb [C].
Definition at line 180 of file UnitDefs.c.
|
extern |
Volt [V].
Definition at line 181 of file UnitDefs.c.
|
extern |
Ohm [ \(\Omega\)].
Definition at line 182 of file UnitDefs.c.
|
extern |
Farad [F].
Definition at line 183 of file UnitDefs.c.
|
extern |
Weber [Wb].
Definition at line 184 of file UnitDefs.c.
|
extern |
Tesla [T].
Definition at line 186 of file UnitDefs.c.
|
extern |
Henry [H].
Definition at line 185 of file UnitDefs.c.
|
extern |
Yotta [1e24].
Definition at line 191 of file UnitDefs.c.
|
extern |
Zetta [1e21].
Definition at line 192 of file UnitDefs.c.
|
extern |
Exa [1e18].
Definition at line 193 of file UnitDefs.c.
|
extern |
Peta [1e15].
Definition at line 194 of file UnitDefs.c.
|
extern |
Tera [1e12].
Definition at line 195 of file UnitDefs.c.
|
extern |
Giga [1e9].
Definition at line 196 of file UnitDefs.c.
|
extern |
Mega [1e6].
Definition at line 197 of file UnitDefs.c.
|
extern |
Kilo [1e3].
Definition at line 198 of file UnitDefs.c.
|
extern |
Hecto [1e2].
Definition at line 199 of file UnitDefs.c.
|
extern |
Deka [1e1].
Definition at line 200 of file UnitDefs.c.
|
extern |
Deci [1e-1].
Definition at line 201 of file UnitDefs.c.
|
extern |
Centi [1e-2].
Definition at line 202 of file UnitDefs.c.
|
extern |
Milli [1e-3].
Definition at line 203 of file UnitDefs.c.
|
extern |
Micro [1e-6].
Definition at line 204 of file UnitDefs.c.
|
extern |
Nano [1e-9].
Definition at line 205 of file UnitDefs.c.
|
extern |
Pico [1e-12].
Definition at line 206 of file UnitDefs.c.
|
extern |
Femto [1e-15].
Definition at line 207 of file UnitDefs.c.
|
extern |
Atto [1e-18].
Definition at line 208 of file UnitDefs.c.
|
extern |
Zepto [1e-21].
Definition at line 209 of file UnitDefs.c.
|
extern |
Yocto [1e-24].
Definition at line 210 of file UnitDefs.c.
|
extern |
Gram [1e-3].
Definition at line 215 of file UnitDefs.c.
|
extern |
AttoStrain [1e-18].
Definition at line 216 of file UnitDefs.c.
|
extern |
PicoFarad [1e-12 F].
Definition at line 217 of file UnitDefs.c.