#ifndef __spglib_H__
#define __spglib_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifndef SPGCONST
#define SPGCONST
#endif
#include <stddef.h>
typedef enum {
SPGLIB_SUCCESS = 0,
SPGERR_SPACEGROUP_SEARCH_FAILED,
SPGERR_CELL_STANDARDIZATION_FAILED,
SPGERR_SYMMETRY_OPERATION_SEARCH_FAILED,
SPGERR_ATOMS_TOO_CLOSE,
SPGERR_POINTGROUP_NOT_FOUND,
SPGERR_NIGGLI_FAILED,
SPGERR_DELAUNAY_FAILED,
SPGERR_ARRAY_SIZE_SHORTAGE,
SPGERR_NONE,
} SpglibError;
typedef struct {
int spacegroup_number;
int hall_number;
char international_symbol[11];
char hall_symbol[17];
char choice[6];
double transformation_matrix[3][3];
double origin_shift[3];
int n_operations;
int (*rotations)[3][3];
double (*translations)[3];
int n_atoms;
int *wyckoffs;
char (*site_symmetry_symbols)[7];
int *equivalent_atoms;
int *mapping_to_primitive;
int n_std_atoms;
double std_lattice[3][3];
int *std_types;
double (*std_positions)[3];
double std_rotation_matrix[3][3];
int *std_mapping_to_primitive;
char pointgroup_symbol[6];
} SpglibDataset;
typedef struct {
int number;
char international_short[11];
char international_full[20];
char international[32];
char schoenflies[7];
char hall_symbol[17];
char choice[6];
char pointgroup_international[6];
char pointgroup_schoenflies[4];
int arithmetic_crystal_class_number;
char arithmetic_crystal_class_symbol[7];
} SpglibSpacegroupType;
int spg_get_major_version(void);
int spg_get_minor_version(void);
int spg_get_micro_version(void);
SpglibError spg_get_error_code(void);
char * spg_get_error_message(SpglibError spglib_error);
SpglibDataset * spg_get_dataset(SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec);
SpglibDataset * spgat_get_dataset(SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec,
const double angle_tolerance);
SpglibDataset * spg_get_dataset_with_hall_number(SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const int hall_number,
const double symprec);
SpglibDataset *
spgat_get_dataset_with_hall_number(SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const int hall_number,
const double symprec,
const double angle_tolerance);
void spg_free_dataset(SpglibDataset *dataset);
int spg_get_symmetry(int rotation[][3][3],
double translation[][3],
const int max_size,
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec);
int spgat_get_symmetry(int rotation[][3][3],
double translation[][3],
const int max_size,
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec,
const double angle_tolerance);
int spg_get_symmetry_with_collinear_spin(int rotation[][3][3],
double translation[][3],
int equivalent_atoms[],
const int max_size,
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const double spins[],
const int num_atom,
const double symprec);
int spgat_get_symmetry_with_collinear_spin(int rotation[][3][3],
double translation[][3],
int equivalent_atoms[],
const int max_size,
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const double spins[],
const int num_atom,
const double symprec,
const double angle_tolerance);
int spg_get_hall_number_from_symmetry(SPGCONST int rotation[][3][3],
SPGCONST double translation[][3],
const int num_operations,
const double symprec);
int spg_get_multiplicity(SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec);
int spgat_get_multiplicity(SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec,
const double angle_tolerance);
int spg_get_international(char symbol[11],
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec);
int spgat_get_international(char symbol[11],
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec,
const double angle_tolerance);
int spg_get_schoenflies(char symbol[7],
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec);
int spgat_get_schoenflies(char symbol[7],
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec,
const double angle_tolerance);
int spg_get_pointgroup(char symbol[6],
int trans_mat[3][3],
SPGCONST int rotations[][3][3],
const int num_rotations);
int spg_get_symmetry_from_database(int rotations[192][3][3],
double translations[192][3],
const int hall_number);
SpglibSpacegroupType spg_get_spacegroup_type(const int hall_number);
int spg_standardize_cell(double lattice[3][3],
double position[][3],
int types[],
const int num_atom,
const int to_primitive,
const int no_idealize,
const double symprec);
int spgat_standardize_cell(double lattice[3][3],
double position[][3],
int types[],
const int num_atom,
const int to_primitive,
const int no_idealize,
const double symprec,
const double angle_tolerance);
int spg_find_primitive(double lattice[3][3],
double position[][3],
int types[],
const int num_atom,
const double symprec);
int spgat_find_primitive(double lattice[3][3],
double position[][3],
int types[],
const int num_atom,
const double symprec,
const double angle_tolerance);
int spg_refine_cell(double lattice[3][3],
double position[][3],
int types[],
const int num_atom,
const double symprec);
int spgat_refine_cell(double lattice[3][3],
double position[][3],
int types[],
const int num_atom,
const double symprec,
const double angle_tolerance);
int spg_delaunay_reduce(double lattice[3][3], const double symprec);
int spg_get_grid_point_from_address(const int grid_address[3],
const int mesh[3]);
size_t spg_get_dense_grid_point_from_address(const int grid_address[3],
const int mesh[3]);
int spg_get_ir_reciprocal_mesh(int grid_address[][3],
int ir_mapping_table[],
const int mesh[3],
const int is_shift[3],
const int is_time_reversal,
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec);
size_t spg_get_dense_ir_reciprocal_mesh(int grid_address[][3],
size_t ir_mapping_table[],
const int mesh[3],
const int is_shift[3],
const int is_time_reversal,
SPGCONST double lattice[3][3],
SPGCONST double position[][3],
const int types[],
const int num_atom,
const double symprec);
int spg_get_stabilized_reciprocal_mesh(int grid_address[][3],
int ir_mapping_table[],
const int mesh[3],
const int is_shift[3],
const int is_time_reversal,
const int num_rot,
SPGCONST int rotations[][3][3],
const int num_q,
SPGCONST double qpoints[][3]);
size_t spg_get_dense_stabilized_reciprocal_mesh(int grid_address[][3],
size_t ir_mapping_table[],
const int mesh[3],
const int is_shift[3],
const int is_time_reversal,
const int num_rot,
SPGCONST int rotations[][3][3],
const int num_q,
SPGCONST double qpoints[][3]);
void spg_get_grid_points_by_rotations(int rot_grid_points[],
const int address_orig[3],
const int num_rot,
SPGCONST int rot_reciprocal[][3][3],
const int mesh[3],
const int is_shift[3]);
void spg_get_dense_grid_points_by_rotations(size_t rot_grid_points[],
const int address_orig[3],
const int num_rot,
SPGCONST int rot_reciprocal[][3][3],
const int mesh[3],
const int is_shift[3]);
void spg_get_BZ_grid_points_by_rotations(int rot_grid_points[],
const int address_orig[3],
const int num_rot,
SPGCONST int rot_reciprocal[][3][3],
const int mesh[3],
const int is_shift[3],
const int bz_map[]);
void spg_get_dense_BZ_grid_points_by_rotations(size_t rot_grid_points[],
const int address_orig[3],
const int num_rot,
SPGCONST int rot_reciprocal[][3][3],
const int mesh[3],
const int is_shift[3],
const size_t bz_map[]);
int spg_relocate_BZ_grid_address(int bz_grid_address[][3],
int bz_map[],
SPGCONST int grid_address[][3],
const int mesh[3],
SPGCONST double rec_lattice[3][3],
const int is_shift[3]);
size_t spg_relocate_dense_BZ_grid_address(int bz_grid_address[][3],
size_t bz_map[],
SPGCONST int grid_address[][3],
const int mesh[3],
SPGCONST double rec_lattice[3][3],
const int is_shift[3]);
int spg_niggli_reduce(double lattice[3][3], const double symprec);
#ifdef __cplusplus
}
#endif
#endif