LINEAR++ library: AFF to LAPACK
transpose.cc
Go to the documentation of this file.
1 
34 #define LINEAR_TRANSPOSE_CC_VERSION \
35  "LINEAR_TRANSPOSE_CC V1.0 "
36 
37 #include <linearxx/operators.h>
38 #include <aff/shaper.h>
39 
40 namespace linear {
41 
42  namespace op {
43 
44  TDmatrix transposeNxM(const TDmatrix::Tcoc& A)
45  {
46  const int dim1=0;
47  const int dim2=1;
48  checkNxM(A);
49  TDmatrix C(aff::Shaper(A.f(dim2),A.l(dim2))(A.f(dim1),A.l(dim1)));
50  for (int i=C.f(dim1); i<= C.l(dim1); ++i)
51  {
52  for (int j=C.f(dim2); j<= C.l(dim2); ++j)
53  {
54  C(i,j)=A(j,i);
55  }
56  }
57  return(C);
58  }
59 
60  } // namespace op
61 
62 } // namespace linear
63 
64 /* ----- END OF transpose.cc ----- */
aff::Array< double > TDmatrix
Definition: matrix.h:46
TDmatrix transposeNxM(const TDmatrix::Tcoc &A)
calculate transpose of NxM matrix.
Definition: transpose.cc:44
void checkNxM(const TDmatrix::Tcoc &A)
check expected libaff array shape for NxM matrix.
Definition: checknxn.cc:44
matrix and vector operators (prototypes)
Modules of liblinearxx.a.
Definition: error.cc:43