gpp4  1.3.1
csymlib.h
Go to the documentation of this file.
1 /*
2  csymlib.h: header file for csymlib.c
3  Copyright (C) 2001 CCLRC, Martyn Winn
4 
5  This library is free software: you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation, either
8  version 3 of the License, or (at your option) any later version.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public
16  License along with This library. If not, see
17  <http://www.gnu.org/licenses/>.
18 
19 */
20 
97 #ifndef __CSymLib__
98 #define __CSymLib__
99 
100 
101 /* note that definitions in ccp4_spg.h are within the CSym namespace */
102 #include "ccp4_spg.h"
103 
104 #ifdef __cplusplus
105 namespace CSym {
106 extern "C" {
107 #endif
108 
113 CCP4SPG *ccp4spg_load_by_standard_num(const int numspg);
114 
119 CCP4SPG *ccp4spg_load_by_ccp4_num(const int ccp4numspg);
120 
125 CCP4SPG *ccp4spg_load_by_spgname(const char *spgname);
126 
134 CCP4SPG *ccp4spg_load_by_ccp4_spgname(const char *ccp4spgname);
135 
141 CCP4SPG * ccp4_spgrp_reverse_lookup(const int nsym1, const ccp4_symop *op1);
142 
154 CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg,
155  const char *spgname, const char *ccp4spgname,
156  const int nsym1, const ccp4_symop *op1);
157 
162 void ccp4spg_mem_tidy(void);
163 
171 int symfr_driver (const char *line, float rot[][4][4]);
172 
176 void ccp4spg_free(CCP4SPG **sp);
177 
183 void ccp4spg_register_by_ccp4_num(int numspg);
184 
191 void ccp4spg_register_by_symops(int nops, float rsm[][4][4]);
192 
199 int ccp4_spg_get_centering(const char *symbol_Hall, float cent_ops[4][3]);
200 
206 int ccp4spg_load_laue(CCP4SPG* spacegroup, const int nlaue);
207 
211 int ASU_1b (const int h, const int k, const int l);
212 
216 int ASU_2_m (const int h, const int k, const int l);
217 
221 int ASU_mmm (const int h, const int k, const int l);
222 
226 int ASU_4_m (const int h, const int k, const int l);
227 
231 int ASU_4_mmm(const int h, const int k, const int l);
232 
236 int ASU_3b (const int h, const int k, const int l);
237 
241 int ASU_3bm (const int h, const int k, const int l);
242 
246 int ASU_3bmx (const int h, const int k, const int l);
247 
251 int ASU_6_m (const int h, const int k, const int l);
252 
256 int ASU_6_mmm(const int h, const int k, const int l);
257 
261 int ASU_m3b (const int h, const int k, const int l);
262 
266 int ASU_m3bm (const int h, const int k, const int l);
267 
272 char *ccp4spg_symbol_Hall(CCP4SPG* sp);
273 
280 
288 int ccp4spg_name_equal(const char *spgname1, const char *spgname2);
289 
301 int ccp4spg_name_equal_to_lib(const char *spgname_lib, const char *spgname_match);
302 
310 char *ccp4spg_to_shortname(char *shortname, const char *longname);
311 
318 void ccp4spg_name_de_colon(char *name);
319 
327 int ccp4spg_pgname_equal(const char *pgname1, const char *pgname2);
328 
335 
348 int ccp4_spgrp_equal( int nsym1, const ccp4_symop *op1, int nsym2, const ccp4_symop *op2);
349 
356 
363 int ccp4_int_compare( const void *p1, const void *p2 );
364 
372 int ccp4spg_is_in_pm_asu(const CCP4SPG* sp, const int h, const int k, const int l);
373 
381 int ccp4spg_is_in_asu(const CCP4SPG* sp, const int h, const int k, const int l);
382 
397 int ccp4spg_put_in_asu(const CCP4SPG* sp, const int hin, const int kin, const int lin,
398  int *hout, int *kout, int *lout );
399 
412 void ccp4spg_generate_indices(const CCP4SPG* sp, const int isym,
413  const int hin, const int kin, const int lin,
414  int *hout, int *kout, int *lout );
415 
426 float ccp4spg_phase_shift(const int hin, const int kin, const int lin,
427  const float phasin, const float trans[3], const int isign);
428 
434 int ccp4spg_do_chb(const float chb[3][3]);
435 
442 
452 int ccp4spg_is_centric(const CCP4SPG* sp, const int h, const int k, const int l);
453 
461 int ccp4spg_check_centric_zone(const int nzone, const int h, const int k, const int l);
462 
471 float ccp4spg_centric_phase(const CCP4SPG* sp, const int h, const int k, const int l);
472 
477 void ccp4spg_print_centric_zones(const CCP4SPG* sp);
478 
484 char *ccp4spg_describe_centric_zone(const int nzone, char *centric_zone);
485 
492 
501 int ccp4spg_get_multiplicity(const CCP4SPG* sp, const int h, const int k, const int l);
502 
510 int ccp4spg_check_epsilon_zone(const int nzone, const int h, const int k, const int l);
511 
516 void ccp4spg_print_epsilon_zones(const CCP4SPG* sp);
517 
523 char *ccp4spg_describe_epsilon_zone(const int nzone, char *epsilon_zone);
524 
525 
533 int ccp4spg_is_sysabs(const CCP4SPG* sp, const int h, const int k, const int l);
534 
546 int ccp4spg_generate_origins(const char *namspg, const int nsym, const float rsym[][4][4],
547  float origins[][3], int *polarx, int *polary, int *polarz,
548  const int iprint);
549 
554 void ccp4spg_print_recip_spgrp(const CCP4SPG* sp);
555 
560 void ccp4spg_print_recip_ops(const CCP4SPG* sp);
561 
568 int range_to_limits(const char *range, float limits[2]);
569 
581 void set_fft_grid(CCP4SPG* sp, const int nxmin, const int nymin, const int nzmin,
582  const float sample, int *nx, int *ny, int *nz);
583 
589 int all_factors_le_19(const int n);
590 
598 int get_grid_sample(const int minsmp, const int nmul, const float sample);
599 
607 int ccp4spg_check_symm_cell(int nsym, float rsym[][4][4], float cell[6]);
608 
609 #ifdef __cplusplus
610 } }
611 #endif
612 #endif
613 
614 /*
615  Local variables:
616  mode: font-lock
617  End:
618 */
ccp4_signal
void ccp4_signal(const int, const char *const, void(*)())
Definition: library_err.c:278
mat4_to_rotandtrn
ccp4_symop mat4_to_rotandtrn(const float rsm[4][4])
Definition: ccp4_parser.c:1564
ccp4_spacegroup_::spg_ccp4_num
int spg_ccp4_num
Definition: ccp4_spg.h:61
ccp4_utils.h
Utility functions.
ccp4spg_load_by_standard_num
CCP4SPG * ccp4spg_load_by_standard_num(const int numspg)
Definition: csymlib.c:49
ccp4_parser
int ccp4_parser(char *line, const int nchars, CCP4PARSERARRAY *parser, const int print)
Definition: ccp4_parser.c:742
ccp4_spacegroup_::npatt
int npatt
Definition: ccp4_spg.h:73
CCP4PARSERARRAY::token
CCP4PARSERTOKEN * token
Definition: ccp4_parser.h:153
csymlib.h
C-level library for symmetry information.
ccp4_spacegroup_::mapasu_ccp4
float mapasu_ccp4[3]
Definition: ccp4_spg.h:93
ASU_m3b
int ASU_m3b(const int h, const int k, const int l)
Definition: csymlib.c:722
ccp4spg_pgname_equal
int ccp4spg_pgname_equal(const char *pgname1, const char *pgname2)
Definition: csymlib.c:883
ccp4_keymatch
int ccp4_keymatch(const char *keyin1, const char *keyin2)
Definition: ccp4_parser.c:1012
ccp4spg_name_equal_to_lib
int ccp4spg_name_equal_to_lib(const char *spgname_lib, const char *spgname_match)
Definition: csymlib.c:770
ccp4spg_load_by_ccp4_num
CCP4SPG * ccp4spg_load_by_ccp4_num(const int ccp4numspg)
Definition: csymlib.c:54
ASU_4_mmm
int ASU_4_mmm(const int h, const int k, const int l)
Definition: csymlib.c:710
mat4_to_recip_symop
char * mat4_to_recip_symop(char *symchs_begin, char *symchs_end, const float rsm[4][4])
Definition: ccp4_parser.c:1737
ccp4_unitcell.h
C library for manipulations based on cell parameters.
ccp4_4matmul
void ccp4_4matmul(float c[4][4], const float a[4][4], const float b[4][4])
Definition: cvecmat.c:71
ccp4_int_compare
int ccp4_int_compare(const void *p1, const void *p2)
Definition: csymlib.c:982
ccp4spg_set_centric_zones
void ccp4spg_set_centric_zones(CCP4SPG *sp)
Definition: csymlib.c:1092
ASU_3bmx
int ASU_3bmx(const int h, const int k, const int l)
Definition: csymlib.c:716
ASU_6_m
int ASU_6_m(const int h, const int k, const int l)
Definition: csymlib.c:718
ccp4spg_free
void ccp4spg_free(CCP4SPG **sp)
Definition: csymlib.c:634
ccp4_spacegroup_::laue_sampling
int laue_sampling[3]
Definition: ccp4_spg.h:71
ccp4spg_load_laue
int ccp4spg_load_laue(CCP4SPG *spacegroup, const int nlaue)
Definition: csymlib.c:1835
ccp4_spgrp_reverse_lookup
CCP4SPG * ccp4_spgrp_reverse_lookup(const int nsym1, const ccp4_symop *op1)
Definition: csymlib.c:69
ccp4_utils_malloc
void * ccp4_utils_malloc(size_t)
Definition: library_utils.c:401
ccp4_spacegroup_::asufn
int(* asufn)(const int, const int, const int)
Definition: ccp4_spg.h:84
ccp4_spacegroup_::invsymop
ccp4_symop * invsymop
Definition: ccp4_spg.h:79
ccp4_types.h
Header file containing various commonly used type definitions and some useful macros.
ccp4_spacegroup_::point_group
char point_group[20]
Definition: ccp4_spg.h:66
ccp4spg_generate_origins
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)
Definition: csymlib.c:1459
ccp4uc_is_hexagonal
int ccp4uc_is_hexagonal(const float cell[6], const float tolerance)
Definition: ccp4_unitcell.c:380
all_factors_le_19
int all_factors_le_19(const int n)
Definition: csymlib.c:1776
ASU_3bm
int ASU_3bm(const int h, const int k, const int l)
Definition: csymlib.c:714
rotandtrn_to_mat4
void rotandtrn_to_mat4(float rsm[4][4], const ccp4_symop symop)
Definition: ccp4_parser.c:1599
ccp4spg_print_centric_zones
void ccp4spg_print_centric_zones(const CCP4SPG *sp)
Definition: csymlib.c:1211
ccp4_spgrp_equal
int ccp4_spgrp_equal(int nsym1, const ccp4_symop *op1, int nsym2, const ccp4_symop *op2)
Definition: csymlib.c:922
ASU_4_m
int ASU_4_m(const int h, const int k, const int l)
Definition: csymlib.c:708
ASU_3b
int ASU_3b(const int h, const int k, const int l)
Definition: csymlib.c:712
get_grid_sample
int get_grid_sample(const int minsmp, const int nmul, const float sample)
Definition: csymlib.c:1794
CCP4PARSERTOKEN
CCP4 Parser token Construct to hold the information about a single token.
Definition: ccp4_parser.h:127
ASU_1b
int ASU_1b(const int h, const int k, const int l)
Definition: csymlib.c:702
ccp4_spacegroup_::patt_name
char patt_name[40]
Definition: ccp4_spg.h:74
ccp4_parse_start
CCP4PARSERARRAY * ccp4_parse_start(const int maxtokens)
Definition: ccp4_parser.c:71
ccp4_spacegroup_::symop
ccp4_symop * symop
Definition: ccp4_spg.h:78
ccp4_parse_delimiters
int ccp4_parse_delimiters(CCP4PARSERARRAY *parsePtr, const char *delim, const char *nulldelim)
Definition: ccp4_parser.c:241
ccp4_spacegroup_::nsymop
int nsymop
Definition: ccp4_spg.h:76
ccp4_spacegroup_
Data structure of a space group descriptor.
Definition: ccp4_spg.h:58
ccp4spg_load_by_spgname
CCP4SPG * ccp4spg_load_by_spgname(const char *spgname)
Definition: csymlib.c:59
ccp4_spacegroup_::laue_name
char laue_name[20]
Definition: ccp4_spg.h:70
cvecmat.h
Declarations of matrix and vector handling functions.
ccp4spg_register_by_symops
void ccp4spg_register_by_symops(int nops, float rsm[][4][4])
Definition: csymlib_f.c:1093
ccp4_spacegroup_::mapasu_zero
float mapasu_zero[3]
Definition: ccp4_spg.h:90
ccp4spg_norm_trans
ccp4_symop * ccp4spg_norm_trans(ccp4_symop *op)
Definition: csymlib.c:910
ccp4spg_generate_indices
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)
Definition: csymlib.c:1039
ASU_2_m
int ASU_2_m(const int h, const int k, const int l)
Definition: csymlib.c:704
ccp4spg_is_in_pm_asu
int ccp4spg_is_in_pm_asu(const CCP4SPG *sp, const int h, const int k, const int l)
Definition: csymlib.c:987
ccp4spg_describe_epsilon_zone
char * ccp4spg_describe_epsilon_zone(const int nzone, char *epsilon_zone)
Definition: csymlib.c:1392
ccp4_spacegroup_::nsymop_prim
int nsymop_prim
Definition: ccp4_spg.h:77
strtoupper
char * strtoupper(char *str1, const char *str2)
Definition: ccp4_parser.c:1056
ccp4_spacegroup_::nlaue
int nlaue
Definition: ccp4_spg.h:69
ASU_6_mmm
int ASU_6_mmm(const int h, const int k, const int l)
Definition: csymlib.c:720
ccp4_spg_get_centering
int ccp4_spg_get_centering(const char *symbol_Hall, float cent_ops[4][3])
Definition: csymlib.c:641
ccp4_symop_
Kevin's symmetry operator.
Definition: ccp4_spg.h:48
ccp4spg_print_recip_ops
void ccp4spg_print_recip_ops(const CCP4SPG *sp)
Definition: csymlib.c:1618
ccp4spg_to_shortname
char * ccp4spg_to_shortname(char *shortname, const char *longname)
Definition: csymlib.c:831
ccp4spg_put_in_asu
int ccp4spg_put_in_asu(const CCP4SPG *sp, const int hin, const int kin, const int lin, int *hout, int *kout, int *lout)
Definition: csymlib.c:1006
ccp4_parser.h
Functions to read in and "parse" CCP4-style keyworded input.
ccp4_spacegroup_::centrics
int centrics[12]
Definition: ccp4_spg.h:86
ccp4_spacegroup_::symbol_xHM
char symbol_xHM[20]
Definition: ccp4_spg.h:63
ccp4_spacegroup_::symbol_old
char symbol_old[20]
Definition: ccp4_spg.h:64
ccp4spg_mem_tidy
void ccp4spg_mem_tidy(void)
Definition: csymlib_f.c:99
ccp4spg_check_epsilon_zone
int ccp4spg_check_epsilon_zone(const int nzone, const int h, const int k, const int l)
Definition: csymlib.c:1335
ccp4_spacegroup_::crystal
char crystal[20]
Definition: ccp4_spg.h:67
symop_to_mat4
const char * symop_to_mat4(const char *symchs_begin, const char *symchs_end, float *rot)
Definition: ccp4_parser.c:1398
ccp4_symop_code
int ccp4_symop_code(ccp4_symop op)
Definition: csymlib.c:971
ccp4spg_phase_shift
float ccp4spg_phase_shift(const int hin, const int kin, const int lin, const float phasin, const float trans[3], const int isign)
Definition: csymlib.c:1065
ccp4_symop_::trn
float trn[3]
Definition: ccp4_spg.h:51
ccp4spg_check_centric_zone
int ccp4spg_check_centric_zone(const int nzone, const int h, const int k, const int l)
Definition: csymlib.c:1155
ccp4spg_check_symm_cell
int ccp4spg_check_symm_cell(int nsym, float rsym[][4][4], float cell[6])
Definition: csymlib.c:1949
ccp4spg_symbol_Hall
char * ccp4spg_symbol_Hall(CCP4SPG *sp)
Definition: csymlib.c:727
ccp4spg_do_chb
int ccp4spg_do_chb(const float chb[3][3])
Definition: csymlib.c:1082
ccp4spg_describe_centric_zone
char * ccp4spg_describe_centric_zone(const int nzone, char *centric_zone)
Definition: csymlib.c:1233
ccp4spg_is_centric
int ccp4spg_is_centric(const CCP4SPG *sp, const int h, const int k, const int l)
Definition: csymlib.c:1136
ccp4spg_register_by_ccp4_num
void ccp4spg_register_by_ccp4_num(int numspg)
Definition: csymlib_f.c:1080
ASU_m3bm
int ASU_m3bm(const int h, const int k, const int l)
Definition: csymlib.c:724
CCP4PARSERARRAY
CCP4 Parser array Construct to hold the information about a parsed line.
Definition: ccp4_parser.h:149
ccp4_spg.h
Data structure for symmetry information.
ccp4_spacegroup_::epsilon
int epsilon[13]
Definition: ccp4_spg.h:87
ccp4spg_load_spacegroup
CCP4SPG * ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg, const char *spgname, const char *ccp4spgname, const int nsym1, const ccp4_symop *op1)
Definition: csymlib.c:78
ccp4spg_is_sysabs
int ccp4spg_is_sysabs(const CCP4SPG *sp, const int h, const int k, const int l)
Definition: csymlib.c:1426
ccp4_symop_invert
ccp4_symop ccp4_symop_invert(const ccp4_symop op1)
Definition: csymlib.c:735
invert4matrix
float invert4matrix(const float a[4][4], float ai[4][4])
Definition: cvecmat.c:117
ccp4spg_set_epsilon_zones
void ccp4spg_set_epsilon_zones(CCP4SPG *sp)
Definition: csymlib.c:1267
ccp4spg_is_in_asu
int ccp4spg_is_in_asu(const CCP4SPG *sp, const int h, const int k, const int l)
Definition: csymlib.c:993
ccp4_errno.h
Header file for error handling routines Error codes based on system errors.
ccp4_spacegroup_::asu_descr
char asu_descr[80]
Definition: ccp4_spg.h:83
ccp4spg_print_recip_spgrp
void ccp4spg_print_recip_spgrp(const CCP4SPG *sp)
Definition: csymlib.c:1603
ccp4spg_get_multiplicity
int ccp4spg_get_multiplicity(const CCP4SPG *sp, const int h, const int k, const int l)
Definition: csymlib.c:1318
ccp4_spacegroup_::chb
float chb[3][3]
Definition: ccp4_spg.h:81
CCP4PARSERARRAY::keyword
char keyword[5]
Definition: ccp4_parser.h:151
ccp4_spacegroup_::spg_num
int spg_num
Definition: ccp4_spg.h:60
ccp4_parse_end
int ccp4_parse_end(CCP4PARSERARRAY *parsePtr)
Definition: ccp4_parser.c:143
ccp4spg_centric_phase
float ccp4spg_centric_phase(const CCP4SPG *sp, const int h, const int k, const int l)
Definition: csymlib.c:1187
ccp4spg_name_equal
int ccp4spg_name_equal(const char *spgname1, const char *spgname2)
Definition: csymlib.c:744
range_to_limits
int range_to_limits(const char *range, float limits[2])
Definition: csymlib.c:1703
symfr_driver
int symfr_driver(const char *line, float rot[][4][4])
CCP4PARSERARRAY::ntokens
int ntokens
Definition: ccp4_parser.h:152
set_fft_grid
void set_fft_grid(CCP4SPG *sp, const int nxmin, const int nymin, const int nzmin, const float sample, int *nx, int *ny, int *nz)
Definition: csymlib.c:1764
ccp4spg_load_by_ccp4_spgname
CCP4SPG * ccp4spg_load_by_ccp4_spgname(const char *ccp4spgname)
Definition: csymlib.c:64
ccp4_spacegroup_::mapasu_ccp4_descr
char mapasu_ccp4_descr[80]
Definition: ccp4_spg.h:92
ccp4_spacegroup_::mapasu_zero_descr
char mapasu_zero_descr[80]
Definition: ccp4_spg.h:89
ccp4spg_print_epsilon_zones
void ccp4spg_print_epsilon_zones(const CCP4SPG *sp)
Definition: csymlib.c:1371
ccp4_symop_::rot
float rot[3][3]
Definition: ccp4_spg.h:50
ASU_mmm
int ASU_mmm(const int h, const int k, const int l)
Definition: csymlib.c:706
ccp4uc_is_rhombohedral
int ccp4uc_is_rhombohedral(const float cell[6], const float tolerance)
Definition: ccp4_unitcell.c:359
ccp4spg_name_de_colon
void ccp4spg_name_de_colon(char *name)
Definition: csymlib.c:862
ccp4_spacegroup_::symbol_Hall
char symbol_Hall[40]
Definition: ccp4_spg.h:62