New repo for repo.or.cz
[The-Artvertiser.git] / starter / math / mcvm.cpp
blob01aa13d4680e6e4fceb70dc48f5124db725bf1df
1 /*
2 Copyright 2005, 2006 Computer Vision Lab,
3 Ecole Polytechnique Federale de Lausanne (EPFL), Switzerland.
4 Modified by Damian Stewart <damian@frey.co.nz> 2009-2010;
5 modifications Copyright 2009, 2010 Damian Stewart <damian@frey.co.nz>.
7 Distributed under the terms of the GNU General Public License v3.
9 This file is part of The Artvertiser.
11 The Artvertiser is free software: you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation, either version 3 of the License, or
14 (at your option) any later version.
16 The Artvertiser is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with The Artvertiser. If not, see <http://www.gnu.org/licenses/>.
25 #include "mcvm.h"
27 void mcvmPrint(ostream & o, CvMat * A, char * matrix_name)
29 if (A->cols == 1)
31 if (matrix_name != 0)
32 o << matrix_name << " = [ ";
33 else
34 o << " [ ";
35 for(int i = 0; i < A->rows; i++)
36 o << cvmGet(A, i, 0) << "; ";
37 o << "]^t" << endl;
38 return;
41 if (matrix_name != 0)
42 o << matrix_name << ":" << endl;
43 for(int i = 0; i < A->rows; i++)
45 for(int j = 0; j < A->cols; j++)
46 o << cvmGet(A, i, j) << " ";
47 o << endl;