LINEAR++ library: AFF to LAPACK

◆ main()

int main ( int  iargc,
char *  argv[] 
)

Definition at line 83 of file matrixtest.cc.

References linear::op::dotNxM(), DUMP, MATRIXTEST_VERSION, and linear::op::transposeNxM().

84 {
85 
86  // define usage information
87  char usage_text[]=
88  {
90  "usage: matrixtest" "\n"
91  " or: matrixtest --help|-h" "\n"
92  };
93 
94  // define full help text
95  char help_text[]=
96  {
97  "\n"
98  };
99 
100  // define commandline options
101  using namespace tfxx::cmdline;
102  static Declare options[]=
103  {
104  // 0: print help
105  {"help",arg_no,"-"},
106  // 1: verbose mode
107  {"v",arg_no,"-"},
108  {NULL}
109  };
110 
111  // no arguments? print usage...
112  if (iargc<2)
113  {
114  cerr << usage_text << endl;
115  exit(0);
116  }
117 
118  // collect options from commandline
119  Commandline cmdline(iargc, argv, options);
120 
121  // help requested? print full help text...
122  if (cmdline.optset(0))
123  {
124  cerr << usage_text << endl;
125  cerr << help_text << endl;
126  exit(0);
127  }
128 
129  /*
130  // dummy operation: print option settings
131  for (int iopt=0; iopt<2; iopt++)
132  {
133  cout << "option: '" << options[iopt].opt_string << "'" << endl;
134  if (cmdline.optset(iopt)) { cout << " option was set"; }
135  else { cout << "option was not set"; }
136  cout << endl;
137  cout << " argument (string): '" << cmdline.string_arg(iopt) << "'" << endl;
138  cout << " argument (int): '" << cmdline.int_arg(iopt) << "'" << endl;
139  cout << " argument (long): '" << cmdline.long_arg(iopt) << "'" << endl;
140  cout << " argument (float): '" << cmdline.float_arg(iopt) << "'" << endl;
141  cout << " argument (double): '" << cmdline.double_arg(iopt) << "'" << endl;
142  cout << " argument (bool): '";
143  if (cmdline.bool_arg(iopt))
144  { cout << "true"; } else { cout << "false"; }
145  cout << "'" << endl;
146  }
147  while (cmdline.extra()) { cout << cmdline.next() << endl; }
148 
149  // dummy operation: print rest of command line
150  while (cmdline.extra()) { cout << cmdline.next() << endl; }
151  */
152  Tmatrix A(aff::Shaper(1,4)(1,3));
153  Tmatrix B(aff::Shaper(1,3)(1,5));
154  A=2;
155  A(1,3)=-5;
156  B=3;
157  B(1,5)=-11;
158  DUMP(A);
159  DUMP(B);
162  DUMP(linear::op::dotNxM(A,B));
163 }
linear::TDmatrix Tmatrix
Definition: lsqexample.cc:56
#define DUMP(M)
Definition: matrixtest.cc:79
TDmatrix transposeNxM(const TDmatrix::Tcoc &A)
calculate transpose of NxM matrix.
Definition: transpose.cc:44
TDmatrix dotNxM(const TDmatrix::Tcoc &A, const TDmatrix::Tcoc &B)
dot product for NxM matrices.
Definition: dot.cc:45
#define MATRIXTEST_VERSION
Definition: matrixtest.cc:34
Here is the call graph for this function: