Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
3324537
first dcd stumb cython file
kain88-de Jun 30, 2016
d05d331
first working darft of dcd reimplmentation
kain88-de Aug 7, 2016
6743c80
open and close dcd files
kain88-de Aug 8, 2016
f3c81da
add context manager support
kain88-de Aug 8, 2016
3413c09
remove pass statement
kain88-de Aug 8, 2016
690ca54
correctly handle is_open flag cases
kain88-de Aug 8, 2016
3de4b41
start dcd read header stub
kain88-de Aug 9, 2016
39cf1db
add include guards for fastio.h
kain88-de Aug 28, 2016
75d883f
read DCD Header
kain88-de Aug 28, 2016
ee4958f
free memory when closing
kain88-de Sep 1, 2016
ac0e1fc
remarks handling
kain88-de Sep 1, 2016
0fdf996
comment all the things
kain88-de Sep 3, 2016
44cdc5d
convert remarks to python strings
kain88-de Oct 1, 2016
82b2317
make n_atoms public in dcd
kain88-de Oct 1, 2016
a53263f
make delta public
kain88-de Oct 1, 2016
4e6f726
make more stuff public
kain88-de Oct 1, 2016
807d21a
periodic property
kain88-de Oct 1, 2016
8c2065a
estimate number of frames
kain88-de Oct 1, 2016
75adf21
work on read_next_frame
kain88-de Oct 1, 2016
82f46e6
improve reading API
kain88-de Oct 4, 2016
10f1ea6
finish reading and iteration protocol
kain88-de Oct 4, 2016
f9e9d73
add seek support
kain88-de Oct 4, 2016
f67121d
TST: Added first draft of testing module for new Cython-based DCD fil…
tylerjereddy Oct 21, 2016
00d2d4e
TST: All libdcd unit tests now pass, except one related to unit cell …
tylerjereddy Oct 23, 2016
254d18c
TST: Added several more unit tests to test_libdcd.py.
tylerjereddy Oct 23, 2016
f0e190a
TST: updated unit tests to reflect appropriate Error raising for test…
tylerjereddy Oct 24, 2016
488b69d
ENH: rebase against develop / handle merge conflicts / remove old DCD…
tylerjereddy Jan 10, 2017
575319e
ENH: Very early draft of DCD header writing Cython code and very crud…
tylerjereddy Jan 11, 2017
2b2d354
ENH: libdcd.pyx now avoids file overwriting and handles writing more …
tylerjereddy Jan 11, 2017
72dcdb6
ENH: Updated DCD unit tests to accommodate improvement to DCD file he…
tylerjereddy Jan 11, 2017
364769a
ENH: restored DCD-related import checking in MDAnalysis/coordinates/_…
tylerjereddy Jan 14, 2017
cb0ac04
ENH: Replaced all usage of RuntimeError exception with IOError in lib…
tylerjereddy Jan 14, 2017
41e6708
ENH: test_libdcd.py now correctly expects IOError instead of RuntimeE…
tylerjereddy Jan 14, 2017
6009d27
ENH: added py3 compatibility for block_import.
tylerjereddy Jan 14, 2017
4ab5ba7
compile _dcdmodule again
kain88-de Jan 16, 2017
d584884
correct source suffix
kain88-de Jan 16, 2017
72c1007
ENH: New DCD reading code now appears to handle unit cell information…
tylerjereddy Jan 29, 2017
15ad4a3
ENH: Fixed an IOError message in libdcd.pyx that referred to TRR file…
tylerjereddy Jan 30, 2017
03bd8f9
ENH: DCDFile now has an early draft of the write() method & there's a…
tylerjereddy Jan 30, 2017
f513c1a
ENH: added additional arguments and docstring to write method of DCDF…
tylerjereddy Feb 2, 2017
904a94e
ENH: The write method of DCDFile now calls the header writing code fi…
tylerjereddy Feb 2, 2017
7c666c5
ENH: DCDFile unit tests updated to reflect the fact that the write me…
tylerjereddy Feb 2, 2017
5ea62c4
ENH: DCDFile write method arguments now accepting python input, thoug…
tylerjereddy Feb 2, 2017
41cf9aa
ENH: Reactivated the write_dcdstep C code in the write method of DCDF…
tylerjereddy Feb 3, 2017
cd9c376
ENH: Initial cleanup of ctypedef statements in libdcd.pyx based on re…
tylerjereddy Feb 3, 2017
0081bed
ENH: The DCDFile write method now requires the double type for box an…
tylerjereddy Feb 3, 2017
766f09c
ENH: Expanded the DCDFile header writing capabilities.
tylerjereddy Feb 3, 2017
94812b9
ENH: Added more unit tests for DCDFile write() method.
tylerjereddy Feb 3, 2017
1ca6661
use consistent double dimensions
kain88-de Feb 3, 2017
61f9828
ENH: Added 2 new unit tests for DCDFile writing behaviour.
tylerjereddy Feb 3, 2017
078d706
ENH: Added initial code to allow REMARKS section of DCD file written …
tylerjereddy Feb 3, 2017
0e91cc5
ENH: General cleanup of DCDFile write() method arguments in code prop…
tylerjereddy Feb 3, 2017
2441450
ENH: Removed an extraneous variable from the setUp of DCDWriteTest.
tylerjereddy Feb 3, 2017
5fd4a84
ENH: python 2/3 string handling compatiblity fixes for DCDFile.
tylerjereddy Feb 7, 2017
bfe3895
ENH: DCDFile writing of REMARKS section has been adjusted to allow sp…
tylerjereddy Feb 8, 2017
e1b17ef
ENH: Added 3 new writing-related tests for the new DCDFile object.
tylerjereddy Feb 9, 2017
78537bc
ENH: The number of 80 character title strings written by default to n…
tylerjereddy Feb 9, 2017
92d00ae
ENH: DCDFile self.n_frames property is now determined by physical ite…
tylerjereddy Feb 10, 2017
a7bac17
ENH: reverting frame count changes in DCDFile.
tylerjereddy Feb 11, 2017
03b0d31
ENH: the DCDFile firstframesize property has been patched to the appa…
tylerjereddy Feb 11, 2017
54de1d1
ENH: Added unit tests for DCD file byte striding arithmetic; exposed …
tylerjereddy Feb 13, 2017
f95e87b
ENH: Added unit tests for NAMD-format DCD file input to DCDFile. Mino…
tylerjereddy Feb 13, 2017
b04d352
ENH: Added more thorough / correct unit test code for header remarks …
tylerjereddy Mar 9, 2017
8663bbb
ENH: patched minor error from accidental deletion in test suite for n…
tylerjereddy Mar 9, 2017
37ad4b8
ENH: Added proper DCDFile remarks / header string handling -- all uni…
tylerjereddy Mar 9, 2017
70e33f3
DCDFile variables that are testing-only / implementation details are …
tylerjereddy Mar 16, 2017
381ec46
Replaced a standard library assertion with a numpy assertion in the l…
tylerjereddy Mar 16, 2017
2aa069c
DCDFile now allows overwriting, based on feedback in PR#1155.
tylerjereddy Mar 16, 2017
70a7194
current_frame variable is now updated in write method of DCDFile.
tylerjereddy Mar 16, 2017
4ba09d7
Removed spurious header writing; fixed an issue in write() method of …
tylerjereddy Apr 20, 2017
c3747a5
Patched issue with frame iteration in test_coord_match -- all unit te…
tylerjereddy Apr 21, 2017
8667879
Attempted formatting fixes in test_libdcd.py.
tylerjereddy Apr 21, 2017
be6d451
Added unit test test_read_coord_values, and associated testing data, …
tylerjereddy Apr 21, 2017
59af1e0
Merge branch 'develop' into dcd-cython-tyler
tylerjereddy Apr 21, 2017
cdfca18
test_libdcd.py adjusted to allow pickle to open new test data under p…
tylerjereddy Apr 22, 2017
fc407d3
The testsuite included data now covers Python pickle files as some we…
tylerjereddy Apr 24, 2017
4aa1da3
DCDFile unit testing now uses .npy for archival coord storage instead…
tylerjereddy Apr 27, 2017
03368e2
The use of read_dcdsubset in DCDFile Cython code has been replaced by…
tylerjereddy May 9, 2017
868936d
Testing of unit cell data writing has been restricted--NAMD unit cell…
tylerjereddy May 9, 2017
1275e55
Unit cell debug work.
tylerjereddy May 10, 2017
16fb623
Adjustments to DCD unit cell handling code that enable a read-write-r…
tylerjereddy May 10, 2017
0e4ab6c
Added Charmm36 triclinic trajectory data unit tests -- all of them pass.
tylerjereddy May 11, 2017
505ee7f
Removed extraneous unit cell handling code from C-level read_dcdsubset.
tylerjereddy May 11, 2017
9a67273
test_header_remarks has been adjusted to perform a direct string comp…
tylerjereddy May 11, 2017
6f9f28d
Simplified code in test_iteration() unit test based on PR comments.
tylerjereddy May 11, 2017
ab20b0a
DCDWriteTestRandom now pins down the random seed for testing robustness.
tylerjereddy May 11, 2017
1ed3324
fixes in libdcd
kain88-de May 22, 2017
51bbc3a
Refactor libdcd test
kain88-de May 23, 2017
d0aa8ab
Added new property-based unit test, test_written_remarks_property(), …
tylerjereddy May 26, 2017
1d4ceec
fix write_file function
kain88-de May 28, 2017
1f23ffc
add write dtype handling
kain88-de May 28, 2017
ad21ae2
check tell in iteration
kain88-de May 28, 2017
0d93ea1
use sensible warnings when only a header is written
kain88-de May 28, 2017
ae5eb16
remove double definition
kain88-de May 28, 2017
e464e45
restucture libdcd test order
kain88-de May 28, 2017
09b079c
deactivate correl tests for now
kain88-de May 28, 2017
685ae94
start work on new dcd reader
kain88-de May 28, 2017
390196e
fix unicode name in open
kain88-de May 28, 2017
a2d0791
improve dt unit handling
kain88-de May 28, 2017
0a655ac
Fix unitcell handling
kain88-de May 28, 2017
1ff37c8
fix failing tests
kain88-de May 29, 2017
90d4278
enable new style reader/writer tests
kain88-de May 30, 2017
d2c2476
fix up docs
kain88-de May 30, 2017
c65ae72
remove old C dcd reader
kain88-de May 30, 2017
1ccf270
remove duplicate tests
kain88-de May 30, 2017
dc08bf1
add header property
kain88-de May 30, 2017
308496d
Removed setup.py refs to old dcd framework.
tylerjereddy May 30, 2017
1b04abe
test_written_remarks_property() test now works properly for printable…
tylerjereddy May 30, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
663 changes: 140 additions & 523 deletions package/MDAnalysis/coordinates/DCD.py

Large diffs are not rendered by default.

949 changes: 0 additions & 949 deletions package/MDAnalysis/coordinates/src/dcd.c

This file was deleted.

3 changes: 2 additions & 1 deletion package/MDAnalysis/lib/formats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
#
from __future__ import absolute_import
from . import libmdaxdr
from . import libdcd

__all__ = ['libmdaxdr']
__all__ = ['libmdaxdr', 'libdcd']
188 changes: 188 additions & 0 deletions package/MDAnalysis/lib/formats/include/correl.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode:nil; -*- */
/* vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 */
/*
MDAnalysis --- http://mdanalysis.googlecode.com
Copyright (c) 2006-2014 Naveen Michaud-Agrawal,
Elizabeth J. Denning, Oliver Beckstein,
and contributors (see AUTHORS for the full list)
Released under the GNU Public Licence, v2 or any higher version

Please cite your use of MDAnalysis in published work:

N. Michaud-Agrawal, E. J. Denning, T. B. Woolf, and
O. Beckstein. MDAnalysis: A Toolkit for the Analysis of
Molecular Dynamics Simulations. J. Comput. Chem. 32 (2011), 2319--2327,
in press.
*/

#ifndef CORREL_H
#define CORREL_H

#include <math.h>
/* Python.h for 'typedef int Py_intptr_t;' (fixes Issue 19) */
#include <Python.h>

static void
copyseries(int frame, char *data, const Py_intptr_t *strides,
const float *tempX, const float *tempY, const float *tempZ,
const char* datacode, int numdata, const int* atomlist, const int* atomcounts,
int lowerb, double* aux)
{
char code;
int index1 = 0, index2 = 0, index3 = 0, index4 = 0;
double x1, x2, y1, y2, z1, z2, x3, y3, z3, aux1, aux2;
int i = 0, j = 0, atomno = 0;
int dataset = 0;
int stride0, stride1;

stride0 = strides[0];
stride1 = strides[1];

/* If I eventually switch to using frame,property ordering for timeseries data
stride0 = strides[1];
stride1 = strides[0];
*/

for (i=0;i<numdata;i++) {
code = datacode[i];
switch (code) {
case 'm':
x1 = y1 = z1 = 0.0;
aux2 = 0;
for (j=0;j<atomcounts[i];j++) {
index1 = atomlist[atomno]-lowerb;
aux1 = aux[atomno++];
aux2 += aux1;
x1 += tempX[index1]*aux1;
y1 += tempY[index1]*aux1;
z1 += tempZ[index1]*aux1;
}
*(double*)(data + dataset++*stride0 + frame*stride1) = x1/aux2;
*(double*)(data + dataset++*stride0 + frame*stride1) = y1/aux2;
*(double*)(data + dataset++*stride0 + frame*stride1) = z1/aux2;
break;
case 'x':
index1 = atomlist[atomno++]-lowerb;
*(double*)(data+dataset++*stride0+frame*stride1) = tempX[index1];
break;
case 'y':
index1 = atomlist[atomno++]-lowerb;
*(double*)(data+dataset++*stride0+frame*stride1) = tempY[index1];
break;
case 'z':
index1 = atomlist[atomno++]-lowerb;
*(double*)(data+dataset++*stride0+frame*stride1) = tempZ[index1];
break;
case 'v':
index1 = atomlist[atomno++]-lowerb;
*(double*)(data + dataset++*stride0 + frame*stride1) = tempX[index1];
*(double*)(data + dataset++*stride0 + frame*stride1) = tempY[index1];
*(double*)(data + dataset++*stride0 + frame*stride1) = tempZ[index1];
break;
case 'a':
index1 = atomlist[atomno++]-lowerb;
index2 = atomlist[atomno++]-lowerb;
index3 = atomlist[atomno++]-lowerb;
x1 = tempX[index1]-tempX[index2];
y1 = tempY[index1]-tempY[index2];
z1 = tempZ[index1]-tempZ[index2];
x2 = tempX[index3]-tempX[index2];
y2 = tempY[index3]-tempY[index2];
z2 = tempZ[index3]-tempZ[index2];
aux1 = sqrt(x1*x1+y1*y1+z1*z1);
aux2 = sqrt(x2*x2+y2*y2+z2*z2);
*(double*)(data + dataset++*stride0 + frame*stride1) = acos((x1*x2+y1*y2+z1*z2)/(aux1*aux2));
break;
case 'd':
index1 = atomlist[atomno++]-lowerb;
index2 = atomlist[atomno++]-lowerb;
*(double*)(data + dataset++*stride0+frame*stride1) = tempX[index2]-tempX[index1];
*(double*)(data + dataset++*stride0+frame*stride1) = tempY[index2]-tempY[index1];
*(double*)(data + dataset++*stride0+frame*stride1) = tempZ[index2]-tempZ[index1];
break;
case 'r':
index1 = atomlist[atomno++]-lowerb;
index2 = atomlist[atomno++]-lowerb;
x1 = tempX[index2]-tempX[index1];
y1 = tempY[index2]-tempY[index1];
z1 = tempZ[index2]-tempZ[index1];
*(double*)(data + dataset++*stride0+frame*stride1) = sqrt(x1*x1+y1*y1+z1*z1);
break;
case 'h':
index1 = atomlist[atomno++]-lowerb;
index2 = atomlist[atomno++]-lowerb;
index3 = atomlist[atomno++]-lowerb;
index4 = atomlist[atomno++]-lowerb;
x1 = tempX[index2]-tempX[index1];
y1 = tempY[index2]-tempY[index1];
z1 = tempZ[index2]-tempZ[index1];
x2 = tempX[index3]-tempX[index2];
y2 = tempY[index3]-tempY[index2];
z2 = tempZ[index3]-tempZ[index2];
x3 = tempX[index3]-tempX[index4];
y3 = tempY[index3]-tempY[index4];
z3 = tempZ[index3]-tempZ[index4];
double nx1, ny1, nz1, nx2, ny2, nz2;
// v1 x v2
nx1 = (y1*z2) - (y2*z1); ny1 = (z1*x2)-(z2*x1); nz1 = (x1*y2)-(x2*y1);
// v3 x v2
nx2 = (y3*z2) - (y2*z3); ny2 = (z3*x2)-(z2*x3); nz2 = (x3*y2)-(x2*y3);
double a, b;
a = sqrt(nx1*nx1+ny1*ny1+nz1*nz1); b = sqrt(nx2*nx2+ny2*ny2+nz2*nz2);
// normalized the cross products
nx1 /= a; ny1 /= a; nz1 /= a; nx2 /= b; ny2 /= b; nz2 /= b;
// find the angle
aux1 = acos(nx1*nx2+ny1*ny2+nz1*nz2);
// and the sign of the angle
aux2 = (nx2*x1+ny2*y1+nz2*z1);
if ((aux2 < 0 && aux1 > 0) || (aux2 > 0 && aux1 < 0)) {
aux1 *= -1;
}
// Check if the dihedral has wrapped around 2 pi
aux2 = *(double*)(data + dataset*stride0 + (frame-1)*stride1);
if (fabs(aux1-aux2) > M_PI) {
if (aux1 > 0) { aux1 -= 2*M_PI; }
else { aux1 += 2*M_PI; }
}
*(double*)(data + dataset++*stride0 + frame*stride1) = aux1;
break;
case 'w':
/* dipole orientation of 3-site water: ^ d
index1 = oxygen, index2, index3 = hydrogen |
returns d ,O,
d = rO - (rH1 + rH2)/2 H | H
|
*/
index1 = atomlist[atomno++]-lowerb; // O
index2 = atomlist[atomno++]-lowerb; // H1
index3 = atomlist[atomno++]-lowerb; // H2
x1 = tempX[index1] - 0.5*(tempX[index2] + tempX[index3]); // dx
y1 = tempY[index1] - 0.5*(tempY[index2] + tempY[index3]); // dy
z1 = tempZ[index1] - 0.5*(tempZ[index2] + tempZ[index3]); // dz
*(double*)(data + dataset++*stride0 + frame*stride1) = x1;
*(double*)(data + dataset++*stride0 + frame*stride1) = y1;
*(double*)(data + dataset++*stride0 + frame*stride1) = z1;
break;
}
}
}

// This accounts for periodic boundary conditions
// taken from MMTK
#define distance_vector_2(d, r1, r2, data) \
{ \
double xh = 0.5*(data)[0]; \
double yh = 0.5*(data)[1]; \
double zh = 0.5*(data)[2]; \
d[0] = r2[0]-r1[0]; \
if (d[0] > xh) d[0] -= (data)[0]; \
if (d[0] <= -xh) d[0] += (data)[0]; \
d[1] = r2[1]-r1[1]; \
if (d[1] > yh) d[1] -= (data)[1]; \
if (d[1] <= -yh) d[1] += (data)[1]; \
d[2] = r2[2]-r1[2]; \
if (d[2] > zh) d[2] -= (data)[2]; \
if (d[2] <= -zh) d[2] += (data)[2]; \
}

#endif
173 changes: 173 additions & 0 deletions package/MDAnalysis/lib/formats/include/endianswap.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
/***************************************************************************
*cr
*cr (C) Copyright 1995-2003 The Board of Trustees of the
*cr University of Illinois
*cr All Rights Reserved
*cr
***************************************************************************/
/***************************************************************************
* RCS INFORMATION:
*
* $RCSfile: endianswap.h,v $
* $Author: eamon $ $Locker: $ $State: Exp $
* $Revision: 1.3 $ $Date: 2004/04/16 15:37:00 $
*
***************************************************************************
* DESCRIPTION:
* Byte swapping routines used in various plugins
* There are two versions of each routine, one that's safe to use in
* all cases (but is slow) and one that is only safe to use on memory
* addresses that are aligned to the word size that's being byte-swapped
* but are much much much faster. Use the aligned versions of these
* routines whenever possible. The 'ndata' length count parameters and
* internal loops should be safe to use on huge memory arrays on 64-bit
* machines.
*
***************************************************************************/

#ifndef ENDIAN_SWAP_H
#define ENDIAN_SWAP_H

/* works on unaligned 2-byte quantities */
static void swap2_unaligned(void *v, long ndata) {
long i;
char * dataptr = (char *) v;
char tmp;

for (i = 0; i < ndata-1; i += 2) {
tmp = dataptr[i];
dataptr[i] = dataptr[i+1];
dataptr[i+1] = tmp;
}
}


/* works on unaligned 4-byte quantities */
static void swap4_unaligned(void *v, long ndata) {
long i;
char *dataptr;
char tmp;

dataptr = (char *) v;
for (i=0; i<ndata; i++) {
tmp = dataptr[0];
dataptr[0] = dataptr[3];
dataptr[3] = tmp;
tmp = dataptr[1];
dataptr[1] = dataptr[2];
dataptr[2] = tmp;
dataptr += 4;
}
}


/* works on unaligned 8-byte quantities */
static void swap8_unaligned(void *v, long ndata) {
char *data = (char *) v;
long i;
char byteArray[8];
char *bytePointer;

for (i=0; i<ndata; i++) {
bytePointer = data + (i<<3);
byteArray[0] = *bytePointer;
byteArray[1] = *(bytePointer+1);
byteArray[2] = *(bytePointer+2);
byteArray[3] = *(bytePointer+3);
byteArray[4] = *(bytePointer+4);
byteArray[5] = *(bytePointer+5);
byteArray[6] = *(bytePointer+6);
byteArray[7] = *(bytePointer+7);

*bytePointer = byteArray[7];
*(bytePointer+1) = byteArray[6];
*(bytePointer+2) = byteArray[5];
*(bytePointer+3) = byteArray[4];
*(bytePointer+4) = byteArray[3];
*(bytePointer+5) = byteArray[2];
*(bytePointer+6) = byteArray[1];
*(bytePointer+7) = byteArray[0];
}
}


/* Only works with aligned 2-byte quantities, will cause a bus error */
/* on some platforms if used on unaligned data. */
static void swap2_aligned(void *v, long ndata) {
short *data = (short *) v;
long i;
short *N;

for (i=0; i<ndata; i++) {
N = data + i;
*N=(((*N>>8)&0xff) | ((*N&0xff)<<8));
}
}


/* Only works with aligned 4-byte quantities, will cause a bus error */
/* on some platforms if used on unaligned data. */
static void swap4_aligned(void *v, long ndata) {
int *data = (int *) v;
long i;
int *N;
for (i=0; i<ndata; i++) {
N = data + i;
*N=(((*N>>24)&0xff) | ((*N&0xff)<<24) |
((*N>>8)&0xff00) | ((*N&0xff00)<<8));
}
}


/* Only works with aligned 8-byte quantities, will cause a bus error */
/* on some platforms if used on unaligned data. */
static void swap8_aligned(void *v, long ndata) {
/* Use int* internally to prevent bugs caused by some compilers */
/* and hardware that would potentially load data into an FP reg */
/* and hose everything, such as the old "jmemcpy()" bug in NAMD */
int *data = (int *) v;
long i;
int *N;
int t0, t1;

for (i=0; i<ndata; i++) {
N = data + (i<<1);
t0 = N[0];
t0=(((t0>>24)&0xff) | ((t0&0xff)<<24) |
((t0>>8)&0xff00) | ((t0&0xff00)<<8));

t1 = N[1];
t1=(((t1>>24)&0xff) | ((t1&0xff)<<24) |
((t1>>8)&0xff00) | ((t1&0xff00)<<8));

N[0] = t1;
N[1] = t0;
}
}

#if 0
/* Other implementations that might be faster in some cases */

/* swaps the endianism of an eight byte word. */
void mdio_swap8(double *i) {
char c;
char *n;
n = (char *) i;
c = n[0];
n[0] = n[7];
n[7] = c;
c = n[1];
n[1] = n[6];
n[6] = c;
c = n[2];
n[2] = n[5];
n[5] = c;
c = n[3];
n[3] = n[4];
n[4] = c;
}

#endif

#endif

Loading