gpp4  1.3.1
Functions
ccp4_unitcell.h File Reference

C library for manipulations based on cell parameters. More...

#include <math.h>

Go to the source code of this file.

Functions

double ccp4uc_frac_orth_mat (const double cell[6], const int ncode, double ro[3][3], double rf[3][3])
 
double ccp4uc_calc_rcell (const double cell[6], double rcell[6])
 
void ccp4uc_orth_to_frac (const double rf[3][3], const double xo[3], double xf[3])
 
void ccp4uc_frac_to_orth (const double ro[3][3], const double xf[3], double xo[3])
 
void ccp4uc_orthu_to_fracu (const double rf[3][3], const double uo[6], double uf[6])
 
void ccp4uc_fracu_to_orthu (const double ro[3][3], const double uf[6], double uo[6])
 
double ccp4uc_calc_cell_volume (const double cell[6])
 
int ccp4uc_cells_differ (const double cell1[6], const double cell2[6], const double tolerance)
 
int ccp4uc_is_rhombohedral (const float cell[6], const float tolerance)
 
int ccp4uc_is_hexagonal (const float cell[6], const float tolerance)
 

Detailed Description

C library for manipulations based on cell parameters.

Author
Martyn Winn

Function Documentation

double ccp4uc_calc_cell_volume ( const double  cell[6])

Calculate cell volume from cell parameters.

Parameters
cell
Returns
Cell volume.

Calculate cell volume from cell parameters.

Parameters
[in]celldirect space cell parameters
Returns
Cell volume.

Referenced by ccp4uc_calc_rcell(), and ccp4uc_cells_differ().

double ccp4uc_calc_rcell ( const double  cell[6],
double  rcell[6] 
)

From input cell, find dimensions of reciprocal cell.

Parameters
cell
rcell
Returns
Reciprocal cell volume

From input cell, find dimensions of reciprocal cell.

Parameters
[in]celldirect space unit cell parameters.
[out]rcellreciprocal space unit cell parameters.
Returns
Reciprocal cell volume

References ccp4uc_calc_cell_volume().

int ccp4uc_cells_differ ( const double  cell1[6],
const double  cell2[6],
const double  tolerance 
)

Check cells agree within tolerance.

Parameters
cell1First cell.
cell2Second cell.
toleranceA tolerance for agreement.
Returns
1 if cells differ by more than tolerance, 0 otherwise.

Check cells agree within tolerance.

Parameters
[in]cell1Cell parameters of first cell.
[in]cell2Cell parameters of second cell.
[in]toleranceA tolerance for agreement.
Returns
1 if cells differ by more than tolerance, 0 otherwise.

References ccp4_liberr_verbosity(), and ccp4uc_calc_cell_volume().

Referenced by MtzGetUserCellTolerance().

double ccp4uc_frac_orth_mat ( const double  cell[6],
const int  ncode,
double  ro[3][3],
double  rf[3][3] 
)

From input cell and orthogonalisation code, find orthogonalisation and fractionalisation matrices.

Parameters
cell
ncode
ro
rf
Returns
Cell volume

From input cell and orthogonalisation code, find orthogonalisation and fractionalisation matrices.

Parameters
[in]cellunit cell parameters
[in]ncodeorthogonalisation code:
  • ncode = 1 - xo along a zo along c*
  • ncode = 2 - xo along b zo along a*
  • ncode = 3 - xo along c zo along b*
  • ncode = 4 - trigonal only - xo along a+b yo alon a-b zo along c*
  • ncode = 5 - xo along a* zo along c
  • ncode = 6 - xo along a yo along b*
[out]roorthogonalization matrix
[out]rffractionalisation matrix
Returns
Cell volume

References invert3matrix().

void ccp4uc_frac_to_orth ( const double  ro[3][3],
const double  xf[3],
double  xo[3] 
)

Convert fractional to orthogonal coordinates.

Parameters
ro
xf
xo
Returns
void

Convert fractional to orthogonal coordinates.

Parameters
[in]roorthogonalization matrix
[in]xffractional coordinates
[out]xoorthogonal coordinates
Returns
void
void ccp4uc_fracu_to_orthu ( const double  ro[3][3],
const double  uf[6],
double  uo[6] 
)

Convert fractional to orthogonal u matrix.

Parameters
ro
uf
uo
Returns
void

Convert fractional to orthogonal u matrix.

Parameters
[in]roorthogonalization matrix
[in]uffractional u matrix
[out]uoorthogonal u matrix
Returns
void

References ccp4_3matmul().

int ccp4uc_is_hexagonal ( const float  cell[6],
const float  tolerance 
)

Check if cell parameters conform to a hexagonal setting.

Parameters
cellCell parameters. Angles are assumed to be in degrees.
toleranceA tolerance for agreement.
Returns
1 if cell parameters conform, 0 otherwise.

Check if cell parameters conform to a hexagonal setting.

Parameters
[in]cellCell parameters. Angles are assumed to be in degrees.
[in]toleranceA tolerance for agreement.
Returns
1 if cell parameters conform, 0 otherwise.

Referenced by ccp4spg_check_symm_cell().

int ccp4uc_is_rhombohedral ( const float  cell[6],
const float  tolerance 
)

Check if cell parameters conform to a rhombohedral setting.

Parameters
cellCell parameters. Angles are assumed to be in degrees.
toleranceA tolerance for agreement.
Returns
1 if cell parameters conform, 0 otherwise.

Check if cell parameters conform to a rhombohedral setting.

Parameters
[in]cellCell parameters. Angles are assumed to be in degrees.
[in]toleranceA tolerance for agreement.
Returns
1 if cell parameters conform, 0 otherwise.

Referenced by ccp4spg_check_symm_cell().

void ccp4uc_orth_to_frac ( const double  rf[3][3],
const double  xo[3],
double  xf[3] 
)

Convert orthogonal to fractional coordinates. Translation only if deliberate origin shift - does this ever happen? Leave it to the application.

Parameters
rf
xo
xf
Returns
void

Convert orthogonal to fractional coordinates. Translation only if deliberate origin shift - does this ever happen? Leave it to the application.

Parameters
[in]rffractionalisation matrix
[in]xoorthogonal coordinates
[out]xffractional coordinates
Returns
void
void ccp4uc_orthu_to_fracu ( const double  rf[3][3],
const double  uo[6],
double  uf[6] 
)

Convert orthogonal to fractional u matrix.

Parameters
rf
uo
uf
Returns
void

Convert orthogonal to fractional u matrix.

Parameters
[in]rffractionalisation matrix
[in]uoorthogonal u matrix
[out]uffractional u matrix
Returns
void

References ccp4_3matmul().