|
STK++ 0.9.13
|
In this subproject we define the fundamental types. More...

Namespaces | |
| namespace | STK::Chrono |
| The namespace Chrono is an utility namespace for computing elapsed wall-clock time during the execution of a program. | |
Classes | |
| class | STK::Proxy< Type > |
| The Proxy class allow to surdefine operators and methods for every kind of class without using dynamic_cast. More... | |
| class | STK::Proxy< String > |
| Specialization of the Proxy class for String. More... | |
Enumerations | |
| enum | STK::Binary { STK::zero_ =0 , STK::one_ =1 , STK::binaryNA_ =INT_MIN } |
| STK fundamental type of a binary. More... | |
| enum | STK::Sign { STK::negative_ =-1 , STK::positive_ = 1 , STK::signNA_ = INT_MIN } |
| STK fundamental type of a sign. More... | |
Functions | |
| Binary | STK::stringToBinary (String const &str) |
| Convert a String to a Binary. | |
| Binary | STK::stringToBinary (String const &str, std::map< String, Binary > const &mapping) |
| Convert a String to a Binary using a map. | |
| String | STK::binaryToString (Binary const &value, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| Convert a Binary to a String. | |
| String | STK::binaryToString (Binary const &value, std::map< Binary, String > const &mapping) |
| Convert a Binary to a String. | |
| template<> | |
| Binary | STK::stringToType< Binary > (String const &str) |
| specialization for Binary | |
| template<> | |
| String | STK::typeToString< Binary > (Binary const &t, std::ios_base &(*f)(std::ios_base &)) |
| specialization for Binary | |
| void | STK::Chrono::start () |
| Start the Chrono. | |
| Real | STK::Chrono::elapsed () |
Compute the elapsed time (in second) since last start() call. | |
| Integer | STK::stringToInt (String const &str) |
| Convert a String to an Integer. | |
| Integer | STK::stringToInt (String const &str, std::map< String, Integer > const &mapping) |
| Convert a String to an Integer using a map. | |
| String | STK::intToString (Integer const &value, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| Convert an Integer to a String. | |
| String | STK::intToString (Integer const &value, std::map< Integer, String > const &mapping) |
| Convert an Integer to a String. | |
| template<> | |
| Integer | STK::stringToType< Integer > (String const &s) |
| specialization for Integer | |
| template<> | |
| String | STK::typeToString< Integer > (Integer const &t, std::ios_base &(*f)(std::ios_base &)) |
| specialization for Integer | |
| template<typename Type> | |
| Type | STK::sign (Type const &x, Type const &y=Type(1)) |
| template sign value sign(x) * y: Type should be an arithmetic type. | |
| bool | STK::isOdd (int const &x) |
| is x a odd number ? | |
| bool | STK::isEven (int const &x) |
| is x an even number ? | |
| Real | STK::norm (Real const &x, Real const &y) |
| Computation of sqrt(x^2 + y^2) without underflow or overflow. | |
| template<int Size_> | |
| ostream & | STK::operator<< (ostream &os, TRange< Size_ > const &I) |
| Write a TRange in the form first:last (MATLAB-like form) in an output stream. | |
| Range | STK::stringToRange (String const &str) |
| Convert a String to a Range. | |
| template<int Size_> | |
| TRange< Size_ > | STK::stringToRange (String const &str, std::map< String, TRange< Size_ > > const &mapping) |
| Convert a String to a Range using a map. | |
| template<int Size_> | |
| String | STK::rangeToString (TRange< Size_ > const &value, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| Convert an Range to a String. | |
| template<int Size_> | |
| String | STK::rangeToString (TRange< Size_ > const &value, std::map< TRange< Size_ >, String > const &mapping) |
| Convert a Range to a String. | |
| template<> | |
| String | STK::typeToString< Range > (Range const &t, std::ios_base &(*f)(std::ios_base &)) |
| Specialization for Range. | |
| Real | STK::stringToReal (String const &str) |
| Convert a String to a Real. | |
| Real | STK::stringToReal (String const &str, std::map< String, Real > const &mapping) |
| Convert a String to a Real using a map. | |
| String | STK::realToString (Real const &value, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| Convert a Real to a String. | |
| String | STK::realToString (Real const &type, std::map< Real, String > const &mapping) |
| Convert a real to a String. | |
| template<> | |
| Real | STK::stringToType< Real > (String const &str) |
| specialization for Real | |
| template<> | |
| String | STK::typeToString< Real > (Real const &value, std::ios_base &(*f)(std::ios_base &)) |
| specialization for Real | |
| Sign | STK::stringToSign (String const &str) |
| Convert a String to a Sign. | |
| Sign | STK::stringToSign (String const &str, std::map< String, Sign > const &mapping) |
| Convert a String to a Sign using a map. | |
| String | STK::signToString (Sign const &value, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| Convert a Sign to a String. | |
| String | STK::signToString (Sign const &value, std::map< Sign, String > mapping) |
| Convert a Sign to a String. | |
| template<> | |
| Sign | STK::stringToType< Sign > (String const &str) |
| specialization for Sign | |
| template<> | |
| String | STK::typeToString< Sign > (Sign const &t, std::ios_base &(*f)(std::ios_base &)) |
| specialization for Sign | |
| void | STK::setStringNa (String const &na) |
| Set a new value to the na String representation and modify stringNaSize accordingly. | |
| String const & | STK::toUpperString (String &s) |
| convert the characters of the String to upper case | |
| String | STK::toUpperString (String const &s) |
| convert the characters of the String to upper case | |
| String | STK::removeWhiteSpaces (String const &s) |
| convert the characters of the String to upper case | |
| template<class Type> | |
| bool | STK::stringToType (Type &t, String const &s, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| convert a String to Type | |
| template<class Type> | |
| Type | STK::stringToType (String const &s) |
| convert a String to Type without error check | |
| template<class Type> | |
| String | STK::typeToString (Type const &t, std::ios_base &(*f)(std::ios_base &)=std::dec) |
| convert a Type to String | |
Variables | |
| String | STK::stringNa = String(_T(".")) |
| Representation of a Not Available value. | |
| int | STK::stringNaSize = 1 |
| Size (in number of Char) of a Not Available value. | |
In this subproject we define the fundamental types.
The Base subproject is composed of
| enum STK::Binary |
| enum STK::Sign |
|
inline |
| value | the Binary we want to convert |
| f | format, by default write every number in decimal |
Definition at line 160 of file STK_Binary.h.
References STK::Arithmetic< Type >::isNA(), and stringNa.
Referenced by typeToString< Binary >().
|
inline |
Definition at line 174 of file STK_Binary.h.
References STK::Arithmetic< Type >::NA().
|
inline |
Compute the elapsed time (in second) since last start() call.
Definition at line 63 of file STK_Chrono.h.
|
inline |
Convert an Integer to a String.
| value | the Integer we want to convert |
| f | format, by default write every number in decimal |
Definition at line 175 of file STK_Integer.h.
References STK::Arithmetic< Type >::isNA(), and stringNa.
Referenced by typeToString< Integer >().
|
inline |
is x an even number ?
This method return true if the rest of the euclidian division of x by 2 is 1.
| x | the value to test |
true if x is even, false otherwise Definition at line 77 of file STK_Misc.h.
Referenced by STK::Funct::gamma_raw().
is x a odd number ?
This method return true if the rest of the euclidian division of x by 2 is 0.
| x | the value to test |
true if x is odd, false otherwise Definition at line 66 of file STK_Misc.h.
Computation of sqrt(x^2 + y^2) without underflow or overflow.
This is std::hypot(x, y).
| x | first value |
| y | second value |

Definition at line 88 of file STK_Misc.h.
Referenced by bidiag(), STK::Svd< Array >::diag(), STK::SymEigen< SquareArray >::diagonalize(), gramSchmidt(), leftEliminate(), and STK::Svd< Array >::rightEliminate().
Write a TRange in the form first:last (MATLAB-like form) in an output stream.
| os | output stream |
| I | Range to write |
Definition at line 515 of file STK_Range.h.
References _T, STK::RangeBase< Derived >::begin(), isNA(), STK::TRange< Size_ >::lastIdx(), and stringNa.
| String STK::rangeToString | ( | TRange< Size_ > const & | value, |
| std::ios_base &(* | f )(std::ios_base &) = std::dec ) |
| value | the Range we want to convert |
| f | format, by default write every number in decimal |
Definition at line 552 of file STK_Range.h.
References isNA(), and stringNa.
Referenced by typeToString< Range >().
| String STK::rangeToString | ( | TRange< Size_ > const & | value, |
| std::map< TRange< Size_ >, String > const & | mapping ) |
Definition at line 567 of file STK_Range.h.
References stringNa.
Convert a real to a String.
Definition at line 195 of file STK_Real.h.
References stringNa.
|
inline |
| value | the Real we want to convert |
| f | format, by default write every number in decimal |
Definition at line 181 of file STK_Real.h.
References isNA(), and stringNa.
Referenced by typeToString< Real >().
convert the characters of the String to upper case
| s | The String to convert |
Definition at line 165 of file STK_String.h.
Referenced by STK::Law::stringToUnivariateDistribution().
|
inline |
Set a new value to the na String representation and modify stringNaSize accordingly.
Definition at line 109 of file STK_String.h.
References stringNa, and stringNaSize.
|
inline |
template sign value sign(x) * y: Type should be an arithmetic type.
This is the LAPACK-style sign function: the result has the magnitude of y and the sign of x, like std::copysign(y, x).
| x | the sign value |
| y | the signed value to return |
Definition at line 55 of file STK_Misc.h.
Referenced by compGivens(), STK::Svd< Array >::diag(), STK::SymEigen< SquareArray >::diagonalize(), STK::ISvd< Svd >::finalize(), STK::ISymEigen< Derived >::finalizeStep(), and house().
|
inline |
| value | the Sign we want to convert |
| f | format, by default write every number in decimal |
Definition at line 169 of file STK_Sign.h.
References STK::Arithmetic< Type >::isNA(), and stringNa.
Referenced by typeToString< Sign >().
|
inline |
Start the Chrono.
Definition at line 58 of file STK_Chrono.h.
| str | the String we want to convert |
str. If the string does not match any known name, the binaryNA_ value is returned. Definition at line 134 of file STK_Binary.h.
References _T, binaryNA_, one_, toUpperString(), and zero_.
Referenced by stringToType< Binary >().
|
inline |
Convert a String to a Binary using a map.
str. If the string does not match any known name, the binaryNA_ type is returned. Definition at line 148 of file STK_Binary.h.
References binaryNA_.
Convert a String to an Integer.
| str | the String we want to convert |
str. If the string does not match any known name, the NA value is returned. Definition at line 149 of file STK_Integer.h.
Referenced by stringToType< Integer >().
Convert a String to an Integer using a map.
| str | the String we want to convert |
| mapping | the mapping between the string and the Int |
type. if the string does not match any known name, the unknown_ type is returned. Definition at line 163 of file STK_Integer.h.
References STK::Arithmetic< Type >::NA().
| str | the String we want to convert |
str. if the string does not match any known name, the NA value is returned. Definition at line 528 of file STK_Range.h.
References stringToType().
| TRange< Size_ > STK::stringToRange | ( | String const & | str, |
| std::map< String, TRange< Size_ > > const & | mapping ) |
| str | the String we want to convert |
Definition at line 154 of file STK_Real.h.
Referenced by stringToType< Real >().
Convert a String to a Real using a map.
| str | the String we want to convert |
| mapping | the mapping between the string and the real |
str. If the string does not match any known name, the NA value is returned. Definition at line 169 of file STK_Real.h.
References STK::Arithmetic< Type >::NA().
| str | the String we want to convert |
type. if the string does not match any known name, the signNA_ value is returned. Definition at line 142 of file STK_Sign.h.
References _T, negative_, positive_, signNA_, and toUpperString().
Referenced by stringToType< Sign >().
Convert a String to a Sign using a map.
type. if the string does not match any known name, the signNA_ value is returned. Definition at line 156 of file STK_Sign.h.
References signNA_.
| Type STK::stringToType | ( | String const & | s | ) |
convert a String to Type without error check
This method return the String s converted into a correct Type t without formatting. http://www.codeguru.com/forum/showpost.php?p=678440&postcount=1 http://c.developpez.com/faq/cpp/?page=strings#STRINGS_is_type
Type. | s | the String to convert |
Definition at line 216 of file STK_String.h.
| bool STK::stringToType | ( | Type & | t, |
| String const & | s, | ||
| std::ios_base &(* | f )(std::ios_base &) = std::dec ) |
convert a String to Type
This method return true if the String s could be converted into a correct Type t. http://www.codeguru.com/forum/showpost.php?p=678440&postcount=1 http://c.developpez.com/faq/cpp/?page=strings#STRINGS_is_type
Proxy class in order to return a NA value if the conversion fail.true if the conversion succeed, false otherwise Definition at line 195 of file STK_String.h.
Referenced by STK::DataHandler::getData(), STK::Variable< Type_ >::importFromString(), STK::TRange< UnknownSize >::operator>>, STK::TReadWriteCsv< Type >::read(), STK::DManager::readList(), STK::hidden::CsvToArrayImpl< String, Array2D< OtherType > >::run(), STK::Option::setValue(), and stringToRange().
|
inline |
specialization for Binary
| str | the String to convert |
Definition at line 186 of file STK_Binary.h.
References stringToBinary().
|
inline |
specialization for Integer
| s | the String to convert |
Definition at line 201 of file STK_Integer.h.
References stringToInt().
|
inline |
specialization for Real
| str | the String to convert |
Definition at line 208 of file STK_Real.h.
References stringToReal().
|
inline |
specialization for Sign
| str | the String to convert |
Definition at line 192 of file STK_Sign.h.
References stringToSign().
convert the characters of the String to upper case
| s | The String to convert |
Definition at line 134 of file STK_String.h.
Referenced by STK::DManager::checkStringToBoolean(), STK::IPage::findKeyword(), STK::IPage::IPage(), STK::Option::Option(), STK::Option::Option(), STK::IPage::option(), STK::IPage::option(), STK::ReadWritePages::p_page(), STK::ReadWritePages::p_page(), STK::IPage::processLine(), STK::Clust::stringToAlgo(), stringToBinary(), STK::DManager::StringToBoolean(), STK::Clust::stringToCriterion(), STK::Clust::stringToInit(), STK::Kernel::stringToKernelType(), STK::Basis::stringToKnotsPosition(), STK::Regress::stringToKnotsPosition(), STK::Clust::stringToLearnAlgo(), STK::Clust::stringToMixture(), STK::Clust::stringToMixture(), STK::Clust::stringToPredictAlgo(), stringToSign(), STK::Basis::stringToTypeBasisFunction(), STK::Model::stringToTypeCriterion(), STK::DManager::stringToTypeDataFile(), STK::Reduct::stringToTypeGraph(), STK::Import::stringToTypeImport(), STK::Reduct::stringToTypeReduction(), STK::Regress::stringToTypeRegression(), and STK::Law::stringToUnivariateDistribution().
convert the characters of the String to upper case
| s | The String to convert |
Definition at line 149 of file STK_String.h.
| String STK::typeToString | ( | Type const & | t, |
| std::ios_base &(* | f )(std::ios_base &) = std::dec ) |
convert a Type to String
This method return the Type t into a String s.
| t | The value to convert to String |
| f | flag, by default write every number in decimal |
Definition at line 235 of file STK_String.h.
References STK::Arithmetic< Type >::isNA(), and stringNa.
Referenced by STK::ExportToCsv::append(), STK::ExportToCsv::append(), STK::ExportToCsv::append(), STK::ExportToCsv::append(), STK::ExportToCsv::appendData(), STK::IVariable::eltAsString(), STK::ExportToCsv::ExportToCsv(), STK::ExportToCsv::ExportToCsv(), STK::ExportToCsv::ExportToCsv(), STK::IVariable::giveName(), STK::Variable< Type_ >::operator>>(), STK::DataHandler::readDataFromArray(), STK::DataHandler::readDataFromArray2D(), STK::ExportToCsv::setColumnsNames(), STK::IVariable::setName(), STK::ExportToCsv::writeByCol(), and STK::ExportToCsv::writeByRow().
|
inline |
specialization for Binary
Definition at line 195 of file STK_Binary.h.
References binaryToString().
|
inline |
specialization for Integer
| t | The Int to convert to String |
| f | format, by default write every number in decimal |
Definition at line 210 of file STK_Integer.h.
References intToString().
|
inline |
Specialization for Range.
Definition at line 580 of file STK_Range.h.
References rangeToString().
|
inline |
specialization for Real
Definition at line 217 of file STK_Real.h.
References realToString().
|
inline |
specialization for Sign
Definition at line 201 of file STK_Sign.h.
References signToString().
Representation of a Not Available value.
By default we represent a Not Available value of any type as a "." (like in (SAS(R))) for the end-user. This value can be overloaded at runtime.
stringNaSize have to be modified accordingly. It is safer to use the setStringNa function. Definition at line 50 of file STK_String.cpp.
Referenced by binaryToString(), STK::Variable< Type_ >::importFromString(), intToString(), intToString(), operator<<(), operator<<(), STK::Proxy< Type >::operator<<, STK::Proxy< String >::operator<<, STK::Proxy< Type >::operator>>, STK::Proxy< String >::operator>>, STK::Variable< String >::pushBackNAValues(), rangeToString(), rangeToString(), STK::TReadWriteCsv< Type >::read(), STK::DataHandler::readDataFromArray(), STK::DataHandler::readDataFromArray2D(), STK::DataHandler::readDataFromCsvFile(), realToString(), realToString(), STK::Option::setDefaultValue(), setStringNa(), signToString(), typeToString(), STK::Variable< String >::Variable(), STK::Variable< String >::Variable(), STK::Variable< String >::Variable(), STK::Variable< String >::Variable(), and STK::TReadWriteCsv< Type >::writeSelection().
| int STK::stringNaSize = 1 |
Size (in number of Char) of a Not Available value.
We represent a Not Available value of any type as a "." (like in (SAS(R))) for the end-user.
Definition at line 57 of file STK_String.cpp.
Referenced by STK::Proxy< Type >::operator>>, and setStringNa().