File: app_transposematrix.cpp

package info (click to toggle)
gfan 0.3dfsg-1
  • links: PTS
  • area: main
  • in suites: lenny, squeeze
  • size: 2,012 kB
  • ctags: 1,935
  • sloc: cpp: 17,728; makefile: 251
file content (37 lines) | stat: -rw-r--r-- 824 bytes parent folder | download | duplicates (2)
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
#include "vektor.h"
#include "printer.h"
#include "parser.h"
#include "gfanapplication.h"
#include "lp.h"

class TransposeMatrixApplication : public GFanApplication
{
public:
  bool includeInDefaultInstallation() // Not included since the program has no relation to the main programs
  {
    return false;
  }
  TransposeMatrixApplication()
  {
    registerOptions();
  }
  char *name()
  {
    return "_transposematrix";
  }
  int main()
  {
    lpSetSolver("cddgmp");
    FileParser P(Stdin);
    IntegerVectorList v=P.parseIntegerVectorList();
    fprintf(Stderr,"Rank:%i\n",rankOfMatrix(v));
    AsciiPrinter(Stdout).printVectorList(transposeIntegerVectorList(v));
    return 0;
  }
  const char *helpText()
  {
    return "Takes a matrix and transposes it.\n";
  }
};

static TransposeMatrixApplication theApplication;