source: tags/arb_5.0/PROBE_SET/ps_show_result.cxx

Last change on this file was 1213, checked in by foerster, 21 years ago

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1
2#include <stdio.h>
3#include <stdlib.h>
4
5#ifndef PS_DEFS_HXX
6#include "ps_defs.hxx"
7#endif
8#ifndef PS_FILEBUFFER_HXX
9#include "ps_filebuffer.hxx"
10#endif
11#ifndef PS_BITMAP_HXX
12#include "ps_bitmap.hxx"
13#endif
14
15//  ====================================================
16//  ====================================================
17
18int main( int argc,  char *argv[] ) {
19
20   // open probe-set-database
21    if (argc < 2) {
22        printf( "Missing argument\n Usage %s <file name>\n ", argv[0] );
23        exit( 1 );
24    }
25
26    const char *input_filename   = argv[1];
27    printf( "Opening result file '%s'..\n", input_filename );
28    PS_FileBuffer *file = new PS_FileBuffer( input_filename, PS_FileBuffer::READONLY );
29
30    long size;
31    SpeciesID id1,id2;
32    printf( "\nloading no matches : " );
33    file->get_long( size );
34    printf( "%li", size );
35    for (long i=0; i < size; ++i) {
36        if (i % 5 == 0) printf( "\n" );
37        file->get_int( id1 );
38        file->get_int( id2 );
39        printf( "%5i %-5i   ", id1, id2 );
40    }
41    printf( "\n\nloading one matches : " );
42    file->get_long( size );
43    printf( "%li\n", size );
44    long path_length;
45    SpeciesID path_id;
46    for (long i=0; i < size; ++i) {
47        file->get_int( id1 );
48        file->get_int( id2 );
49        file->get_long( path_length );
50        printf( "%5i %-5i path(%6li): ", id1, id2, path_length );
51        while (path_length-- > 0) {
52            file->get_int( path_id );
53            printf( "%i ", path_id );
54        }
55        printf( "\n" );
56    }
57    printf( "\nloading preset bitmap\n" );
58    PS_BitMap_Counted *map = new PS_BitMap_Counted( file );
59    map->print();
60    delete map;
61
62    return 0;
63}
Note: See TracBrowser for help on using the repository browser.