00001 /*! \file etirmtypes.h 00002 00003 \brief Defines data types used by etirm. 00004 00005 Data types representing floating point numbers, vectors and 00006 matrices of floating point numbers, and examinee item responses. 00007 00008 Some types are used from the Simple C++ Numerical Toolkit (SCPPNT). 00009 SCPPNT is available from http://www.smallwaters.com/software/cpp/scppnt.html. 00010 00011 Estimation Toolkit for Item Response Models (ETIRM) 00012 http://www.smallwaters.com/software/cpp/etirm.html 00013 00014 Author(s): 00015 Werner Wothke, maintenance (http://www.smallwaters.com) 00016 Brad Hanson (http://www.b-a-h.com/) 00017 See the file LICENSE for information on usage and redistribution. 00018 00019 Copyright (C) 2008, Werner Wothke 00020 Copyright (c) 2000-2002, Bradley A. Hanson 00021 */ 00022 00023 #ifndef ETIRMTYPES_H_ 00024 #define ETIRMTYPES_H_ 00025 00026 #ifndef ETIRM_FLOAT_TYPE 00027 /*! 00028 \brief 00029 This definition describes the default data type used for floating point 00030 numbers. \ 00031 00032 It defaults to double, but can be overriden at compile time redefining 00033 ETIRM_FLOAT_TYPE, e.g. 00034 00035 g++ -DETIRM_FLOAT_TYPE='float' ... 00036 */ 00037 #define ETIRM_FLOAT_TYPE double 00038 #endif 00039 00040 #ifndef ETIRM_RESPONSE_TYPE 00041 /*! 00042 \brief 00043 This definition describes the default data type used for an item response 00044 and covariant for an examinee. 00045 00046 It defaults to char, but can be overriden at compile time redefining 00047 ETIRM_RESPONSE_TYPE, e.g. 00048 00049 g++ -DETIRM_RESPONSE_TYPE='int' ... 00050 */ 00051 #define ETIRM_RESPONSE_TYPE char 00052 #endif 00053 00054 #ifdef ETIRM_USE_BOOST_CONFIG 00055 // Use configuration file from the Boost libraries 00056 // (http://www.boost.org) to set the macros 00057 // used by ETIRM that begin with BOOST_ 00058 // for the particular compiler being used. 00059 #include <boost/config.hpp> 00060 #endif 00061 00062 #ifdef SCPPNT_NO_DIR_PREFIX 00063 #include "scppnt_error.h" // exception classes from Simple C++ Numerical Toolkit (SCPPNT) 00064 #include "vec.h" // vector class from Simple C++ Numerical Toolkit (SCPPNT) 00065 #include "cmat.h" // matrix class from Simple C++ Numerical Toolkit (SCPPNT) 00066 #else 00067 #include "scppnt/scppnt_error.h" // exception classes from Simple C++ Numerical Toolkit (SCPPNT) 00068 #include "scppnt/vec.h" // vector class from Simple C++ Numerical Toolkit (SCPPNT) 00069 #include "scppnt/cmat.h" // matrix class from Simple C++ Numerical Toolkit (SCPPNT) 00070 #endif 00071 00072 namespace etirm 00073 { 00074 /*! 00075 \brief 00076 Data type for floating point numbers. 00077 00078 This type is defined globally rather than 00079 being a template parameter in individual classes 00080 because it seemed unlikely that one would want 00081 different floating point types used for different 00082 ETIRM classes. 00083 */ 00084 typedef ETIRM_FLOAT_TYPE Real; 00085 00086 //! Data type to hold an examinee item response 00087 typedef ETIRM_RESPONSE_TYPE Response; 00088 00089 /*! 00090 \brief 00091 Vector type containing floating point numbers. Used in numeric calculations. 00092 */ 00093 typedef SCPPNT::Vector<Real> RealVector; 00094 00095 00096 /*! 00097 \brief 00098 Matrix type containing floating point numbers. Used in numeric calculations. 00099 */ 00100 typedef SCPPNT::Matrix<Real> RealMatrix; 00101 00102 //! Using SCPPNT exception types for logical errors. 00103 typedef SCPPNT::LogicError LogicError; 00104 00105 //! Using SCPPNT exception types for invalid arguments. 00106 typedef SCPPNT::InvalidArgument InvalidArgument; 00107 00108 //! Using SCPPNT exception types for runtime errors. 00109 typedef SCPPNT::RuntimeError RuntimeError; 00110 00111 //! Using SCPPNT exception types for exception violations. 00112 typedef SCPPNT::Exception Exception; 00113 00114 //! Enumeration for type of IRT model 00115 enum IRTModel 00116 { 00117 //! One-parameter logistic for dichotomous items. 00118 OnePL, 00119 //! Two-parameter logistic for dichotomous items. 00120 TwoPL, 00121 //! Three-parameter logistic for dichotomous items. 00122 ThreePL, 00123 //! Partial credit model for polytomous items 00124 PCM, 00125 //! Generalized partial credit model for polytomous items 00126 GPCM 00127 }; 00128 00129 } 00130 00131 #undef ETIRM_FLOAT_TYPE 00132 #undef ETIRM_RESPONSE_TYPE 00133 00134 #endif // ETIRMTYPES_H_