-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtraj2com.C
More file actions
54 lines (37 loc) · 1.15 KB
/
Copy pathtraj2com.C
File metadata and controls
54 lines (37 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* Program written by Giovanni Pinamonti
PhD student at
Scuola Internazionale Superiori di Studi Avanzati, Trieste, Italy
begin decembetr 10th 2013 */
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <malloc.h>
#include <string.h>
#include <iostream>
#include "Structure3d.h"
//#include "Matrix.h" //definition of the class CMatrix
//#include "PrincipalComp.h"
using namespace std;
int main(int argc, char **argv){//PROGRAM MAIN
Structure3d structure(0);
char input_name[200], output_name[200];
sprintf(input_name,argv[1]);
sprintf(output_name,argv[2]);
FILE* input;
if ((input = fopen (input_name, "r")) == NULL) {
fprintf (stderr,"Could not open file %s.\n.Exiting.\n", input_name);
exit (1); }
ofstream output(output_name);
int Nsteps=0;
int error=structure.centersFromPDBFile(input);
while(error==0){
++Nsteps;
output<<"MODEL "<<Nsteps<<endl;
if(Nsteps%100==0)
cout<<"Step "<<Nsteps<<endl;//" dumping"<<endl;
structure.dumpPDBFile(output);
output<<"ENDMDL"<<endl;
error=structure.centersFromPDBFile(input);
}//end while
}//END MAIN