SymmetryOperation
Date: 2019-10-22

org.jmol.symmetry

## Class SymmetryOperation

- java.lang.Object
- - javajs.util.M34
  - - javajs.util.M4
    - - org.jmol.symmetry.SymmetryOperation

-     public class SymmetryOperation
      extends javajs.util.M4

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private static javajs.util.P3` | `atomTest`
    `private javajs.util.V3` | `centering`
    `private boolean` | `doNormalize` "normalization" is the process of adjusting symmetry operator definitions such that the center of geometry of a molecule is within the 555 unit cell for each operation.
    `private static java.lang.String[]` | `fortyeigths`
    `(package private) int` | `index`
    `private java.util.Hashtable<java.lang.String,java.lang.Object>` | `info`
    `(package private) boolean` | `isBio`
    `(package private) boolean` | `isCenteringOp`
    `(package private) boolean` | `isFinalized`
    `(package private) static java.lang.String[]` | `labelsXn`
    `(package private) static java.lang.String[]` | `labelsXnSub`
    `(package private) static java.lang.String[]` | `labelsXYZ`
    `(package private) float[]` | `linearRotTrans`
    `private float` | `magOp`
    `(package private) int` | `modDim`
    `private java.lang.String[]` | `myLabels`
    `private int` | `opId`
    `(package private) javajs.util.Matrix` | `rsvs`
    `private javajs.util.Matrix` | `sigma`
    `(package private) java.lang.String` | `subsystemCode`
    `(package private) int` | `timeReversal`
    `private static java.lang.String[]` | `twelfths`
    `private boolean` | `unCentered`
    `(package private) java.lang.String` | `xyz`
    `(package private) java.lang.String` | `xyzOriginal`

    - ### Fields inherited from class javajs.util.M4

      `m03, m13, m23, m30, m31, m32, m33`

    - ### Fields inherited from class javajs.util.M34

      `m00, m01, m02, m10, m11, m12, m20, m21, m22`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SymmetryOperation(SymmetryOperation op, javajs.util.P3[] atoms, int atomIndex, int countOrId, boolean doNormalize)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `(package private) static float` | `approxF(float f)`
    `private static javajs.util.M4` | `div12(javajs.util.M4 op)`
    `(package private) void` | `doFinalize()`
    `(package private) java.lang.String` | `dumpInfo()`
    `(package private) static java.lang.String` | `dumpSeitz(javajs.util.M4 s, boolean isCanonical)`
    `private static java.lang.String` | `fc(float x)`
    `(package private) static java.lang.String` | `fcoord(javajs.util.T3 p)`
    `(package private) java.lang.String` | `fixMagneticXYZ(javajs.util.M4 m, java.lang.String xyz, boolean addMag)`
    `(package private) static java.lang.String` | `fortyEighthsOf(float n48ths)`
    `(package private) javajs.util.V3` | `getCentering()` assumption here is that these are in order of sets, as in ITA
    `java.util.Map<java.lang.String,java.lang.Object>` | `getInfo()`
    `(package private) float` | `getMagneticOp()` Magnetic spin is a pseudo (or "axial") vector.
    `(package private) static java.lang.String` | `getMatrixFromString(SymmetryOperation op, java.lang.String xyz, float[] linearRotTrans, boolean allowScaling)` Convert the Jones-Faithful notation "x, -z+1/2, y" or "x1, x3-1/2, x2, x5+1/2, -x6+1/2, x7..." to a linear array Also allows a-b,-5a-5b,-c;0,0,0 format
    `static javajs.util.M4` | `getMatrixFromXYZ(java.lang.String xyz)`
    `(package private) java.lang.String` | `getXyz(boolean normalized)`
    `static java.lang.String` | `getXYZFromMatrix(javajs.util.M4 mat, boolean is12ths, boolean allPositive, boolean halfOrLess)`
    `(package private) static java.lang.String` | `getXYZFromRsVs(javajs.util.Matrix rs, javajs.util.Matrix vs, boolean is12ths)`
    `(package private) static void` | `newPoint(javajs.util.M4 m, javajs.util.P3 atom1, javajs.util.P3 atom2, int x, int y, int z)`
    `private static float` | `normalize48ths(float iValue, boolean doNormalize)`
    `private static float` | `normalizeTwelfths(float iValue, boolean doNormalize)`
    `private static java.lang.String` | `plusMinus(java.lang.String strT, float x, java.lang.String sx)`
    `(package private) static java.lang.String` | `replaceXn(java.lang.String xyz, int n)`
    `(package private) javajs.util.V3[]` | `rotateAxes(javajs.util.V3[] vectors, UnitCell unitcell, javajs.util.P3 ptTemp, javajs.util.M3 mTemp)`
    `(package private) boolean` | `setFromMatrix(float[] offset, boolean isReverse)`
    `private void` | `setGamma(boolean isReverse)` rsvs is the superspace group rotation-translation matrix.
    `private void` | `setMatrix(boolean isReverse)`
    `(package private) boolean` | `setMatrixFromXYZ(java.lang.String xyz, int modDim, boolean allowScaling)`
    `private void` | `setModDim(int dim)`
    `static void` | `setOffset(javajs.util.M4 m, javajs.util.P3[] atoms, int atomIndex, int count)`
    `(package private) void` | `setSigma(java.lang.String subsystemCode, javajs.util.Matrix sigma)`
    `(package private) void` | `setTimeReversal(int magRev)` set the time reversal, and indicate internally in xyz as appended ",m" or ",-m"
    `java.lang.String` | `toString()` Returns a string that contains the values of this Matrix4f.
    `(package private) static java.lang.String` | `twelfthsOf(float n12ths)`
    `private static java.lang.String` | `xyzFraction12(float n12ths, boolean allPositive, boolean halfOrLess)`
    `private static java.lang.String` | `xyzFraction48ths(float n48ths, boolean allPositive, boolean halfOrLess)`

    - ### Methods inherited from class javajs.util.M4

      `determinant4, equals, getColumn, getElement, getRotationScale, getRow, getTranslation, hashCode, invert, mul, mul2, newA16, newM4, newMV, rotTrans, rotTrans2, round, scale, setA, setAsXYRotation, setAsXZRotation, setAsYZRotation, setColumn4, setColumnA, setElement, setIdentity, setM4, setMV, setRotationScale, setRowA, setToAA, setToM3, setTranslation, setZero, sub, transform, transform2, transpose`

    - ### Methods inherited from class javajs.util.M34

      `add33, clear33, determinant3, err, get33, getColumn33, getRow33, mul33, rotate, rotate2, set33, setAA33, setColumn33, setM33, setRow33, setXRot, setYRot, setZRot, sub33, transpose33`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### xyzOriginal

          java.lang.String xyzOriginal

    - #### xyz

          java.lang.String xyz

    - #### doNormalize

          private boolean doNormalize

      "normalization" is the process of adjusting symmetry operator definitions such that the center of geometry of a molecule is within the 555 unit cell for each operation. It is carried out when "packed" is NOT issued and the lattice is given as {i j k} or when the lattice is given as {nnn mmm 1}

    - #### isFinalized

          boolean isFinalized

    - #### opId

          private int opId

    - #### centering

          private javajs.util.V3 centering

    - #### atomTest

          private static javajs.util.P3 atomTest

    - #### myLabels

          private java.lang.String[] myLabels

    - #### modDim

          int modDim

    - #### linearRotTrans

          float[] linearRotTrans

    - #### rsvs

          javajs.util.Matrix rsvs

    - #### isBio

          boolean isBio

    - #### sigma

          private javajs.util.Matrix sigma

    - #### index

          int index

    - #### subsystemCode

          java.lang.String subsystemCode

    - #### timeReversal

          int timeReversal

    - #### twelfths

          private static final java.lang.String[] twelfths

    - #### fortyeigths

          private static final java.lang.String[] fortyeigths

    - #### labelsXYZ

          static final java.lang.String[] labelsXYZ

    - #### labelsXn

          static final java.lang.String[] labelsXn

    - #### labelsXnSub

          static final java.lang.String[] labelsXnSub

    - #### unCentered

          private boolean unCentered

    - #### isCenteringOp

          boolean isCenteringOp

    - #### magOp

          private float magOp

    - #### info

          private java.util.Hashtable<java.lang.String,java.lang.Object> info

  - ### Constructor Detail

    - #### SymmetryOperation

          SymmetryOperation(SymmetryOperation op,
                            javajs.util.P3[] atoms,
                            int atomIndex,
                            int countOrId,
                            boolean doNormalize)

      Parameters:
        `op` -
        `atoms` -
        `atomIndex` -
        `countOrId` -
        `doNormalize` -

  - ### Method Detail

    - #### setSigma

          void setSigma(java.lang.String subsystemCode,
                        javajs.util.Matrix sigma)

    - #### setGamma

          private void setGamma(boolean isReverse)

      rsvs is the superspace group rotation-translation matrix. It is a (3 + modDim + 1) x (3 + modDim + 1) matrix from which we can extract all necessary parts;
      Parameters:
        `isReverse` -

    - #### doFinalize

          void doFinalize()

    - #### div12

          private static javajs.util.M4 div12(javajs.util.M4 op)

    - #### getXyz

          java.lang.String getXyz(boolean normalized)

    - #### newPoint

          static void newPoint(javajs.util.M4 m,
                               javajs.util.P3 atom1,
                               javajs.util.P3 atom2,
                               int x,
                               int y,
                               int z)

    - #### dumpInfo

          java.lang.String dumpInfo()

    - #### dumpSeitz

          static final java.lang.String dumpSeitz(javajs.util.M4 s,
                                                  boolean isCanonical)

    - #### setMatrixFromXYZ

          boolean setMatrixFromXYZ(java.lang.String xyz,
                                   int modDim,
                                   boolean allowScaling)

    - #### setModDim

          private void setModDim(int dim)

    - #### setMatrix

          private void setMatrix(boolean isReverse)

    - #### setFromMatrix

          boolean setFromMatrix(float[] offset,
                                boolean isReverse)

    - #### getMatrixFromXYZ

          public static javajs.util.M4 getMatrixFromXYZ(java.lang.String xyz)

    - #### getMatrixFromString

          static java.lang.String getMatrixFromString(SymmetryOperation op,
                                                      java.lang.String xyz,
                                                      float[] linearRotTrans,
                                                      boolean allowScaling)

      Convert the Jones-Faithful notation "x, -z+1/2, y" or "x1, x3-1/2, x2, x5+1/2, -x6+1/2, x7..." to a linear array Also allows a-b,-5a-5b,-c;0,0,0 format
      Parameters:
        `op` -
        `xyz` -
        `linearRotTrans` -
        `allowScaling` -
      Returns:
        canonized Jones-Faithful string

    - #### replaceXn

          static java.lang.String replaceXn(java.lang.String xyz,
                                            int n)

    - #### xyzFraction12

          private static final java.lang.String xyzFraction12(float n12ths,
                                                              boolean allPositive,
                                                              boolean halfOrLess)

    - #### xyzFraction48ths

          private static final java.lang.String xyzFraction48ths(float n48ths,
                                                                 boolean allPositive,
                                                                 boolean halfOrLess)

    - #### twelfthsOf

          static final java.lang.String twelfthsOf(float n12ths)

    - #### fortyEighthsOf

          static final java.lang.String fortyEighthsOf(float n48ths)

    - #### plusMinus

          private static java.lang.String plusMinus(java.lang.String strT,
                                                    float x,
                                                    java.lang.String sx)

    - #### normalizeTwelfths

          private static float normalizeTwelfths(float iValue,
                                                 boolean doNormalize)

    - #### normalize48ths

          private static float normalize48ths(float iValue,
                                              boolean doNormalize)

    - #### getXYZFromMatrix

          public static final java.lang.String getXYZFromMatrix(javajs.util.M4 mat,
                                                                boolean is12ths,
                                                                boolean allPositive,
                                                                boolean halfOrLess)

    - #### setOffset

          public static void setOffset(javajs.util.M4 m,
                                       javajs.util.P3[] atoms,
                                       int atomIndex,
                                       int count)

    - #### rotateAxes

          javajs.util.V3[] rotateAxes(javajs.util.V3[] vectors,
                                      UnitCell unitcell,
                                      javajs.util.P3 ptTemp,
                                      javajs.util.M3 mTemp)

    - #### fcoord

          static java.lang.String fcoord(javajs.util.T3 p)

    - #### fc

          private static java.lang.String fc(float x)

    - #### approxF

          static float approxF(float f)

    - #### getXYZFromRsVs

          static java.lang.String getXYZFromRsVs(javajs.util.Matrix rs,
                                                 javajs.util.Matrix vs,
                                                 boolean is12ths)

    - #### toString

          public java.lang.String toString()

      Description copied from class: `javajs.util.M4`
      Returns a string that contains the values of this Matrix4f.
      Overrides:
        `toString` in class `javajs.util.M4`
      Returns:
        the String representation

    - #### getMagneticOp

          float getMagneticOp()

      Magnetic spin is a pseudo (or "axial") vector. This means that it acts as a rotation, not a vector. When a rotation about x is passed through the mirror plane xz, it is reversed; when it is passed through the mirror plane yz, it is not reversed -- exactly opposite what you would imagine from a standard "polar" vector. For example, a vector perpendicular to a plane of symmetry (det=-1) will be flipped (m=1), while a vector parallel to that plane will not be flipped (m=-1) In addition, magnetic spin operations have a flag m=1 or m=-1 (m or -m) that indicates how the vector quantity changes with symmetry. This is called "time reversal" and stored here as timeReversal. To apply, timeReversal must be multiplied by the 3x3 determinant, which is always 1 (standard rotation) or -1 (rotation-inversion). This we store as magOp. See https://en.wikipedia.org/wiki/Pseudovector
      Returns:
        +1, -1, or 0

    - #### setTimeReversal

          void setTimeReversal(int magRev)

      set the time reversal, and indicate internally in xyz as appended ",m" or ",-m"
      Parameters:
        `magRev` -

    - #### getCentering

          javajs.util.V3 getCentering()

      assumption here is that these are in order of sets, as in ITA
      Returns:
        centering

    - #### fixMagneticXYZ

          java.lang.String fixMagneticXYZ(javajs.util.M4 m,
                                          java.lang.String xyz,
                                          boolean addMag)

    - #### getInfo

          public java.util.Map<java.lang.String,java.lang.Object> getInfo()