# Test of row/column sums for symmetric matrix

CONTACT_MATRIX ATOMS=1-10 SWITCH={RATIONAL R_0=1.0} HIGHMEM LABEL=mat
COLUMNSUMS MATRIX=mat MEAN LABEL=csums
ROWSUMS MATRIX=mat MEAN LABEL=rsums

COORDINATIONNUMBER SPECIES=1-10 SWITCH={RATIONAL R_0=1.0} MEAN LABEL=c1
PRINT ARG=c1.*,csums.*,rsums.* STRIDE=1 FILE=colvar FMT=%8.4f
DUMPDERIVATIVES ARG=c1.*,csums.*,rsums.* STRIDE=1 FILE=derivatives FMT=%8.4f

# Test of row/column sums + around for symmetric matrix

AROUND ATOM=1 DATA=csums SIGMA=0.2 XLOWER=-1.0 XUPPER=1.0 MEAN LABEL=a1
AROUND ATOM=1 DATA=rsums SIGMA=0.2 XLOWER=-1.0 XUPPER=1.0 MEAN LABEL=a2
AROUND ATOM=1 DATA=c1 SIGMA=0.2 XLOWER=-1.0 XUPPER=1.0 MEAN LABEL=a3

PRINT ARG=a1.*,a2.*,a3.* FILE=colv-around FMT=%8.4f
DUMPDERIVATIVES ARG=a1.*,a2.*,a3.* FILE=deriv-around FMT=%8.4f

# Test of row/column sums for rectangular matrix

CONTACT_MATRIX ATOMSA=1-5 ATOMSB=6-15 SWITCH={RATIONAL R_0=1.0} HIGHMEM LABEL=mat2 
ROWSUMS MATRIX=mat2 MEAN LABEL=rsums2
COLUMNSUMS MATRIX=mat2 MEAN LABEL=csums2

COORDINATIONNUMBER SPECIESA=1-5 SPECIESB=6-15 SWITCH={RATIONAL R_0=1.0} MEAN LABEL=c1r
COORDINATIONNUMBER SPECIESA=6-15 SPECIESB=1-5 SWITCH={RATIONAL R_0=1.0} MEAN LABEL=c1c

PRINT ARG=c1r.*,rsums2.*,c1c.*,csums2.* FILE=colv2 FMT=%8.4f
DUMPDERIVATIVES ARG=c1r.*,rsums2.*,c1c.*,csums2.* FILE=deriv2 FMT=%8.4f

# Test of row/column sums + around for rectangular matrix

AROUND ATOM=6 DATA=csums2 SIGMA=0.2 XLOWER=-1.0 XUPPER=1.0 MEAN LABEL=a4
AROUND ATOM=6 DATA=c1c SIGMA=0.2 XLOWER=-1.0 XUPPER=1.0 MEAN LABEL=a5
AROUND ATOM=1 DATA=rsums2 SIGMA=0.2 XLOWER=-1.0 XUPPER=1.0 MEAN LABEL=a6
AROUND ATOM=1 DATA=c1r SIGMA=0.2 XLOWER=-1.0 XUPPER=1.0 MEAN LABEL=a7

PRINT ARG=a4.*,a5.*,a6.*,a7.* FILE=colv-around-2 FMT=%8.4f
DUMPDERIVATIVES ARG=a6.*,a7.*,a5.*,a4.* FILE=deriv-around-2 FMT=%8.4f

