Rotate a structure object. The rotation Matrix must be a
pre-multiplication Matrix.

@param structure
the structure to be rotated
@param m
rotation matrix to be applied
429159
public static final void rotate(Structure structure, Matrix m){

		AtomIterator iter = new AtomIterator(structure) ;

		while (iter.hasNext()) {
			Atom atom = iter.next() ;
			rotate(atom,m);

		}

	}
1243667
public Matrix4x3f set(Matrix4fc m) {
        if (m instanceof Matrix4f) {
            MemUtil.INSTANCE.copy((Matrix4f) m, this);
        } else {
            setMatrix4fc(m);
        }
        properties = m.properties() & (PROPERTY_IDENTITY | PROPERTY_TRANSLATION | PROPERTY_ORTHONORMAL);
        return this;
    }
1035728
private void updateMultipleAlignment() throws StructureException,
			RefinerFailedException {

		msa.clear();

		// Override the alignment with the new information
		Block b = msa.getBlock(0);
		b.setAlignRes(block);
		repeatCore = b.getCoreLength();
		if (repeatCore < 1)
			throw new RefinerFailedException(
					"Optimization converged to length 0");

		SymmetryTools.updateSymmetryTransformation(axes, msa);
	}
1089916
public static void setMatrix(final double[][] m1, final int[] r, final int[] c, final double[][] m2) {
    for(int i = 0; i < r.length; i++) {
      final double[] row1 = m1[r[i]], row2 = m2[i];
      for(int j = 0; j < c.length; j++) {
        row1[c[j]] = row2[j];
      }
    }
  }
1321379
def apply_transformation(self, structure):
        
        if structure.is_ordered:
            return structure

        species = [dict(sp) for sp in structure.species_and_occu]

        for sp in species:
            for k, v in sp.items():
                old_occ = sp[k]
                new_occ = float(
                    Fraction(old_occ).limit_denominator(self.max_denominator))
                if self.fix_denominator:
                    new_occ = around(old_occ*self.max_denominator)\
                        / self.max_denominator
                if round(abs(old_occ - new_occ), 6) > self.tol:
                    raise RuntimeError(
                        "Cannot discretize structure within tolerance!")
                sp[k] = new_occ

        return Structure(structure.lattice, species, structure.frac_coords)
612568
def reorient_z(structure):
    
    struct = structure.copy()
    sop = get_rot(struct)
    struct.apply_operation(sop)
    return struct
1241923
private void calMatrix() throws StructureException
	{
		int     i, j;
		double  dis;
		for(i = 0; i < pro1Len; i ++)   {
			for(j = 0; j < pro2Len; j ++)   {
				dis = Calc.getDistance(cod1[i],cod2[j]);

				if(dis < Dc) {
					sij[i][j] = Dc - dis;
				}
				else  {
					sij[i][j] = 0;
				}
			}
		}
	}
691042
public void applyScale( SceneStructureMetric structure ,
							SceneObservations observations ) {

		if( structure.homogenous ) {
			applyScaleToPointsHomogenous(structure);
		} else {
			computePointStatistics(structure.points);
			applyScaleToPoints3D(structure);
			applyScaleTranslation3D(structure);
		}
		// NOTE: Observations can't be centered/scaled here because that changes the camera model.
		//       That requires knowledge this class can't have access to and must be done externally
	}
668539
public void rotate(Quaternion rotation) {
		Transform3D tr = new Transform3D();
		tr.setRotation(rotation);
		transform(tr);
	}
1349633
private static void flipAround(SceneStructureMetric structure, SceneObservations observations) {
		// The first view will be identity
		for (int i = 1; i < structure.views.length; i++) {
			Se3_F64 w2v = structure.views[i].worldToView;
			w2v.set(w2v.invert(null));
		}
		triangulatePoints(structure,observations);
	}
277200
public static final void rotate(Group group, double[][] rotationmatrix)
			throws StructureException {

		if ( rotationmatrix.length != 3 ) {
			throw new StructureException ("matrix does not have size 3x3 !");
		}
		AtomIterator iter = new AtomIterator(group) ;
		while (iter.hasNext()) {
			Atom atom = null ;

			atom = iter.next() ;
			rotate(atom,rotationmatrix);

		}
	}
814078
public Matrix3f set(Matrix3fc m) {
        if (m instanceof Matrix3f) {
            MemUtil.INSTANCE.copy((Matrix3f) m, this);
        } else {
            setMatrix3fc(m);
        }
        return this;
    }
1311202
public static final void transform(Structure structure, Matrix4d m) {
		for (int n=0; n<structure.nrModels();n++) {
			for (Chain c : structure.getChains(n)) {
				transform(c, m);
			}
		}
	}
145988
private void set(Matrix m)
    {
        this.nRows  = this.nCols = Math.min(m.nRows, m.nCols);
        this.values = m.values;
    }
142830
public void align(Structure s1, String chainId1, Structure s2,
			String chainId2, StrucAligParameters params)
			throws StructureException {
		reset();
		this.params = params;

		Chain c1 = s1.getPolyChainByPDB(chainId1);
		Chain c2 = s2.getPolyChainByPDB(chainId2);

		Structure s3 = new StructureImpl();
		s3.addChain(c1);

		Structure s4 = new StructureImpl();
		s4.addChain(c2);

		Atom[] ca1 = getAlignmentAtoms(s3);
		Atom[] ca2 = getAlignmentAtoms(s4);

		notifyStartingAlignment(s1.getName(), ca1, s2.getName(), ca2);
		align(ca1, ca2, params);
	}
910903
public void set( T a ) {
        if( a.getType() == getType() )
            mat.set(a.getMatrix());
        else {
            setMatrix(a.mat.copy());
        }
    }
1240826
public void rotate(Quaternion rotation) {
		Transform3D m = new Transform3D();
		m.setRotation(rotation);
		m.transform(this.getSegmentVector());
		this.getSegmentVector().normalize();
	}