gpp4  1.3.1
Functions
csymlib.h File Reference

C-level library for symmetry information. More...

#include "ccp4_spg.h"

Go to the source code of this file.

Functions

CCP4SPGccp4spg_load_by_standard_num (const int numspg)
 
CCP4SPGccp4spg_load_by_ccp4_num (const int ccp4numspg)
 
CCP4SPGccp4spg_load_by_spgname (const char *spgname)
 
CCP4SPGccp4spg_load_by_ccp4_spgname (const char *ccp4spgname)
 
CCP4SPGccp4_spgrp_reverse_lookup (const int nsym1, const ccp4_symop *op1)
 
CCP4SPGccp4spg_load_spacegroup (const int numspg, const int ccp4numspg, const char *spgname, const char *ccp4spgname, const int nsym1, const ccp4_symop *op1)
 
void ccp4spg_mem_tidy (void)
 
int symfr_driver (const char *line, float rot[][4][4])
 
void ccp4spg_free (CCP4SPG **sp)
 
void ccp4spg_register_by_ccp4_num (int numspg)
 
void ccp4spg_register_by_symops (int nops, float rsm[][4][4])
 
int ccp4_spg_get_centering (const char *symbol_Hall, float cent_ops[4][3])
 
int ccp4spg_load_laue (CCP4SPG *spacegroup, const int nlaue)
 
int ASU_1b (const int h, const int k, const int l)
 
int ASU_2_m (const int h, const int k, const int l)
 
int ASU_mmm (const int h, const int k, const int l)
 
int ASU_4_m (const int h, const int k, const int l)
 
int ASU_4_mmm (const int h, const int k, const int l)
 
int ASU_3b (const int h, const int k, const int l)
 
int ASU_3bm (const int h, const int k, const int l)
 
int ASU_3bmx (const int h, const int k, const int l)
 
int ASU_6_m (const int h, const int k, const int l)
 
int ASU_6_mmm (const int h, const int k, const int l)
 
int ASU_m3b (const int h, const int k, const int l)
 
int ASU_m3bm (const int h, const int k, const int l)
 
char * ccp4spg_symbol_Hall (CCP4SPG *sp)
 
ccp4_symop ccp4_symop_invert (const ccp4_symop op1)
 
int ccp4spg_name_equal (const char *spgname1, const char *spgname2)
 
int ccp4spg_name_equal_to_lib (const char *spgname_lib, const char *spgname_match)
 
char * ccp4spg_to_shortname (char *shortname, const char *longname)
 
void ccp4spg_name_de_colon (char *name)
 
int ccp4spg_pgname_equal (const char *pgname1, const char *pgname2)
 
ccp4_symopccp4spg_norm_trans (ccp4_symop *op)
 
int ccp4_spgrp_equal (int nsym1, const ccp4_symop *op1, int nsym2, const ccp4_symop *op2)
 
int ccp4_symop_code (ccp4_symop op)
 
int ccp4_int_compare (const void *p1, const void *p2)
 
int ccp4spg_is_in_pm_asu (const CCP4SPG *sp, const int h, const int k, const int l)
 
int ccp4spg_is_in_asu (const CCP4SPG *sp, const int h, const int k, const int l)
 
int ccp4spg_put_in_asu (const CCP4SPG *sp, const int hin, const int kin, const int lin, int *hout, int *kout, int *lout)
 
void ccp4spg_generate_indices (const CCP4SPG *sp, const int isym, const int hin, const int kin, const int lin, int *hout, int *kout, int *lout)
 
float ccp4spg_phase_shift (const int hin, const int kin, const int lin, const float phasin, const float trans[3], const int isign)
 
int ccp4spg_do_chb (const float chb[3][3])
 
void ccp4spg_set_centric_zones (CCP4SPG *sp)
 
int ccp4spg_is_centric (const CCP4SPG *sp, const int h, const int k, const int l)
 
int ccp4spg_check_centric_zone (const int nzone, const int h, const int k, const int l)
 
float ccp4spg_centric_phase (const CCP4SPG *sp, const int h, const int k, const int l)
 
void ccp4spg_print_centric_zones (const CCP4SPG *sp)
 
char * ccp4spg_describe_centric_zone (const int nzone, char *centric_zone)
 
void ccp4spg_set_epsilon_zones (CCP4SPG *sp)
 
int ccp4spg_get_multiplicity (const CCP4SPG *sp, const int h, const int k, const int l)
 
int ccp4spg_check_epsilon_zone (const int nzone, const int h, const int k, const int l)
 
void ccp4spg_print_epsilon_zones (const CCP4SPG *sp)
 
char * ccp4spg_describe_epsilon_zone (const int nzone, char *epsilon_zone)
 
int ccp4spg_is_sysabs (const CCP4SPG *sp, const int h, const int k, const int l)
 
int ccp4spg_generate_origins (const char *namspg, const int nsym, const float rsym[][4][4], float origins[][3], int *polarx, int *polary, int *polarz, const int iprint)
 
void ccp4spg_print_recip_spgrp (const CCP4SPG *sp)
 
void ccp4spg_print_recip_ops (const CCP4SPG *sp)
 
int range_to_limits (const char *range, float limits[2])
 
void set_fft_grid (CCP4SPG *sp, const int nxmin, const int nymin, const int nzmin, const float sample, int *nx, int *ny, int *nz)
 
int all_factors_le_19 (const int n)
 
int get_grid_sample (const int minsmp, const int nmul, const float sample)
 
int ccp4spg_check_symm_cell (int nsym, float rsym[][4][4], float cell[6])
 

Detailed Description

C-level library for symmetry information.

Functions defining the C-level API for accessing spacegroup properties. The primary spacegroup information comes from the data file syminfo.lib

Author
Martyn Winn

Function Documentation

int all_factors_le_19 ( const int  n)

Checks whether all factors of a number n are less than or equal to 19.

Parameters
nNumber to be tested.
Returns
1 on success, O on failure.

Referenced by get_grid_sample().

int ASU_1b ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 1bar.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_laue(), and ccp4spg_load_spacegroup().

int ASU_2_m ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 2/m.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_3b ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 3bar.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_3bm ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 3bar1m.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_3bmx ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 3barm.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_4_m ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 4/m.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_4_mmm ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 4/mmm.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_6_m ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 6/m.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_6_mmm ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group 6/mmm.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_m3b ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group m3bar.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_m3bm ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group m3barm.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ASU_mmm ( const int  h,
const int  k,
const int  l 
)

Test if reflection is in asu of Laue group mmm.

Returns
1 if in asu else 0

Referenced by ccp4spg_load_spacegroup().

int ccp4_int_compare ( const void *  p1,
const void *  p2 
)

Comparison of symmetry operators encoded as integers. In ccp4_spgrp_equal, this is passed to the stdlib qsort.

Parameters
p1pointer to first integer
p2pointer to second integer
Returns
difference between integers

Referenced by ccp4_spgrp_equal().

int ccp4_spg_get_centering ( const char *  symbol_Hall,
float  cent_ops[4][3] 
)

Derive centering operators from Hall symbol (deprecated). Centering operators are now read from syminfo.lib

Parameters
symbol_HallHall symbol for spacegroup
cent_opscentering operators
Returns
number of centering operators (0 if none found)
int ccp4_spgrp_equal ( int  nsym1,
const ccp4_symop op1,
int  nsym2,
const ccp4_symop op2 
)

Compare two symmetry operator lists. Kevin's code. The lists are coded as ints, which are then sorted and compared. Note that no changes are made to the input operators, so that operators differing by an integral number of unit cell translations are considered unequal. If this is not what you want, normalise the operators with ccp4spg_norm_trans first.

Parameters
nsym1number of symmetry operators in first list
op1first list of symmetry operators
nsym2number of symmetry operators in second list
op2second list of symmetry operators
Returns
1 if they are equal else 0.

References ccp4_int_compare(), ccp4_symop_code(), and ccp4_utils_malloc().

Referenced by ccp4spg_load_spacegroup().

CCP4SPG* ccp4_spgrp_reverse_lookup ( const int  nsym1,
const ccp4_symop op1 
)

Look up spacegroup by symmetry operators and load properties.

Parameters
nsym1number of operators (including non-primitive)
op1pointer to array of operators
Returns
pointer to spacegroup

References ccp4spg_load_spacegroup().

Referenced by ccp4spg_check_symm_cell(), ccp4spg_register_by_symops(), and FORTRAN_SUBR().

int ccp4_symop_code ( ccp4_symop  op)

Make an integer coding of a symmetry operator. The coding takes 30 bits: 18 for the rotation and 12 for the translation.

Parameters
opsymmetry operator
Returns
int code.

References ccp4_symop_::rot, and ccp4_symop_::trn.

Referenced by ccp4_spgrp_equal(), and FORTRAN_SUBR().

ccp4_symop ccp4_symop_invert ( const ccp4_symop  op1)

inverts a symmetry operator. The input operator is converted to a 4 x 4 matrix, inverted, and converted back.

Parameters
op1input symmetry operator
Returns
inverted symmetry operator

References invert4matrix(), mat4_to_rotandtrn(), and rotandtrn_to_mat4().

Referenced by ccp4spg_load_spacegroup().

float ccp4spg_centric_phase ( const CCP4SPG sp,
const int  h,
const int  k,
const int  l 
)

Return phase of a centric reflection in the range 0.0 <= phase < 180.0. You should first check that reflection really is centric.

Parameters
sppointer to spacegroup
hreflection index
kreflection index
lreflection index
Returns
phase of a centric reflection

References ccp4_signal(), ccp4spg_check_centric_zone(), ccp4_spacegroup_::centrics, ccp4_spacegroup_::symop, and ccp4_symop_::trn.

Referenced by FORTRAN_SUBR().

int ccp4spg_check_centric_zone ( const int  nzone,
const int  h,
const int  k,
const int  l 
)

Check indices against a centric zone for a given spacegroup.

Parameters
nzoneindex of centric zone
hreflection index
kreflection index
lreflection index
Returns
0 if in zone "nzone", non-zero otherwise

Referenced by ccp4spg_centric_phase(), and ccp4spg_is_centric().

int ccp4spg_check_epsilon_zone ( const int  nzone,
const int  h,
const int  k,
const int  l 
)

Check indices against an epsilon zone for a given spacegroup.

Parameters
nzoneindex of epsilon zone (runs from 1 to 13)
hreflection index
kreflection index
lreflection index
Returns
0 if in zone "nzone", non-zero otherwise

Referenced by ccp4spg_get_multiplicity().

int ccp4spg_check_symm_cell ( int  nsym,
float  rsym[][4][4],
float  cell[6] 
)

Check for consistency between cell dimensions and spacegroup. Latter is identified from symmetry operators.

Parameters
nsymNo. of symmetry operators.
rsymSymmetry operators.
cellCell dimensions.
Returns
1 if they are consistent, 0 if there is a problem.

References ccp4_spgrp_reverse_lookup(), ccp4_utils_malloc(), ccp4uc_is_hexagonal(), ccp4uc_is_rhombohedral(), ccp4_symop_::rot, ccp4_spacegroup_::spg_num, ccp4_spacegroup_::symbol_xHM, and ccp4_symop_::trn.

Referenced by FORTRAN_SUBR().

char* ccp4spg_describe_centric_zone ( const int  nzone,
char *  centric_zone 
)

Obtain string description of centric zone.

Parameters
nzoneindex of centric zone
centric_zonestring description of centric zone
Returns
string description of centric zone

Referenced by ccp4spg_print_centric_zones().

char* ccp4spg_describe_epsilon_zone ( const int  nzone,
char *  epsilon_zone 
)

Obtain string description of epsilon zone.

Parameters
nzoneindex of epsilon zone
epsilon_zonestring description of epsilon zone
Returns
string description of epsilon zone

Referenced by ccp4spg_print_epsilon_zones().

int ccp4spg_do_chb ( const float  chb[3][3])

Check whether change of basis is necessary, i.e. whether the change of basis matrix is not the identity.

Parameters
chbchange of basis matrix
Returns
1 if change of basis is necessary, 0 otherwise

Referenced by ccp4spg_is_in_asu().

void ccp4spg_free ( CCP4SPG **  sp)

Free memory associated with spacegroup.

Parameters
sppointer to spacegroup

Referenced by ccp4spg_mem_tidy(), ccp4spg_register_by_ccp4_num(), ccp4spg_register_by_symops(), and FORTRAN_SUBR().

void ccp4spg_generate_indices ( const CCP4SPG sp,
const int  isym,
const int  hin,
const int  kin,
const int  lin,
int *  hout,
int *  kout,
int *  lout 
)

Transform reflection (hin,kin,lin) according to spacegroup "sp" and operation "isym". Resultant indices are placed in (hout,kout,lout).

Parameters
sppointer to spacegroup
isymrequired operation, see ccp4spg_put_in_asu
hininput reflection index
kininput reflection index
lininput reflection index
houtoutput reflection index
koutoutput reflection index
loutoutput reflection index
Returns
void

References ccp4_signal(), ccp4_spacegroup_::invsymop, and ccp4_symop_::rot.

Referenced by FORTRAN_SUBR().

int ccp4spg_generate_origins ( const char *  namspg,
const int  nsym,
const float  rsym[][4][4],
float  origins[][3],
int *  polarx,
int *  polary,
int *  polarz,
const int  iprint 
)

Translated from Alexei Vagin's CALC_ORIG_PS.

Parameters
namspgSpacegroup name for printing only.
nsymInput number of symmetry operators.
rsymInput symmetry operators.
originsArray containing alternative origins on output.
polarxReturn whether polar along x axis.
polaryReturn whether polar along y axis.
polarzReturn whether polar along z axis.
iprintIf true, print out list of alternative origins.
Returns
Number of alternate origins for spacegroup.

Referenced by FORTRAN_SUBR().

int ccp4spg_get_multiplicity ( const CCP4SPG sp,
const int  h,
const int  k,
const int  l 
)

Return reflection multiplicity factor for a given hkl in a given spacegroup.

Parameters
sppointer to spacegroup
hreflection index
kreflection index
lreflection index
Returns
reflection multiplicity factor

References ccp4_signal(), ccp4spg_check_epsilon_zone(), and ccp4_spacegroup_::epsilon.

Referenced by FORTRAN_SUBR().

int ccp4spg_is_centric ( const CCP4SPG sp,
const int  h,
const int  k,
const int  l 
)

Function to determine whether or not h,k,l is a centric reflection in spacegroup "sp".

Parameters
sppointer to spacegroup
hinput reflection index
kinput reflection index
linput reflection index
Returns
1 if h,k,l is centric, 0 if not centric, and -1 if there is an error.

References ccp4_signal(), ccp4spg_check_centric_zone(), and ccp4_spacegroup_::centrics.

Referenced by FORTRAN_SUBR().

int ccp4spg_is_in_asu ( const CCP4SPG sp,
const int  h,
const int  k,
const int  l 
)

Test whether reflection is in asu.

Parameters
sppointer to spacegroup
hreflection index
kreflection index
lreflection index
Returns
1 if in asu, 0 otherwise

References ccp4_spacegroup_::asufn, ccp4_signal(), ccp4spg_do_chb(), and ccp4_spacegroup_::chb.

Referenced by ccp4spg_is_in_pm_asu(), and FORTRAN_SUBR().

int ccp4spg_is_in_pm_asu ( const CCP4SPG sp,
const int  h,
const int  k,
const int  l 
)

Test whether reflection or it's Friedel mate is in asu.

Parameters
sppointer to spacegroup
hreflection index
kreflection index
lreflection index
Returns
1 if in asu, -1 if -h -k -l is in asu, 0 otherwise

References ccp4spg_is_in_asu().

Referenced by ccp4spg_put_in_asu(), and FORTRAN_FUN().

int ccp4spg_is_sysabs ( const CCP4SPG sp,
const int  h,
const int  k,
const int  l 
)

Check if reflection is a systematic absence.

Parameters
sppointer to spacegroup
hreflection index
kreflection index
lreflection index
Returns
1 if reflection is a systematic absence, 0 otherwise.

References ccp4_signal(), ccp4_spacegroup_::invsymop, ccp4_spacegroup_::nsymop, ccp4_symop_::rot, ccp4_spacegroup_::symop, and ccp4_symop_::trn.

Referenced by FORTRAN_SUBR().

CCP4SPG* ccp4spg_load_by_ccp4_num ( const int  ccp4numspg)

Look up spacegroup by CCP4 number and load properties.

Parameters
ccp4numspgCCP4 spacegroup number
Returns
pointer to spacegroup

References ccp4spg_load_spacegroup().

Referenced by ccp4spg_register_by_ccp4_num(), and FORTRAN_SUBR().

CCP4SPG* ccp4spg_load_by_ccp4_spgname ( const char *  ccp4spgname)

Look up spacegroup by name. This is for use by CCP4 programs and is more complicated than ccp4spg_load_by_spgname. For each spacegroup in syminfo.lib it checks the CCP4 spacegroup name first, and then the extended Hermann Mauguin symbol.

Parameters
ccp4spgnameSpacegroup name.
Returns
pointer to spacegroup

References ccp4spg_load_spacegroup().

Referenced by FORTRAN_SUBR().

CCP4SPG* ccp4spg_load_by_spgname ( const char *  spgname)

Look up spacegroup by the extended Hermann Mauguin symbol.

Parameters
spgnameSpacegroup name in form of extended Hermann Mauguin symbol.
Returns
pointer to spacegroup

References ccp4spg_load_spacegroup().

CCP4SPG* ccp4spg_load_by_standard_num ( const int  numspg)

Look up spacegroup in standard setting by number and load properties.

Parameters
numspgspacegroup number
Returns
pointer to spacegroup

References ccp4spg_load_spacegroup().

int ccp4spg_load_laue ( CCP4SPG spacegroup,
const int  nlaue 
)

Load Laue data into spacegroup structure.

Parameters
nlaueCCP4 code for Laue group
spacegroupPointer to CCP4 spacegroup structure
Returns
0 on success, 1 on failure to load Laue data

References ASU_1b(), ccp4_spacegroup_::asufn, ccp4_spacegroup_::laue_name, ccp4_spacegroup_::laue_sampling, and ccp4_spacegroup_::nlaue.

Referenced by ccp4spg_load_spacegroup(), FORTRAN_FUN(), and FORTRAN_SUBR().

CCP4SPG* ccp4spg_load_spacegroup ( const int  numspg,
const int  ccp4numspg,
const char *  spgname,
const char *  ccp4spgname,
const int  nsym1,
const ccp4_symop op1 
)

Look up spacegroup from SYMOP. This would not normally be called directly, but via one of the wrapping functions.

Parameters
numspgspacegroup number
ccp4numspgCCP4 spacegroup number
spgnameSpacegroup name.
ccp4spgnameSpacegroup name.
nsym1number of operators (including non-primitive)
op1pointer to array of operators
Returns
pointer to spacegroup

References ASU_1b(), ASU_2_m(), ASU_3b(), ASU_3bm(), ASU_3bmx(), ASU_4_m(), ASU_4_mmm(), ASU_6_m(), ASU_6_mmm(), ccp4_spacegroup_::asu_descr, ASU_m3b(), ASU_m3bm(), ASU_mmm(), ccp4_spacegroup_::asufn, ccp4_4matmul(), ccp4_keymatch(), ccp4_parse_delimiters(), ccp4_parse_end(), ccp4_parse_start(), ccp4_parser(), ccp4_signal(), ccp4_spgrp_equal(), ccp4_symop_invert(), ccp4_utils_malloc(), ccp4spg_load_laue(), ccp4spg_name_equal_to_lib(), ccp4spg_norm_trans(), ccp4spg_set_centric_zones(), ccp4spg_set_epsilon_zones(), ccp4_spacegroup_::chb, ccp4_spacegroup_::crystal, invert4matrix(), ccp4_spacegroup_::invsymop, CCP4PARSERARRAY::keyword, ccp4_spacegroup_::laue_name, ccp4_spacegroup_::laue_sampling, ccp4_spacegroup_::mapasu_ccp4, ccp4_spacegroup_::mapasu_ccp4_descr, ccp4_spacegroup_::mapasu_zero, ccp4_spacegroup_::mapasu_zero_descr, mat4_to_rotandtrn(), ccp4_spacegroup_::nlaue, ccp4_spacegroup_::npatt, ccp4_spacegroup_::nsymop, ccp4_spacegroup_::nsymop_prim, CCP4PARSERARRAY::ntokens, ccp4_spacegroup_::patt_name, ccp4_spacegroup_::point_group, range_to_limits(), ccp4_symop_::rot, ccp4_spacegroup_::spg_ccp4_num, ccp4_spacegroup_::spg_num, ccp4_spacegroup_::symbol_Hall, ccp4_spacegroup_::symbol_old, ccp4_spacegroup_::symbol_xHM, ccp4_spacegroup_::symop, symop_to_mat4(), CCP4PARSERARRAY::token, and ccp4_symop_::trn.

Referenced by ccp4_spgrp_reverse_lookup(), ccp4spg_load_by_ccp4_num(), ccp4spg_load_by_ccp4_spgname(), ccp4spg_load_by_spgname(), and ccp4spg_load_by_standard_num().

void ccp4spg_mem_tidy ( void  )

Free all memory malloc'd from static pointers. To be called before program exit. The function can be registered with atexit.

References ccp4_FtoCString(), ccp4_parse(), ccp4_parse_delimiters(), ccp4_parse_end(), ccp4_parse_start(), ccp4spg_free(), ccperror(), FORTRAN_SUBR(), CCP4PARSERTOKEN::fullstring, float_uint_uchar::i, invert4matrix(), symfr_driver(), symop_to_mat4(), and CCP4PARSERARRAY::token.

Referenced by ccp4f_mem_tidy().

void ccp4spg_name_de_colon ( char *  name)

Function to deal with colon-specified spacegroup settings. E.g. 'R 3 :H' is converted to 'H 3 '. Note that spaces are returned and should be dealt with by the calling function.

Parameters
nameSpacegroup name.
Returns
void

Referenced by ccp4spg_name_equal_to_lib(), and FORTRAN_SUBR().

int ccp4spg_name_equal ( const char *  spgname1,
const char *  spgname2 
)

Compare two spacegroup names. Strings are converted to upper case before making the comparison, but otherwise match must be exact.

Parameters
spgname1First spacegroup name.
spgname2Second spacegroup name.
Returns
1 if they are equal else 0.

References strtoupper().

int ccp4spg_name_equal_to_lib ( const char *  spgname_lib,
const char *  spgname_match 
)

Try to match a spacegroup name to one from SYMINFO. Blanks are removed when making the comparison. Strings are converted to upper case before making the comparison. If spgname_lib has " 1 " and spgname_match doesn't, then strip out " 1" to do "short" comparison.

Parameters
spgname_libFirst spacegroup name, assumed to be a standard one obtained at some point from SYMINFO
spgname_matchSecond spacegroup name that you are trying to match to a standard SYMINFO one. E.g. it might have been provided by the user.
Returns
1 if they are equal else 0.

References ccp4spg_name_de_colon(), ccp4spg_to_shortname(), and strtoupper().

Referenced by ccp4spg_load_spacegroup(), and FORTRAN_SUBR().

ccp4_symop* ccp4spg_norm_trans ( ccp4_symop op)

Function to normalise translations of a symmetry operator, i.e. to ensure 0.0 <= op.trn[i] < 1.0.

Parameters
oppointer to symmetry operator.
Returns
Pointer to normalised symmetry operator.

References ccp4_symop_::trn.

Referenced by ccp4spg_load_spacegroup().

int ccp4spg_pgname_equal ( const char *  pgname1,
const char *  pgname2 
)

Compare two point group names. Blanks are removed when making the comparison. Strings are converted to upper case before making the comparison. Any initial "PG" is ignored.

Parameters
pgname1First point group name.
pgname2Second point group name.
Returns
1 if they are equal else 0.

References strtoupper().

Referenced by FORTRAN_SUBR().

float ccp4spg_phase_shift ( const int  hin,
const int  kin,
const int  lin,
const float  phasin,
const float  trans[3],
const int  isign 
)

Shift phase value associated with hin,kin,lin according to translation and optional sign change. Return in range 0,360.

Parameters
hinreflection index
kinreflection index
linreflection index
phasinInput phase.
transRequested translation
isignIf -1, change sign of phase
Returns
shifted phase

Referenced by FORTRAN_SUBR().

void ccp4spg_print_centric_zones ( const CCP4SPG sp)

Print a summary of the centric zones of a spacegroup.

Parameters
sppointer to spacegroup
Returns
void

References ccp4_signal(), ccp4spg_describe_centric_zone(), and ccp4_spacegroup_::centrics.

Referenced by FORTRAN_SUBR().

void ccp4spg_print_epsilon_zones ( const CCP4SPG sp)

Print a summary of the epsilon zones of a spacegroup.

Parameters
sppointer to spacegroup
Returns
void

References ccp4_signal(), ccp4spg_describe_epsilon_zone(), and ccp4_spacegroup_::epsilon.

Referenced by FORTRAN_SUBR().

void ccp4spg_print_recip_ops ( const CCP4SPG sp)
void ccp4spg_print_recip_spgrp ( const CCP4SPG sp)

Print details on reciprocal spacegroup.

Parameters
sppointer to spacegroup
Returns
void

References ccp4_spacegroup_::asu_descr, ccp4_signal(), ccp4spg_print_recip_ops(), ccp4_spacegroup_::laue_name, ccp4_spacegroup_::point_group, and ccp4_spacegroup_::symbol_xHM.

Referenced by FORTRAN_SUBR().

int ccp4spg_put_in_asu ( const CCP4SPG sp,
const int  hin,
const int  kin,
const int  lin,
int *  hout,
int *  kout,
int *  lout 
)

Place reflection (hin,kin,lin) in the asymmetric unit of spacegroup "sp". Resultant indices are placed in (hout,kout,lout).

Parameters
sppointer to spacegroup
hininput reflection index
kininput reflection index
lininput reflection index
houtoutput reflection index
koutoutput reflection index
loutoutput reflection index
Returns
"isym" if successful, 0 otherwise. "isym" = 2*isymop - 1 for reflections placed in the positive asu, i.e. I+ of a Friedel pair, and "isym" = 2*isymop for reflections placed in the negative asu, i.e. I- of a Friedel pair. Here "isymop" is the number of the symmetry operator used.

References ccp4_signal(), ccp4spg_is_in_pm_asu(), ccp4_spacegroup_::nsymop_prim, ccp4_symop_::rot, and ccp4_spacegroup_::symop.

Referenced by FORTRAN_SUBR().

void ccp4spg_register_by_ccp4_num ( int  numspg)

Look up spacegroup in standard setting by number and load into static storage of csymlib_f.

Parameters
numspgspacegroup number
Returns
void

References ccp4spg_free(), ccp4spg_load_by_ccp4_num(), and ccperror().

void ccp4spg_register_by_symops ( int  nops,
float  rsm[][4][4] 
)

Look up spacegroup by set of symmetry operators and load into static storage of csymlib_f.

Parameters
nopsnumber of symops
rsmsymmetry operators
Returns
void

References ccp4_spgrp_reverse_lookup(), ccp4_utils_malloc(), ccp4spg_free(), ccperror(), float_uint_uchar::i, ccp4_symop_::rot, and ccp4_symop_::trn.

Referenced by FORTRAN_SUBR().

void ccp4spg_set_centric_zones ( CCP4SPG sp)

Set up centric zones for a given spacegroup. This is called upon loading a spacegroup.

Parameters
sppointer to spacegroup
Returns
void

References ccp4_signal(), ccp4_spacegroup_::centrics, ccp4_spacegroup_::nsymop, ccp4_symop_::rot, and ccp4_spacegroup_::symop.

Referenced by ccp4spg_load_spacegroup().

void ccp4spg_set_epsilon_zones ( CCP4SPG sp)

Set up epsilon zones for a given spacegroup. This is called upon loading a spacegroup.

Parameters
sppointer to spacegroup
Returns
void

References ccp4_signal(), ccp4_spacegroup_::epsilon, ccp4_spacegroup_::nsymop, ccp4_spacegroup_::nsymop_prim, ccp4_symop_::rot, and ccp4_spacegroup_::symop.

Referenced by ccp4spg_load_spacegroup().

char* ccp4spg_symbol_Hall ( CCP4SPG sp)

Function to return Hall symbol for spacegroup.

Parameters
sppointer to spacegroup
Returns
pointer to Hall symbol for spacegroup

References ccp4_signal(), and ccp4_spacegroup_::symbol_Hall.

char* ccp4spg_to_shortname ( char *  shortname,
const char *  longname 
)

Function to create "short" name of spacegroup. Blanks are removed, as are " 1" elements (except for the special case of "P 1").

Parameters
shortnameString long enough to hold short name.
longnameLong version of spacegroup name.
Returns
Pointer to shortname.

Referenced by ccp4spg_name_equal_to_lib(), and FORTRAN_SUBR().

int get_grid_sample ( const int  minsmp,
const int  nmul,
const float  sample 
)

Sets a grid sample greater than minsmp, which has no prime factors greater than 19, and contains the factor nmul.

Parameters
minsmp
nmul
sample
Returns
Grid sample or -1 on failure.

References all_factors_le_19().

Referenced by FORTRAN_SUBR(), and set_fft_grid().

int range_to_limits ( const char *  range,
float  limits[2] 
)

Convert string of type 0<=y<=1/4 to 0.0-delta, 0.25+delta, where delta is set to 0.00001 Makes many assumptions about string.

Parameters
rangeinput string.
limitsoutput range limits.
Returns
0 on success

Referenced by ccp4spg_load_spacegroup().

void set_fft_grid ( CCP4SPG sp,
const int  nxmin,
const int  nymin,
const int  nzmin,
const float  sample,
int *  nx,
int *  ny,
int *  nz 
)

Sets an FFT grid for a spacegroup.

Parameters
sppointer to spacegroup
nxminminimum sampling on x
nyminminimum sampling on y
nzminminimum sampling on z
sampledefault fineness of sample
nxreturns sampling intervals along x
nyreturns sampling intervals along y
nzreturns sampling intervals along z
Returns
void

References ccp4_signal(), get_grid_sample(), and ccp4_spacegroup_::laue_sampling.

Referenced by FORTRAN_SUBR().

int symfr_driver ( const char *  line,
float  rot[][4][4] 
)

Generate symop matrices from description strings This would not normally be called directly, but via one of the wrapping functions SYMFR2 and SYMFR3 in the Fortran API.

Parameters
linenull-terminated string containing symop descriptions
rotarray of 4x4 matrices
Returns
number of symops read, or -1 on failure

Referenced by ccp4spg_mem_tidy().