STK++ 0.9.13
Software Development Kit.

The Sdk project propose a set of high level interfaces, template for meta-programming and macros that are used throughout the STK++ projects. More...

Collaboration diagram for Software Development Kit.:

Modules

 Arithmetic properties.
 These classes extend the numeric_limits C++ struct.
 
 Runtime Type Identification.
 These classes allow to handle the Runtime type identification (RTTI) problem and are useful when working with heterogeneous data.
 
 I/O stream declarations
 Nearly all of the I/O classes are parameterized on the type of characters they read and write (The major exception is ios_base at the top of the hierarchy).
 

Namespaces

namespace  STK::Base
 the namespace Base contain all the internal stuff needed by the STK++ fundamental types.
 

Classes

class  STK::Exception
 Sdk class for all library Exceptions. More...
 
class  STK::logic_error
 Logic errors represent problems in the internal logic of a program; in theory, these are preventable, and even detectable before the program runs (e.g., violations of class invariants). More...
 
class  STK::domain_error
 Thrown by the library, or by you, to report domain errors (domain in the mathematical sense). More...
 
class  STK::invalid_argument
 Thrown to report invalid arguments to functions. More...
 
class  STK::length_error
 Thrown when an object is constructed that would exceed its maximum permitted size (e.g., a basic_String instance). More...
 
class  STK::out_of_range
 This represents an argument whose value is not within the expected range (e.g., boundary checks in basic_String). More...
 
class  STK::runtime_error
 Runtime errors represent problems outside the scope of a program; they cannot be easily predicted and can generally only be caught as the program executes. More...
 
class  STK::range_error
 Thrown to indicate range errors in internal computations. More...
 
class  STK::IRecursiveTemplate< Derived >
 Interface base class for all classes implementing the curious recursive template paradigm. More...
 
class  STK::IRunnerBase
 Abstract base class for all classes having a. More...
 
class  STK::IRunnerWithData< Array >
 Abstract class for all running class based on a data set. More...
 
class  STK::IRunnerUnsupervised< Array, Weights_ >
 Abstract class for all classes making unsupervised learning. More...
 
class  STK::IRunnerSupervised< YArray_, XArray_, Weights_ >
 Abstract class for all classes making supervised learning. More...
 

Macros

#define STKERROR_NO_ARG2(Where, Error)
 generate an Error message with no arguments.
 
#define STKERROR_1ARG2(Where, Arg, Error)
 generate an Error message with one argument.
 
#define STKERROR_2ARG2(Where, Arg1, Arg2, Error)
 generate an Error message with no argument.
 
#define STKERROR_3ARG2(Where, Arg1, Arg2, Arg3, Error)
 generate an Error message with three arguments.
 
#define STKOUT_OF_RANGE_1ARG2(Where, Arg, Error)    throw STK::out_of_range(STKERROR_1ARG2(Where, Arg, Error))
 throw an STK::out_of_range exception with one arguments.
 
#define STKOUT_OF_RANGE_2ARG2(Where, Arg1, Arg2, Error)    throw STK::out_of_range(STKERROR_2ARG2(Where, Arg1, Arg2, Error))
 throw an STK::out_of_range exception with two arguments.
 
#define STKOUT_OF_RANGE_3ARG2(Where, Arg1, Arg2, Arg3, Error)    throw STK::out_of_range(STKERROR_3ARG2(Where, Arg1, Arg2, Arg3, Error))
 throw an STK::out_of_range exception with three arguments.
 
#define STKRUNTIME_ERROR_2ARG2(Where, Arg1, Arg2, Error)    throw STK::runtime_error(STKERROR_2ARG2(Where, Arg1, Arg2, Error))
 throw an runtime exception with two arguments.
 
#define STKRUNTIME_ERROR_1ARG2(Where, Arg, Error)    throw STK::runtime_error(STKERROR_1ARG2(Where, Arg, Error))
 throw an runtime exception with one arguments.
 
#define STKRUNTIME_ERROR_NO_ARG2(Where, Error)    throw STK::runtime_error(STKERROR_NO_ARG2(Where, Error))
 throw an runtime exception with one arguments.
 
#define STKDOMAIN_ERROR_2ARG2(Where, Arg1, Arg2, Error)    throw STK::domain_error(STKERROR_2ARG2(Where, Arg1, Arg2, Error))
 throw an domain exception with two arguments.
 
#define STKDOMAIN_ERROR_3ARG2(Where, Arg1, Arg2, Arg3, Error)    throw STK::domain_error(STKERROR_3ARG2(Where, Arg1, Arg2, Arg3, Error))
 throw an domain exception with two arguments.
 
#define STKDOMAIN_ERROR_1ARG2(Where, Arg, Error)    throw STK::domain_error(STKERROR_1ARG2(Where, Arg, Error))
 throw an domain exception with one arguments.
 
#define STKDOMAIN_ERROR_NO_ARG2(Where, Error)    throw STK::domain_error(STKERROR_NO_ARG2(Where, Error))
 throw an domain exception with no argument.
 
#define STKINVALIDARGUMENT_ERROR_2ARG2(Where, Arg1, Arg2, Error)    throw STK::invalid_argument(STKERROR_2ARG2(Where, Arg1, Arg2, Error))
 throw an invalid argument exception with two arguments.
 
#define STKINVALIDARGUMENT_ERROR_1ARG2(Where, Arg1, Error)    throw STK::invalid_argument(STKERROR_1RG2(Where, Arg1, Error))
 throw an invalid argument exception with one argument.
 
#define STKINVALIDARGUMENT_ERROR_NO_ARG2(Where, Error)    throw STK::invalid_argument(STKERROR_NO_ARG2(Where, Error))
 throw an invalid argument exception with no argument.
 

Typedefs

typedef char STK::Char
 STK fundamental type of a Char.
 
typedef std::basic_string< CharSTK::String
 STK fundamental type of a String.
 
typedef int STK::Integer
 STK fundamental type of integer values.
 
typedef double STK::Real
 STK fundamental type of Real values.
 

Variables

const int STK::baseIdx = 0
 base index of the containers created in STK++.
 
const int STK::maxFixedSize = 1024
 maximal size of fixed size containers This value is used when fixed size containers are automatically build in internal computation
 
const int STK::UnknownSize = INT_MAX
 This value means that an integer is not known at compile-time, and that instead the value is stored in some runtime variable.
 
const int STK::SqrtUnknownSize = (1 << (sizeof(int) * (CHAR_BIT/2)))
 Same as floor(sqrt(INT_MAX+1))
 
const int STK::MaxUnroll = 20
 When don't unroll loops on fixed size containers if fixed size is greater than this value.
 
const int STK::MaxUnrollSlice = 5
 This value means that when we unroll loops we go until MaxUnrollSlice.
 
const int firstIdx_ = 0
 base index of the containers created in STK++.
 

Detailed Description

The Sdk project propose a set of high level interfaces, template for meta-programming and macros that are used throughout the STK++ projects.

In Sdk we define the pure Interface classes than can be used throughout the STK++ whole project. The aim is to unified the syntax and the treatment realized by the statistical methods.

Macro Definition Documentation

◆ STKDOMAIN_ERROR_1ARG2

#define STKDOMAIN_ERROR_1ARG2 (   Where,
  Arg,
  Error 
)     throw STK::domain_error(STKERROR_1ARG2(Where, Arg, Error))

throw an domain exception with one arguments.

Error message have the form : "Error in classname::methodname(arg)\nWhat: error message."

Definition at line 163 of file STK_Macros.h.

◆ STKDOMAIN_ERROR_2ARG2

#define STKDOMAIN_ERROR_2ARG2 (   Where,
  Arg1,
  Arg2,
  Error 
)     throw STK::domain_error(STKERROR_2ARG2(Where, Arg1, Arg2, Error))

throw an domain exception with two arguments.

Error message have the form : "Error in classname::methodname(arg1, arg2)\nWhat: error message."

Definition at line 145 of file STK_Macros.h.

◆ STKDOMAIN_ERROR_3ARG2

#define STKDOMAIN_ERROR_3ARG2 (   Where,
  Arg1,
  Arg2,
  Arg3,
  Error 
)     throw STK::domain_error(STKERROR_3ARG2(Where, Arg1, Arg2, Arg3, Error))

throw an domain exception with two arguments.

Error message have the form : "Error in classname::methodname(arg)\nWhat: error message."

Definition at line 154 of file STK_Macros.h.

◆ STKDOMAIN_ERROR_NO_ARG2

#define STKDOMAIN_ERROR_NO_ARG2 (   Where,
  Error 
)     throw STK::domain_error(STKERROR_NO_ARG2(Where, Error))

throw an domain exception with no argument.

Error message have the form : "Error in classname::methodname()\nWhat: error message."

Definition at line 172 of file STK_Macros.h.

◆ STKERROR_1ARG2

#define STKERROR_1ARG2 (   Where,
  Arg,
  Error 
)
Value:
STK::String(_T("Error in "))+STK::String(_T(#Where))+STK::String(_T("(")) \
+ STK::String(_T(")\nWhat: "))+STK::String(_T(#Error))
#define _T(x)
Let x unmodified.
String typeToString(Type const &t, std::ios_base &(*f)(std::ios_base &)=std::dec)
convert a Type to String
Definition STK_String.h:235
std::basic_string< Char > String
STK fundamental type of a String.

generate an Error message with one argument.

All Error message have the form : "Error in classname::methodname(arg)\nWhat: error message."

Definition at line 56 of file STK_Macros.h.

59 : "))+STK::String(_T(#Error))

◆ STKERROR_2ARG2

#define STKERROR_2ARG2 (   Where,
  Arg1,
  Arg2,
  Error 
)
Value:
STK::String(_T("Error in "))+STK::String(_T(#Where))+STK::String(_T("(")) \
+ STK::String(_T(")\nWhat: "))+STK::String(_T(#Error))

generate an Error message with no argument.

All Error message have the form : "Error in classname::methodname(arg1, arg2)\nWhat: error message."

Definition at line 68 of file STK_Macros.h.

71 : "))+STK::String(_T(#Error))

◆ STKERROR_3ARG2

#define STKERROR_3ARG2 (   Where,
  Arg1,
  Arg2,
  Arg3,
  Error 
)
Value:
STK::String(_T("Error in "))+STK::String(_T(#Where))+STK::String(_T("(")) \
+ STK::String(_T(")\nWhat: "))+STK::String(_T(#Error))

generate an Error message with three arguments.

All Error message have the form : "Error in classname::methodname(Arg1, Arg2, Arg3)\nWhat: error message."

Definition at line 79 of file STK_Macros.h.

82 : "))+STK::String(_T(#Error))

◆ STKERROR_NO_ARG2

#define STKERROR_NO_ARG2 (   Where,
  Error 
)
Value:
STK::String(_T("Error in "))+STK::String(_T(#Where))+STK::String(_T("(")) \
+ STK::String(_T(")\nWhat: "))+STK::String(_T(#Error))

generate an Error message with no arguments.

All Error message have the form : "Error in classname::methodname()\nWhat: error message."

Definition at line 45 of file STK_Macros.h.

47 : "))+STK::String(_T(#Error))

◆ STKINVALIDARGUMENT_ERROR_1ARG2

#define STKINVALIDARGUMENT_ERROR_1ARG2 (   Where,
  Arg1,
  Error 
)     throw STK::invalid_argument(STKERROR_1RG2(Where, Arg1, Error))

throw an invalid argument exception with one argument.

Error message have the form : "Error in classname::methodname(arg1)\nWhat: error message."

Definition at line 190 of file STK_Macros.h.

◆ STKINVALIDARGUMENT_ERROR_2ARG2

#define STKINVALIDARGUMENT_ERROR_2ARG2 (   Where,
  Arg1,
  Arg2,
  Error 
)     throw STK::invalid_argument(STKERROR_2ARG2(Where, Arg1, Arg2, Error))

throw an invalid argument exception with two arguments.

Error message have the form : "Error in classname::methodname(arg1, arg2)\nWhat: error message."

Definition at line 181 of file STK_Macros.h.

◆ STKINVALIDARGUMENT_ERROR_NO_ARG2

#define STKINVALIDARGUMENT_ERROR_NO_ARG2 (   Where,
  Error 
)     throw STK::invalid_argument(STKERROR_NO_ARG2(Where, Error))

throw an invalid argument exception with no argument.

Error message have the form : "Error in classname::methodname()\nWhat: error message."

Definition at line 199 of file STK_Macros.h.

◆ STKOUT_OF_RANGE_1ARG2

#define STKOUT_OF_RANGE_1ARG2 (   Where,
  Arg,
  Error 
)     throw STK::out_of_range(STKERROR_1ARG2(Where, Arg, Error))

throw an STK::out_of_range exception with one arguments.

Error message have the form : "Error in classname::methodname(arg)\nWhat: error message."

Definition at line 91 of file STK_Macros.h.

◆ STKOUT_OF_RANGE_2ARG2

#define STKOUT_OF_RANGE_2ARG2 (   Where,
  Arg1,
  Arg2,
  Error 
)     throw STK::out_of_range(STKERROR_2ARG2(Where, Arg1, Arg2, Error))

throw an STK::out_of_range exception with two arguments.

Error message have the form : "Error in classname::methodname(argA, arg2)\nWhat: error message."

Definition at line 100 of file STK_Macros.h.

◆ STKOUT_OF_RANGE_3ARG2

#define STKOUT_OF_RANGE_3ARG2 (   Where,
  Arg1,
  Arg2,
  Arg3,
  Error 
)     throw STK::out_of_range(STKERROR_3ARG2(Where, Arg1, Arg2, Arg3, Error))

throw an STK::out_of_range exception with three arguments.

Error message have the form : "Error in classname::methodname(arg1, arg2, arg3)\nWhat: error message."

Definition at line 109 of file STK_Macros.h.

◆ STKRUNTIME_ERROR_1ARG2

#define STKRUNTIME_ERROR_1ARG2 (   Where,
  Arg,
  Error 
)     throw STK::runtime_error(STKERROR_1ARG2(Where, Arg, Error))

throw an runtime exception with one arguments.

Error message have the form : "Error in classname::methodname(arg)\nWhat: error message."

Definition at line 127 of file STK_Macros.h.

◆ STKRUNTIME_ERROR_2ARG2

#define STKRUNTIME_ERROR_2ARG2 (   Where,
  Arg1,
  Arg2,
  Error 
)     throw STK::runtime_error(STKERROR_2ARG2(Where, Arg1, Arg2, Error))

throw an runtime exception with two arguments.

Error message have the form : "Error in classname::methodname(arg1, arg2)\nWhat: error message."

Definition at line 118 of file STK_Macros.h.

◆ STKRUNTIME_ERROR_NO_ARG2

#define STKRUNTIME_ERROR_NO_ARG2 (   Where,
  Error 
)     throw STK::runtime_error(STKERROR_NO_ARG2(Where, Error))

throw an runtime exception with one arguments.

Error message have the form : "Error in classname::methodname(arg)\nWhat: error message."

Definition at line 136 of file STK_Macros.h.

Typedef Documentation

◆ Char

STK fundamental type of a Char.

The type Char is defined for the internal representation of the characters. Note that if you change the representation, you don't have to modify the stream classes defined in the file STK_StreamBase.h, but you have to modify the global stream objects std::cout, std::cin, std::cerr, std::clog in order to access to the standard I/O channels.

Definition at line 69 of file STK_Typedefs.h.

◆ Integer

STK fundamental type of integer values.

The type Integer is defined for the numerical computation and the internal representation of the discrete variables.

Definition at line 97 of file STK_Typedefs.h.

◆ Real

STK fundamental type of Real values.

The type Real is defined for the numerical computation and the internal representation of the continuous variables. By default it is the double type, but it can be overridden at compile-time, if needed.

Definition at line 118 of file STK_Typedefs.h.

◆ String

typedef std::basic_string<Char> STK::String

STK fundamental type of a String.

The type String is defined for the internal representation of the string variables (strings).

Definition at line 89 of file STK_Typedefs.h.

Variable Documentation

◆ baseIdx

const int STK::baseIdx = 0

base index of the containers created in STK++.

This value means that the default range for a vector or the rows/columns of a matrix is the value given by this constant.

Definition at line 63 of file STK_Constants.h.

Referenced by STK::hidden::VisitorUnrollCol< Visitor, Derived, 1, SizeCols_ >::apply(), STK::IArray1D< Derived >::beginCols(), STK::ISparseArray1D< Derived >::beginCols(), STK::List1D< Type_ >::beginCols(), STK::TReadWriteCsv< Type >::beginRows(), STK::Variable< Type_ >::encode(), STK::IArray1D< Derived >::endCols(), STK::ISparseArray1D< Derived >::endCols(), STK::List1D< Type_ >::endCols(), STK::TReadWriteCsv< Type >::endRows(), STK::CategoricalBase< Derived >::getParameters(), STK::DiagGaussianBase< Derived >::getParameters(), STK::GammaBase< Derived >::getParameters(), STK::HDGaussianBase< Derived >::getParameters(), STK::KmmBase< Derived >::getParameters(), STK::IArray1D< Derived >::lastIdxCols(), STK::ISparseArray1D< Derived >::lastIdxCols(), STK::DataFrame::lastIdxCols(), STK::List1D< Type_ >::lastIdxCols(), STK::TReadWriteCsv< Type >::lastIdxRows(), STK::MemSAllocator< Type_, NzMax_, Size_ >::MemSAllocator(), STK::MemSAllocator< Type_, NzMax_, Size_ >::MemSAllocator(), STK::DataHandler::readDataFromArray(), STK::DataHandler::readDataFromArray2D(), STK::DataHandler::readDataFromCsvFile(), STK::hidden::VisitorUnrollCol< Visitor, Derived, 1, SizeCols_ >::run(), STK::MixtureSemiLearner::setLabels(), STK::ModelParameters< Clust::Kmm_s_ >::setParameters(), STK::ModelParameters< Clust::Kmm_sk_ >::setParameters(), STK::Stat::Factor< Array >::update(), and STK::Stat::MultiFactor< Array >::update().

◆ firstIdx_

const int firstIdx_ = 0

base index of the containers created in STK++.

This value means that the default range for a vector or the rows/columns of a matrix is the value given by this constant.

Definition at line 48 of file STK_Range.h.

◆ maxFixedSize

const int STK::maxFixedSize = 1024

maximal size of fixed size containers This value is used when fixed size containers are automatically build in internal computation

Definition at line 70 of file STK_Constants.h.

◆ MaxUnroll

const int STK::MaxUnroll = 20

When don't unroll loops on fixed size containers if fixed size is greater than this value.

Definition at line 86 of file STK_Constants.h.

◆ MaxUnrollSlice

const int STK::MaxUnrollSlice = 5

This value means that when we unroll loops we go until MaxUnrollSlice.

Definition at line 91 of file STK_Constants.h.

◆ SqrtUnknownSize

const int STK::SqrtUnknownSize = (1 << (sizeof(int) * (CHAR_BIT/2)))

Same as floor(sqrt(INT_MAX+1))

Definition at line 81 of file STK_Constants.h.

◆ UnknownSize

const int STK::UnknownSize = INT_MAX

This value means that an integer is not known at compile-time, and that instead the value is stored in some runtime variable.

This is the same value that the value used for representing NA Integers when Integer is int.

Definition at line 77 of file STK_Constants.h.

Referenced by STK::BinaryOperator< FunctorOp, Lhs, Rhs >::BinaryOperator(), and STK::ExprBase< Derived >::operator*().