diff --git a/include/timbl/Features.h b/include/timbl/Features.h index bd70da1..1658d12 100644 --- a/include/timbl/Features.h +++ b/include/timbl/Features.h @@ -49,8 +49,8 @@ namespace Timbl { class SparseValueProbClass { friend std::ostream& operator<< ( std::ostream&, SparseValueProbClass * ); public: - typedef std::map< size_t, double > IDmaptype; - typedef IDmaptype::const_iterator IDiterator; + using IDmaptype = std::map< size_t, double >; + using IDiterator = IDmaptype::const_iterator; explicit SparseValueProbClass( size_t d ): dimension(d) {}; void Assign( const size_t i, const double d ) { vc_map[i] = d; }; void Clear() { vc_map.clear(); }; diff --git a/include/timbl/IBtree.h b/include/timbl/IBtree.h index 5552b34..8af4a17 100644 --- a/include/timbl/IBtree.h +++ b/include/timbl/IBtree.h @@ -103,7 +103,7 @@ namespace Timbl { const IBtree *search_node( const FeatureValue * ) const; }; - typedef std::unordered_map FI_map; + using FI_map = std::unordered_map; class InstanceBase_base: public MsgClass { friend class IG_InstanceBase; diff --git a/include/timbl/MBLClass.h b/include/timbl/MBLClass.h index 577f557..f14097f 100644 --- a/include/timbl/MBLClass.h +++ b/include/timbl/MBLClass.h @@ -33,7 +33,7 @@ #include "timbl/neighborSet.h" #include "timbl/Options.h" -typedef struct _xmlNode xmlNode; +using xmlNode = struct _xmlNode; namespace Hash { class UnicodeHash; diff --git a/include/timbl/Matrices.h b/include/timbl/Matrices.h index d960814..7a71a86 100644 --- a/include/timbl/Matrices.h +++ b/include/timbl/Matrices.h @@ -35,8 +35,8 @@ template std::ostream& operator << (std::ostream&, template class SparseSymetricMatrix { - typedef std::map< Class, double > CDmap; - typedef std::map< Class, CDmap > CCDmap; + using CDmap = std::map< Class, double >; + using CCDmap = std::map< Class, CDmap >; friend std::ostream& operator << <> ( std::ostream&, const SparseSymetricMatrix& ); diff --git a/include/timbl/Options.h b/include/timbl/Options.h index 8acb32d..1899573 100644 --- a/include/timbl/Options.h +++ b/include/timbl/Options.h @@ -79,7 +79,7 @@ namespace Timbl { OptionClassT& operator = (const OptionClassT&); }; - typedef OptionClassT BoolOption; + using BoolOption= OptionClassT; template <> inline std::ostream& OptionClassT::show_opt( std::ostream &os ) const { @@ -99,7 +99,7 @@ namespace Timbl { return os; } - typedef OptionClassT VerbosityOption; + using VerbosityOption = OptionClassT; template <> inline std::ostream& OptionClassT::show_full( std::ostream &os ) const { @@ -109,7 +109,7 @@ namespace Timbl { return os; } - typedef OptionClassT InputFormatOption; + using InputFormatOption = OptionClassT; template <> inline std::ostream& InputFormatOption::show_full( std::ostream &os ) const { @@ -126,7 +126,7 @@ namespace Timbl { } - typedef OptionClassT MetricOption; + using MetricOption = OptionClassT; template <> inline std::ostream& OptionClassT::show_full( std::ostream &os )const { @@ -142,7 +142,7 @@ namespace Timbl { return os; } - typedef OptionClassT AlgorithmOption; + using AlgorithmOption = OptionClassT; template <> inline std::ostream& OptionClassT::show_full( std::ostream &os ) const { @@ -158,7 +158,7 @@ namespace Timbl { return os; } - typedef OptionClassT DecayOption; + using DecayOption = OptionClassT; template <> inline std::ostream& DecayOption::show_full( std::ostream &os ) const { @@ -174,7 +174,7 @@ namespace Timbl { return os; } - typedef OptionClassT SmoothOption; + using SmoothOption = OptionClassT; template <> inline std::ostream& SmoothOption::show_full( std::ostream &os ) const { @@ -190,7 +190,7 @@ namespace Timbl { return os; } - typedef OptionClassT WeightOption; + using WeightOption = OptionClassT; template <> inline std::ostream& OptionClassT::show_full( std::ostream &os ) const { @@ -206,7 +206,7 @@ namespace Timbl { return os; } - typedef OptionClassT OrdeningOption; + using OrdeningOption = OptionClassT; template <> inline std::ostream& OptionClassT::show_full( std::ostream &os ) const { @@ -222,7 +222,7 @@ namespace Timbl { return os; } - typedef OptionClassT NormalisationOption; + using NormalisationOption = OptionClassT; template <> inline std::ostream& NormalisationOption::show_full( std::ostream &os ) const { @@ -360,10 +360,10 @@ namespace Timbl { OptionClassLT& operator = (const OptionClassLT&); }; - typedef OptionClassLT IntegerOption; - typedef OptionClassLT UnsignedOption; - typedef OptionClassLT SizeOption; - typedef OptionClassLT RealOption; + using IntegerOption = OptionClassLT; + using UnsignedOption = OptionClassLT; + using SizeOption = OptionClassLT; + using RealOption = OptionClassLT; enum SetOptRes { Opt_OK, Opt_Frozen, Opt_Unknown, Opt_Ill_Val}; diff --git a/include/timbl/Targets.h b/include/timbl/Targets.h index dea6d36..d269b97 100644 --- a/include/timbl/Targets.h +++ b/include/timbl/Targets.h @@ -138,8 +138,8 @@ namespace Timbl { friend std::ostream& operator<<( std::ostream&, const ClassDistribution * ); friend class WClassDistribution; public: - typedef std::map VDlist; - typedef VDlist::const_iterator dist_iterator; + using VDlist = std::map; + using dist_iterator = VDlist::const_iterator; ClassDistribution( ): total_items(0) {}; ClassDistribution( const ClassDistribution& ); virtual ~ClassDistribution(){ clear(); }; diff --git a/include/timbl/TimblAPI.h b/include/timbl/TimblAPI.h index 5a08408..c6aee78 100644 --- a/include/timbl/TimblAPI.h +++ b/include/timbl/TimblAPI.h @@ -164,7 +164,7 @@ namespace Timbl{ bool string_to( const std::string&, Algorithm& ); bool string_to( const std::string&, Weighting& ); - typedef ClassDistribution ValueDistribution; // for backward compatability - typedef WClassDistribution WValueDistribution; // for backward compatability + using ValueDistribution = ClassDistribution; // for backward compatability + using WValueDistribution = WClassDistribution; // for backward compatability } #endif // TIMBL_API_H diff --git a/include/timbl/TimblExperiment.h b/include/timbl/TimblExperiment.h index ef749bb..522de61 100644 --- a/include/timbl/TimblExperiment.h +++ b/include/timbl/TimblExperiment.h @@ -117,8 +117,8 @@ namespace Timbl { } }; - typedef std::map, fCmp> fileIndex; - typedef std::map fileDoubleIndex; + using fileIndex = std::map, fCmp>; + using fileDoubleIndex = std::map; std::ostream& operator<< ( std::ostream&, const fileIndex& ); std::ostream& operator<< ( std::ostream&, const fileDoubleIndex& );