deprecated.h

00001 /* MLPACK 0.2
00002  *
00003  * Copyright (c) 2008, 2009 Alexander Gray,
00004  *                          Garry Boyer,
00005  *                          Ryan Riegel,
00006  *                          Nikolaos Vasiloglou,
00007  *                          Dongryeol Lee,
00008  *                          Chip Mappus, 
00009  *                          Nishant Mehta,
00010  *                          Hua Ouyang,
00011  *                          Parikshit Ram,
00012  *                          Long Tran,
00013  *                          Wee Chin Wong
00014  *
00015  * Copyright (c) 2008, 2009 Georgia Institute of Technology
00016  *
00017  * This program is free software; you can redistribute it and/or
00018  * modify it under the terms of the GNU General Public License as
00019  * published by the Free Software Foundation; either version 2 of the
00020  * License, or (at your option) any later version.
00021  *
00022  * This program is distributed in the hope that it will be useful, but
00023  * WITHOUT ANY WARRANTY; without even the implied warranty of
00024  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00025  * General Public License for more details.
00026  *
00027  * You should have received a copy of the GNU General Public License
00028  * along with this program; if not, write to the Free Software
00029  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00030  * 02110-1301, USA.
00031  */
00038 #ifndef BASE_DEPRECATED_H
00039 #define BASE_DEPRECATED_H
00040 
00041 #include "fastlib/base/base.h"
00042 
00043 /* common.h */
00044 #define print_notify_headers print_notify_locs
00045 void percent_indicator(const char *name, uint64 num, uint64 den) {
00046   fl_print_progress(name, num * 100 / den);
00047 }
00048 #define ASSERT_PASS(x) MUST_PASS(x)
00049 #define SUCCESS_FROM_INT(x) SUCCESS_FROM_C(x)
00050 
00051 /* compiler.h */
00052 #define EXTERN_C_START EXTERN_C_BEGIN
00053 #define IS_CONSTANT_EXPRESION(expr) IS_CONST_EXPR(expr)
00054 #define COMPILER_NORETURN COMPILER_NO_RETURN
00055 #define COMPILER_NOINLINE COMPILER_NO_INLINE
00056 
00057 /* debug.h */
00058 #define debug_verbosity verbosity_level
00059 #define DEBUG_MSG(min_verbosity, msg_params...) \
00060     VERBOSE_MSG(min_verbosity, msg_params)
00061 #define DEBUG_GOT_HERE(min_verbosity) \
00062     VERBOSE_GOT_HERE(min_verbosity)
00063 
00064 #ifdef __cplusplus
00065 /* cc.h */
00066 #define FORBID_COPY(C) FORBID_ACCIDENTAL_COPIES(C)
00067 #define CC_ASSIGNMENT_OPERATOR(C) ASSIGN_VIA_COPY_CONSTRUCTION(C)
00068 #define DEFINE_INEQUALITY_COMPARATORS(C) EXPAND_LESS_THAN(C)
00069 #define DEFINE_ALL_COMPARATORS(C) EXPAND_LESS_THAN(C) EXPAND_EQUALS(C)
00070 #define DEFINE_INEQUALITY_COMPARATORS_HETERO(C, T) \
00071     EXPAND_HETERO_LESS_THAN(C, T) EXPAND_HETERO_LESS_THAN(T, C)
00072 #define DEFINE_ALL_COMPARATORS_HETERO(C, T) \
00073     DEFINE_INEQUALITY_COMPARATORS_HETERO(C, T) EXPAND_HETERO_EQUALS(C, T)
00074 
00075 /* ccmem.h */
00076 namespace mem {
00077   template<typename T>
00078   inline T *ZeroBytes(T *array, size_t bytes) {
00079     return BitZeroBytes(array, bytes);
00080   }
00081   template<typename T>
00082   inline T *Zero(T *array, size_t elems = 1) {
00083     return BitZero(array, elems);
00084   }
00085   template<typename T>
00086   inline T *AllocZeroed(size_t elems = 1) {
00087     return AllocBitZero<T>(elems);
00088   }
00089 
00090   template<typename T, typename U>
00091   inline T *CopyBytes(T *dest, const U *src, size_t bytes) {
00092     return BitCopyBytes(dest, reinterpret_cast<const T *>(src), bytes);
00093   }
00094   template<typename T, typename U>
00095   inline T *Copy(T *dest, const U *src, size_t elems = 1) {
00096     return BitCopy(dest, reinterpret_cast<const T *>(src), elems);
00097   }
00098   template<typename T>
00099   inline T *DupBytes(const T *src, size_t bytes) {
00100     return AllocBitCopyBytes(src, bytes);
00101   }
00102   template<typename T>
00103   inline T *Dup(const T *src, size_t elems = 1) {
00104     return AllocBitCopy(src, elems);
00105   }
00106 
00107   template<typename T>
00108   inline T *Resize(T *array, size_t elems = 1) {
00109     return Realloc(array, elems);
00110   }
00111 
00112   template<typename T>
00113   inline T *SwapBytes(T *a, T *b, size_t bytes) {
00114     return BitSwapBytes(a, b, bytes);
00115   }
00116   template<typename T>
00117   inline T *Swap(T *a, T *b, size_t elems = 1) {
00118     return BitSwap(a, b, elems);
00119   }
00120 
00121   template<typename T>
00122   inline T *ConstructAll(T *array, size_t elems) {
00123     return Construct(array, elems);
00124   }
00125   template<typename T, typename U>
00126   inline T *Construct(T *ptr, const U &init) {
00127     return RepeatConstruct(ptr, init, 1);
00128   }
00129   template<typename T, typename U>
00130   inline T *ConstructAll(T *array, const U &init, size_t elems) {
00131     return RepeatConstruct(array, init, elems);
00132   }
00133   template<typename T>
00134   inline T *DestructAll(T *array, size_t elems) {
00135     return Destruct(array, elems);
00136   }
00137 
00138   template<typename T, typename U>
00139   inline T *AllocConstruct(const U &init, size_t elems) {
00140     return AllocRepeatConstruct<T>(init, elems);
00141   }
00142   template<typename T>
00143   inline T *DupConstruct(const T *src, size_t elems = 1) {
00144     return AllocCopyConstruct(src, elems);
00145   }
00146 
00147   template<typename T>
00148   inline T *PointerAdd(const T *ptr, ptrdiff_t bytes) {
00149     return PtrAddBytes(ptr, bytes);
00150   }
00151   template<typename T, typename U>
00152   inline ptrdiff_t *PointerDiff(const T *lhs, const U *rhs) {
00153     return PtrDiffBytes(lhs, rhs);
00154   }
00155   template<typename T>
00156   inline ptrdiff_t *PointerAbsoluteAddress(const T *ptr) {
00157     return PtrAbsAddr(ptr);
00158   }
00159   template<typename T, typename U>
00160   inline bool PointersEqual(const T *lhs, const U *rhs) {
00161     return PtrsEqual(lhs, rhs);
00162   }
00163 };
00164 #endif
00165 
00166 #endif /* BASE_DEPRECATED_H */
Generated on Mon Jan 24 12:04:37 2011 for FASTlib by  doxygen 1.6.3