home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 18
/
aminetcdnumber181997.iso
/
Aminet
/
dev
/
c
/
math_classes.lha
/
math_classes
/
matrix
/
libmatrix
/
mat_transpose.cc
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1996-09-18
|
263 b
|
18 lines
#include "Matrix.h"
Matrix transpose(const Matrix& m)
{
Matrix a(m.cols(),m.rows());
unsigned int i,j;
if(m.cols() ==0 || m.rows()==0)error("bad size");
for (i=1;i<=m.rows();i++)
{
for(j=1;j<=m.cols();j++)
{
a(j,i)=m(i,j);
}
}
return a;
}