public Matrix4d[] transfToOriginCellCrystal(Matrix4d[] ops, Tuple3d reference) {
		Matrix4d[] transformed = new Matrix4d[ops.length];
		for(int j=0;j<ops.length;j++) {
			Matrix4d op = ops[j];

			// transform the reference point
			Point3d xXtal = new Point3d(reference);
			op.transform(xXtal);

			// Calculate unit cell of transformed reference
			int x = (int)Math.floor(xXtal.x);
			int y = (int)Math.floor(xXtal.y);
			int z = (int)Math.floor(xXtal.z);

			Matrix4d translation = new Matrix4d();
			translation.set(new Vector3d(-x,-y,-z));

			// Compose op with an additional translation operator
			translation.mul(op);

			Point3d ref2 = new Point3d(reference);
			translation.transform(ref2);

			transformed[j] = translation;
		}

		return transformed;
	}
public Matrix4d [ ] transfToOriginCellCrystal ( Matrix4d [ ] ops , Tuple3d reference ) { Matrix4d [ ] transformed = new Matrix4d [ ops . length ] ; for ( int j = 0 ; j < ops . length ; j ++ ) { Matrix4d op = ops [ j ] ; Point3d xXtal = new Point3d ( reference ) ; op . transform ( xXtal ) ; int x = ( int ) Math . floor ( xXtal . x ) ; int y = ( int ) Math . floor ( xXtal . y ) ; int z = ( int ) Math . floor ( xXtal . z ) ; Matrix4d translation = new Matrix4d ( ) ; translation . set ( new Vector3d ( - x , - y , - z ) ) ; translation . mul ( op ) ; Point3d ref2 = new Point3d ( reference ) ; translation . transform ( ref2 ) ; transformed [ j ] = translation ; } return transformed ; }
@param ops Set of operations in crystal coordinates
@param reference Reference point, which should be in the unit cell after
each operation (also in crystal coordinates)
@return A set of crystal operators with equivalent rotation to the
inputs, but with translation such that the reference point would fall
within the unit cell