示例#1
0
static Centering get_transformation_matrix( double trans_mat[3][3],
					    SPGCONST Symmetry * symmetry )
{
  int pg_num;
  double correction_mat[3][3];
  Centering centering;
  Pointgroup pointgroup;

  pg_num = ptg_get_pointgroup_number( symmetry );
  pointgroup = ptg_get_pointgroup( pg_num );
  ptg_get_transformation_matrix( &pointgroup, symmetry );

  /* Centering is not determined only from symmetry operations */
  /* sometimes. Therefore centering and transformation matrix are */
  /* related. */
  centering = lat_get_centering( correction_mat,
				 pointgroup.transform_mat,
				 pointgroup.laue );
  mat_multiply_matrix_id3( trans_mat,
			   pointgroup.transform_mat,
			   correction_mat );

  debug_print("correction matrix\n");
  debug_print_matrix_d3( correction_mat );

  return centering;
}
示例#2
0
/* Return 0 if failed */
int spg_get_pointgroup(char symbol[6],
		       int transform_mat[3][3],
		       SPGCONST int rotations[][3][3],
		       const int num_rotations)
{
  int tmp_transform_mat[3][3];
  double correction_mat[3][3], transform_mat_double[3][3];
  Pointgroup pointgroup;

  pointgroup = ptg_get_transformation_matrix(tmp_transform_mat,
					     rotations,
					     num_rotations);
  strcpy(symbol, pointgroup.symbol);
  lat_get_centering(correction_mat,
		    tmp_transform_mat,
		    pointgroup.laue);
  mat_multiply_matrix_id3(transform_mat_double,
			  tmp_transform_mat,
			  correction_mat);
  mat_cast_matrix_3d_to_3i(transform_mat, transform_mat_double);
  return pointgroup.number;
}