Merge branch 'master' into dev_train_binocular_ui
[The-Artvertiser.git] / starter / math / mcvm.cpp
blob7ef603228998b4088fb816cc17ac30a98fe806d1
1 /*
2 Copyright 2005, 2006 Computer Vision Lab,
3 Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
4 All rights reserved.
6 This file is part of BazAR.
8 BazAR is free software; you can redistribute it and/or modify it under the
9 terms of the GNU General Public License as published by the Free Software
10 Foundation; either version 2 of the License, or (at your option) any later
11 version.
13 BazAR is distributed in the hope that it will be useful, but WITHOUT ANY
14 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
15 PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License along with
18 BazAR; if not, write to the Free Software Foundation, Inc., 51 Franklin
19 Street, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "mcvm.h"
23 void mcvmPrint(ostream & o, CvMat * A, char * matrix_name)
25 if (A->cols == 1)
27 if (matrix_name != 0)
28 o << matrix_name << " = [ ";
29 else
30 o << " [ ";
31 for(int i = 0; i < A->rows; i++)
32 o << cvmGet(A, i, 0) << "; ";
33 o << "]^t" << endl;
34 return;
37 if (matrix_name != 0)
38 o << matrix_name << ":" << endl;
39 for(int i = 0; i < A->rows; i++)
41 for(int j = 0; j < A->cols; j++)
42 o << cvmGet(A, i, j) << " ";
43 o << endl;