#!/bin/sh
#!perl -w # --*- Perl -*--
eval 'exec perl -x $0 ${1+"$@"}'
    if 0;
#------------------------------------------------------------------------------
#$Author: antanas $
#$Date: 2021-07-30 20:10:23 +0300 (Fri, 30 Jul 2021) $
#$Revision: 8841 $
#$URL: svn+ssh://www.crystallography.net/home/coder/svn-repositories/cod-tools/tags/v3.8.1/tools/check_symop_canonicality $
#------------------------------------------------------------------------------
#*
# Check symop string in COD::Spacegroups::Lookup::COD for their canonicality.
#**

use strict;
use warnings;
use COD::Spacegroups::Lookup::COD;
use COD::Spacegroups::Symop::Parse qw( symop_string_canonical_form );


for my $sg ( @COD::Spacegroups::Lookup::COD::table,
             @COD::Spacegroups::Lookup::COD::extra_settings ) {
  for my $set ( 'symops', 'ncsym' ) {
    for my $symop ( @{$sg->{$set}} ) {
      if ($symop ne symop_string_canonical_form($symop) ) {
          print STDERR "$0:: WARNING, space group '", $sg->{'hall'}, "' ",
                "contains a symmetry operator in the set '$set' that is not ",
                "canonicalised -- the '$symop' symop should be canonicalised ",
                "to '", symop_string_canonical_form($symop), "'.\n";
      }
    }
  }
}
