STK++ 0.9.13
STK_Display.h
Go to the documentation of this file.
1/*--------------------------------------------------------------------*/
2/* Copyright (C) 2004-2016 Serge Iovleff, Université Lille 1, Inria
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU Lesser General Public License as
6 published by the Free Software Foundation; either version 2 of the
7 License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU Lesser General Public License for more details.
13
14 You should have received a copy of the GNU Lesser General Public
15 License along with this program; if not, write to the
16 Free Software Foundation, Inc.,
17 59 Temple Place,
18 Suite 330,
19 Boston, MA 02111-1307
20 USA
21
22 Contact : S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
23*/
24
25/*
26 * Project: stkpp::Arrays
27 * Purpose: Display in an output stream the 2D arrays.
28 * Author: Serge Iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 *
30 **/
31
36#ifndef STK_DISPLAY_H
37#define STK_DISPLAY_H
38
40
41namespace STK
42{
43
51template<class Array>
53{
54 // Export to csv the Array
56 // get the csv
57 ReadWriteCsv* pData = exportcsv.p_readWriteCsv();
58 // set delimiters to blank
59 pData->setDelimiters(_T(" "));
60 pData->setWithNames(false);
61 // write the csv in os
62 pData->write(os);
63 // return ostream
64 return os;
65}
66
74template<class Array>
76{
77 // Export by row to csv the Array
78 ExportToCsv exportcsv(V, false);
79 // get the csv
80 ReadWriteCsv* pData = exportcsv.p_readWriteCsv();
81 // set delimiters to blank
82 pData->setDelimiters(_T(" "));
83 pData->setWithNames(false);
84 // write the csv in os
85 pData->write(os);
86 // return ostream
87 return os;
88}
89
90
96template<class Array>
98{ return out2D<Array>(s,V);}
99
105template<class Type>
107{ return out1D(s,V);}
108
109} // namespace STK
110
111#endif // STK_DISPLAY_H
In this file we define the class ExportToCsv.
#define _T(x)
Let x unmodified.
Export data to a Csv.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
ostream & out2D(ostream &os, ITContainer< Array > const &V)
Method for displaying any two dimensional Array or Expression.
Definition STK_Display.h:52
ostream & out1D(ostream &os, ITContainer1D< Array > const &V)
Method for displaying any one dimensional Array.
Definition STK_Display.h:75
ostream & operator<<(ostream &s, const CAllocator< Type, SizeRows_, SizeCols_, Orient_ > &V)
output stream for CAllocator.
Definition STK_CArray.h:221
std::basic_ostream< Char > ostream
ostream for Char
Definition STK_Stream.h:57
The namespace STK is the main domain space of the Statistical ToolKit project.