fprintf(stdout, "Trace of the two matrices: %g and %g\n", sum1, sum2);
if (neig1 != n || neig2 != n)
{
- fprintf(stdout, "this is %d%% and %d%% of the total trace\n",
- gmx::roundToInt(100 * sum1 / trace1), gmx::roundToInt(100 * sum2 / trace2));
+ fprintf(stdout,
+ "this is %d%% and %d%% of the total trace\n",
+ gmx::roundToInt(100 * sum1 / trace1),
+ gmx::roundToInt(100 * sum2 / trace2));
}
fprintf(stdout, "Square root of the traces: %g and %g\n", std::sqrt(sum1), std::sqrt(sum2));
rhi.b = 0;
nlevels = 41;
out = gmx_ffopen(matfile, "w");
- write_xpm(out, 0, "Eigenvector inner-products", "in.prod.", "run 1", "run 2", nx, ny, t_x, t_y,
- mat, 0.0, maxval, rlo, rhi, &nlevels);
+ write_xpm(out, 0, "Eigenvector inner-products", "in.prod.", "run 1", "run 2", nx, ny, t_x, t_y, mat, 0.0, maxval, rlo, rhi, &nlevels);
gmx_ffclose(out);
}
gmx_fatal(FARGS,
"the number of atoms in your trajectory (%d) is larger than the number of "
"atoms in your structure file (%d)",
- nat, atoms->nr);
+ nat,
+ atoms->nr);
}
snew(all_at, nat);
ylabel[v] = gmx_strdup(str);
}
sprintf(str, "projection on eigenvectors (%s)", proj_unit);
- write_xvgr_graphs(projfile, noutvec, 1, str, nullptr, output_env_get_xvgr_tlabel(oenv),
- ylabel, nframes, inprod[noutvec], inprod, nullptr,
- output_env_get_time_factor(oenv), FALSE, bSplit, oenv);
+ write_xvgr_graphs(projfile,
+ noutvec,
+ 1,
+ str,
+ nullptr,
+ output_env_get_xvgr_tlabel(oenv),
+ ylabel,
+ nframes,
+ inprod[noutvec],
+ inprod,
+ nullptr,
+ output_env_get_time_factor(oenv),
+ FALSE,
+ bSplit,
+ oenv);
}
if (twodplotfile)
"You have selected four or more eigenvectors:\n"
"fourth eigenvector will be plotted "
"in bfactor field of pdb file\n");
- sprintf(str, "4D proj. of traj. on eigenv. %d, %d, %d and %d", eignr[outvec[0]] + 1,
- eignr[outvec[1]] + 1, eignr[outvec[2]] + 1, eignr[outvec[3]] + 1);
+ sprintf(str,
+ "4D proj. of traj. on eigenv. %d, %d, %d and %d",
+ eignr[outvec[0]] + 1,
+ eignr[outvec[1]] + 1,
+ eignr[outvec[2]] + 1,
+ eignr[outvec[3]] + 1);
}
else
{
- sprintf(str, "3D proj. of traj. on eigenv. %d, %d and %d", eignr[outvec[0]] + 1,
- eignr[outvec[1]] + 1, eignr[outvec[2]] + 1);
+ sprintf(str,
+ "3D proj. of traj. on eigenv. %d, %d and %d",
+ eignr[outvec[0]] + 1,
+ eignr[outvec[1]] + 1,
+ eignr[outvec[2]] + 1);
}
init_t_atoms(&atoms, nframes, FALSE);
snew(x, nframes);
fprintf(out, "TER\n");
j = 0;
}
- gmx_fprintf_pdb_atomline(out, epdbATOM, i + 1, "C", ' ', "PRJ", ' ', j + 1, ' ',
- 10 * x[i][XX], 10 * x[i][YY], 10 * x[i][ZZ], 1.0,
- 10 * b[i], "");
+ gmx_fprintf_pdb_atomline(out,
+ epdbATOM,
+ i + 1,
+ "C",
+ ' ',
+ "PRJ",
+ ' ',
+ j + 1,
+ ' ',
+ 10 * x[i][XX],
+ 10 * x[i][YY],
+ 10 * x[i][ZZ],
+ 1.0,
+ 10 * b[i],
+ "");
if (j > 0)
{
fprintf(out, "CONECT%5d%5d\n", i, i + 1);
}
pmin[v] = inprod[v][imin];
pmax[v] = inprod[v][imax];
- fprintf(stderr, "%7d %10.6f %10d %10.6f %10d\n", eignr[outvec[v]] + 1, pmin[v],
- imin, pmax[v], imax);
+ fprintf(stderr, "%7d %10.6f %10d %10.6f %10d\n", eignr[outvec[v]] + 1, pmin[v], imin, pmax[v], imax);
}
}
else
}
}
}
- write_xvgr_graphs(outfile, noutvec, 4, "Eigenvector components",
- "black: total, red: x, green: y, blue: z", "Atom number", ylabel, natoms, x,
- nullptr, y, 1, FALSE, FALSE, oenv);
+ write_xvgr_graphs(outfile,
+ noutvec,
+ 4,
+ "Eigenvector components",
+ "black: total, red: x, green: y, blue: z",
+ "Atom number",
+ ylabel,
+ natoms,
+ x,
+ nullptr,
+ y,
+ 1,
+ FALSE,
+ FALSE,
+ oenv);
fprintf(stderr, "\n");
}
v = outvec[g];
if (eignr[v] >= neig)
{
- gmx_fatal(FARGS, "Selected vector %d is larger than the number of eigenvalues (%d)",
- eignr[v] + 1, neig);
+ gmx_fatal(FARGS,
+ "Selected vector %d is larger than the number of eigenvalues (%d)",
+ eignr[v] + 1,
+ neig);
}
sprintf(str, "vec %d", eignr[v] + 1);
ylabel[g] = gmx_strdup(str);
y[g][i] = std::sqrt(eigval[eignr[v]] * norm2(eigvec[v][i])) / sqrtm[i];
}
}
- write_xvgr_graphs(outfile, noutvec, 1, "RMS fluctuation (nm) ", nullptr, "Atom number", ylabel,
- natoms, x, y, nullptr, 1, TRUE, FALSE, oenv);
+ write_xvgr_graphs(
+ outfile, noutvec, 1, "RMS fluctuation (nm) ", nullptr, "Atom number", ylabel, natoms, x, y, nullptr, 1, TRUE, FALSE, oenv);
fprintf(stderr, "\n");
}
};
#define NFILE asize(fnm)
- if (!parse_common_args(&argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW, NFILE, fnm,
- NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
+ if (!parse_common_args(
+ &argc, argv, PCA_CAN_TIME | PCA_TIME_UNIT | PCA_CAN_VIEW, NFILE, fnm, NPA, pa, asize(desc), desc, 0, nullptr, &oenv))
{
return 0;
}
bCompare = (Vec2File != nullptr) || (Eig2File != nullptr);
bPDB3D = fn2ftp(ThreeDPlotFile) == efPDB;
- read_eigenvectors(VecFile, &natoms, &bFit1, &xref1, &bDMR1, &xav1, &bDMA1, &nvec1, &eignr1,
- &eigvec1, &eigval1);
+ read_eigenvectors(
+ VecFile, &natoms, &bFit1, &xref1, &bDMR1, &xav1, &bDMA1, &nvec1, &eignr1, &eigvec1, &eigval1);
neig1 = std::min(nvec1, DIM * natoms);
if (nvec1 != DIM * natoms)
{
fprintf(stderr,
"Warning: number of eigenvectors %d does not match three times\n"
"the number of atoms %d in %s. Using %d eigenvectors.\n\n",
- nvec1, natoms, VecFile, neig1);
+ nvec1,
+ natoms,
+ VecFile,
+ neig1);
}
/* Overwrite eigenvalues from separate files if the user provides them */
{
fprintf(stderr,
"Warning: number of eigenvalues in xvg file (%d) does not mtch trr file (%d)\n",
- neig1, natoms);
+ neig1,
+ natoms);
}
neig1 = neig_tmp;
srenew(eigval1, neig1);
eigval1[j] = xvgdata[1][j];
if (debug && (eigval1[j] != tmp))
{
- fprintf(debug, "Replacing eigenvalue %d. From trr: %10g, from xvg: %10g\n", j, tmp,
- eigval1[j]);
+ fprintf(debug, "Replacing eigenvalue %d. From trr: %10g, from xvg: %10g\n", j, tmp, eigval1[j]);
}
}
for (j = 0; j < i; j++)
gmx_fatal(FARGS, "Need a second eigenvector file to do this analysis.");
}
int natoms2;
- read_eigenvectors(Vec2File, &natoms2, &bFit2, &xref2, &bDMR2, &xav2, &bDMA2, &nvec2,
- &eignr2, &eigvec2, &eigval2);
+ read_eigenvectors(
+ Vec2File, &natoms2, &bFit2, &xref2, &bDMR2, &xav2, &bDMA2, &nvec2, &eignr2, &eigvec2, &eigval2);
neig2 = std::min(nvec2, DIM * natoms2);
if (neig2 != neig1)
gmx_fatal(FARGS,
"you selected a group with %d elements instead of %d, your selection "
"does not fit the reference structure in the eigenvector file.",
- nfit, natoms);
+ nfit,
+ natoms);
}
for (i = 0; (i < nfit); i++)
{
if (bProj)
{
- project(bTraj ? opt2fn("-f", NFILE, fnm) : nullptr, bTop ? &top : nullptr, pbcType, topbox,
- ProjOnVecFile, TwoDPlotFile, ThreeDPlotFile, FilterFile, skip, ExtremeFile,
- bFirstLastSet, max, nextr, atoms, natoms, index, bFit1, xrefp, nfit, ifit, w_rls,
- sqrtm, xav1, eignr1, eigvec1, noutvec, outvec, bSplit, oenv);
+ project(bTraj ? opt2fn("-f", NFILE, fnm) : nullptr,
+ bTop ? &top : nullptr,
+ pbcType,
+ topbox,
+ ProjOnVecFile,
+ TwoDPlotFile,
+ ThreeDPlotFile,
+ FilterFile,
+ skip,
+ ExtremeFile,
+ bFirstLastSet,
+ max,
+ nextr,
+ atoms,
+ natoms,
+ index,
+ bFit1,
+ xrefp,
+ nfit,
+ ifit,
+ w_rls,
+ sqrtm,
+ xav1,
+ eignr1,
+ eigvec1,
+ noutvec,
+ outvec,
+ bSplit,
+ oenv);
}
if (OverlapFile)
if (InpMatFile)
{
- inprod_matrix(InpMatFile, natoms, nvec1, eignr1, eigvec1, nvec2, eignr2, eigvec2,
- bFirstLastSet, noutvec, outvec);
+ inprod_matrix(
+ InpMatFile, natoms, nvec1, eignr1, eigvec1, nvec2, eignr2, eigvec2, bFirstLastSet, noutvec, outvec);
}
if (bCompare)