STK++ 0.9.13
STK_Typedefs.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::Sdk
27 * created on: 23 août 2012
28 * Author: iovleff, S..._Dot_I..._At_stkpp_Dot_org (see copyright for ...)
29 **/
30
34
35
36#ifndef STK_TYPEDEFS_H
37#define STK_TYPEDEFS_H
38
39#include <string>
40#include <type_traits>
41
42namespace STK
43{
49typedef char Char;
51#define _T(x) x
53#define stk_cout std::cout
55#define stk_cin std::cin
57#define stk_cerr std::cerr
59#define stk_log std::clog
60
67typedef std::basic_string<Char> String;
68
75typedef int Integer ;
76
77#ifdef IS_RTKPP_LIB
78// rtkore (the R port) requires Integer to be exactly the C++ int type:
79// the R NA value (NA_INTEGER), the Rmath functions and the Rcpp traits
80// all depend on it. Enforce this contract at compile time.
81static_assert( std::is_same<Integer, int>::value
82 , "STK++: Integer must be typedef'd to int when building rtkore (IS_RTKPP_LIB).");
83#endif
84
85#ifdef STKREALAREFLOAT
94typedef float Real;
95
96#else
104typedef double Real;
105
106#endif
107
108} // namespace STK
109
110#endif /* STK_TYPEDEFS_H */
char Char
STK fundamental type of a Char.
std::basic_string< Char > String
STK fundamental type of a String.
double Real
STK fundamental type of Real values.
int Integer
STK fundamental type of integer values.
The namespace STK is the main domain space of the Statistical ToolKit project.