Commit 754da0ef authored by Davis King's avatar Davis King

Properly organized the svn repository. Finally.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%402199
parent 49388714
#
# This is a CMake makefile. You can find the cmake utility and
# information about it at http://www.cmake.org
#
# setting this makes CMake allow normal looking IF ELSE statements
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
# make macros that can add #define directives to the entire project. Not just
# to the dlib library itself. I.e. to dlib and to any projects that depend
# on dlib.
MACRO ( add_global_define def_name )
if (NOT CMAKE_CXX_FLAGS MATCHES "-D${def_name}")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${def_name}"
CACHE STRING "Flags used by the compiler during all C++ builds."
FORCE)
endif ()
ENDMACRO()
MACRO ( remove_global_define def_name )
if (CMAKE_CXX_FLAGS MATCHES " -D${def_name}")
string (REGEX REPLACE " -D${def_name}" "" temp_var ${CMAKE_CXX_FLAGS})
set (CMAKE_CXX_FLAGS "${temp_var}"
CACHE STRING "Flags used by the compiler during all C++ builds."
FORCE)
endif ()
ENDMACRO()
# Make sure ENABLE_ASSERTS is defined for debug builds
if (NOT CMAKE_CXX_FLAGS_DEBUG MATCHES "-DENABLE_ASSERTS")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DENABLE_ASSERTS"
CACHE STRING "Flags used by the compiler during C++ debug builds."
FORCE)
endif ()
set (DLIB_ISO_CPP_ONLY_STR
"Enable this if you don't want to compile any non-ISO C++ code (i.e. you don't use any of the API Wrappers)" )
set (DLIB_NO_GUI_SUPPORT_STR
"Enable this if you don't want to compile any of the dlib GUI code" )
OPTION(DLIB_ISO_CPP_ONLY ${DLIB_ISO_CPP_ONLY_STR} OFF)
OPTION(DLIB_NO_GUI_SUPPORT ${DLIB_NO_GUI_SUPPORT_STR} OFF)
add_library(dlib all/source.cpp )
IF (NOT DLIB_ISO_CPP_ONLY)
# we want to link to the right stuff depending on our platform.
IF (WIN32) ###############################################################################
if (DLIB_NO_GUI_SUPPORT)
set (dlib_needed_libraries ws2_32)
else()
set (dlib_needed_libraries ws2_32 comctl32 gdi32)
endif()
ELSEIF(APPLE) ############################################################################
FIND_LIBRARY(pthreadlib pthread)
set (dlib_needed_libraries ${pthreadlib})
if (NOT DLIB_NO_GUI_SUPPORT)
FIND_LIBRARY(xlib X11)
# make sure X11 is in the include path
FIND_PATH(xlib_path Xlib.h
PATHS
/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include
PATH_SUFFIXES X11
)
if (xlib AND xlib_path)
GET_FILENAME_COMPONENT(x11_path ${xlib_path} PATH CACHE)
INCLUDE_DIRECTORIES(${x11_path})
set(dlib_needed_libraries ${dlib_needed_libraries} ${xlib} )
else()
message(" ***********************************************************************************")
message(" ****** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ******")
message(" ****** Make sure libx11-dev is installed if you want GUI support ******")
message(" ***********************************************************************************")
set(DLIB_NO_GUI_SUPPORT ON CACHE STRING ${DLIB_NO_GUI_SUPPORT_STR} FORCE )
endif()
endif()
MARK_AS_ADVANCED(pthreadlib xlib xlib_path x11_path)
ELSE () ##################################################################################
FIND_LIBRARY(pthreadlib pthread)
set (dlib_needed_libraries ${pthreadlib})
# link to the nsl library if it exists. this is something you need sometimes
FIND_LIBRARY(nsllib nsl)
if (nsllib)
set (dlib_needed_libraries ${dlib_needed_libraries} ${nsllib})
endif ()
# link to the socket library if it exists. this is something you need on solaris
FIND_LIBRARY(socketlib socket)
if (socketlib)
set (dlib_needed_libraries ${dlib_needed_libraries} ${socketlib})
endif ()
if (NOT DLIB_NO_GUI_SUPPORT)
INCLUDE(FindX11)
if (X11_FOUND)
INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${X11_LIBRARIES})
else()
message(" ***********************************************************************************")
message(" ****** DLIB GUI SUPPORT DISABLED BECAUSE X11 DEVELOPMENT LIBRARIES NOT FOUND ******")
message(" ****** Make sure libx11-dev is installed if you want GUI support ******")
message(" ***********************************************************************************")
set(DLIB_NO_GUI_SUPPORT ON CACHE STRING ${DLIB_NO_GUI_SUPPORT_STR} FORCE )
endif()
endif()
MARK_AS_ADVANCED(nsllib pthreadlib socketlib)
ENDIF () #################################################################################
INCLUDE(FindPNG)
if (PNG_FOUND)
INCLUDE_DIRECTORIES(${PNG_PNG_INCLUDE_DIR})
set (dlib_needed_libraries ${dlib_needed_libraries} ${PNG_LIBRARY})
add_global_define(DLIB_PNG_SUPPORT)
else()
# we could print a message but doing so is sort of irritating when it occurs by default
#message(" *************************************************************************")
#message(" ****** PNG IMAGE FILE SUPPORT NOT ENABLED BECAUSE libpng NOT FOUND ******")
#message(" ****** Make sure libpng is installed if you want PNG support ******")
#message(" *************************************************************************")
endif()
TARGET_LINK_LIBRARIES(dlib ${dlib_needed_libraries} )
ENDIF ()
#test for some things that really should be true about the compiler
INCLUDE(TestForSTDNamespace)
INCLUDE(TestForANSIStreamHeaders)
if (DLIB_ISO_CPP_ONLY)
set(DLIB_NO_GUI_SUPPORT ON CACHE STRING ${DLIB_NO_GUI_SUPPORT_STR} FORCE )
add_global_define(DLIB_ISO_CPP_ONLY)
else()
remove_global_define(DLIB_ISO_CPP_ONLY)
endif()
if (DLIB_NO_GUI_SUPPORT)
add_global_define(DLIB_NO_GUI_SUPPORT)
else()
remove_global_define(DLIB_NO_GUI_SUPPORT)
endif()
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute,
execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to
do so, all subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer,
must be included in all copies of the Software, in whole or in part, and
all derivative works of the Software, unless such copies or derivative
works are solely in the form of machine-executable object code generated by
a source language processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
\ No newline at end of file
dlib C++ library
This project is a modern C++ library with a focus on portability
and program correctness. It strives to be easy to use right and
hard to use wrong. Thus, it comes with extensive documentation and
thorough debugging modes. The library provides a platform abstraction
layer for common tasks such as interfacing with network services,
handling threads, or creating graphical user interfaces. Additionally,
the library implements many useful algorithms such as data compression
routines, linked lists, binary search trees, linear algebra and matrix
utilities, machine learning algorithms, XML and text parsing, and many
other general utilities.
Documentation:
There should be HTML documentation accompanying this library. But
if there isn't you can download it from http://dclib.sourceforge.net
Installation :
To use this library all you have to do is extract the library
somewhere, make sure the folder *containing* the dlib folder is in
your include path, and finally add dlib/all/source.cpp to your
project.
An example makefile that uses this library can be found here:
dlib/test/makefile. It is the makefile used to build the regression
test suite for this library. There is also a CMake makefile that
builds the regression test suite at dlib/test/CMakeLists.txt and
another CMake makefile that builds all the example programs in
the examples folder.
For further information see the accompanying HTML documentation or
visit http://dclib.sourceforge.net
The license for this library can be found in LICENSE.txt. But the
long and short of the license is that you can use this code however
you like, even in closed source commercial software.
This diff is collapsed.
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ALL_SOURCe_
#define DLIB_ALL_SOURCe_
// ISO C++ code
#include "../base64/base64_kernel_1.cpp"
#include "../bigint/bigint_kernel_1.cpp"
#include "../bigint/bigint_kernel_2.cpp"
#include "../bit_stream/bit_stream_kernel_1.cpp"
#include "../entropy_decoder/entropy_decoder_kernel_1.cpp"
#include "../entropy_decoder/entropy_decoder_kernel_2.cpp"
#include "../entropy_encoder/entropy_encoder_kernel_1.cpp"
#include "../entropy_encoder/entropy_encoder_kernel_2.cpp"
#include "../md5/md5_kernel_1.cpp"
#include "../pixel.cpp"
#include "../tokenizer/tokenizer_kernel_1.cpp"
#ifndef DLIB_ISO_CPP_ONLY
// Code that depends on OS specific APIs
// include this first so that it can disable the older version
// of the winsock API when compiled in windows.
#include "../sockets/sockets_kernel_1.cpp"
#include "../dir_nav/dir_nav_kernel_1.cpp"
#include "../dir_nav/dir_nav_kernel_2.cpp"
#include "../linker/linker_kernel_1.cpp"
#include "../logger/extra_logger_headers.cpp"
#include "../logger/logger_kernel_1.cpp"
#include "../logger/logger_config_file.cpp"
#include "../misc_api/misc_api_kernel_1.cpp"
#include "../misc_api/misc_api_kernel_2.cpp"
#include "../sockets/sockets_extensions.cpp"
#include "../sockets/sockets_kernel_2.cpp"
#include "../sockstreambuf/sockstreambuf_kernel_1.cpp"
#include "../sockstreambuf/sockstreambuf_kernel_2.cpp"
#include "../threads/multithreaded_object_extension.cpp"
#include "../threads/threaded_object_extension.cpp"
#include "../threads/threads_kernel_1.cpp"
#include "../threads/threads_kernel_2.cpp"
#include "../threads/threads_kernel_shared.cpp"
#include "../timer/timer_kernel_2.cpp"
#ifdef DLIB_PNG_SUPPORT
#include "../image_loader/png_loader.cpp"
#endif
#ifndef DLIB_NO_GUI_SUPPORT
#include "../gui_widgets/fonts.cpp"
#include "../gui_widgets/widgets.cpp"
#include "../gui_widgets/drawable.cpp"
#include "../gui_widgets/canvas_drawing.cpp"
#include "../gui_widgets/style.cpp"
#include "../gui_widgets/base_widgets.cpp"
#include "../gui_core/gui_core_kernel_1.cpp"
#include "../gui_core/gui_core_kernel_2.cpp"
#endif // DLIB_NO_GUI_SUPPORT
#endif // DLIB_ISO_CPP_ONLY
#endif // DLIB_ALL_SOURCe_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ALL_CONSOLe_
#define DLIB_ALL_CONSOLe_
#error "This file has been replaced. Instead you should add dlib/all/source.cpp to your project"
#endif // DLIB_ALL_CONSOLe_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ALL_GUi_
#define DLIB_ALL_GUi_
#error "This file has been replaced. Instead you should add dlib/all/source.cpp to your project"
#endif // DLIB_ALL_GUi_
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAy_
#define DLIB_ARRAy_
#include "array/array_kernel_1.h"
#include "array/array_kernel_2.h"
#include "array/array_kernel_c.h"
#include "array/array_sort_1.h"
#include "array/array_sort_2.h"
#include "array/array_expand_1.h"
#include "array/array_expand_c.h"
#include "memory_manager.h"
namespace dlib
{
template <
typename T,
typename mem_manager = memory_manager<char>::kernel_1a
>
class array
{
array() {}
public:
//----------- kernels ---------------
// kernel_1a
typedef array_kernel_1<T,mem_manager>
kernel_1a;
typedef array_kernel_c<kernel_1a >
kernel_1a_c;
// kernel_2a
typedef array_kernel_2<T,mem_manager>
kernel_2a;
typedef array_kernel_c<kernel_2a >
kernel_2a_c;
//---------- extensions ------------
// sort_1 extend kernel_1a
typedef array_sort_1<kernel_1a>
sort_1a;
typedef array_sort_1<kernel_1a_c>
sort_1a_c;
// sort_1 extend kernel_2a
typedef array_sort_1<kernel_2a>
sort_1b;
typedef array_sort_1<kernel_2a_c>
sort_1b_c;
// sort_2 extend kernel_1a
typedef array_sort_2<kernel_1a>
sort_2a;
typedef array_sort_2<kernel_1a_c>
sort_2a_c;
// sort_2 extend kernel_2a
typedef array_sort_2<kernel_2a>
sort_2b;
typedef array_sort_2<kernel_2a_c>
sort_2b_c;
// expand_1 extend sort_1a
typedef array_expand_1<sort_1a>
expand_1a;
typedef array_expand_c<array_kernel_c<expand_1a> >
expand_1a_c;
// expand_1 extend sort_1b
typedef array_expand_1<sort_1b>
expand_1b;
typedef array_expand_c<array_kernel_c<expand_1b> >
expand_1b_c;
// expand_1 extend sort_2a
typedef array_expand_1<sort_2a>
expand_1c;
typedef array_expand_c<array_kernel_c<expand_1c> >
expand_1c_c;
// expand_1 extend sort_2b
typedef array_expand_1<sort_2b>
expand_1d;
typedef array_expand_c<array_kernel_c<expand_1d> >
expand_1d_c;
};
}
#endif // DLIB_ARRAy_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY_EXPANd_1_
#define DLIB_ARRAY_EXPANd_1_
#include "array_expand_abstract.h"
namespace dlib
{
template <
typename array_base
>
class array_expand_1 : public array_base
{
typedef typename array_base::type T;
public:
void expand (
unsigned long new_size
);
const T& back (
) const;
T& back (
);
void pop_back (
);
void pop_back (
T& item
);
void push_back (
T& item
);
};
template <
typename array_base
>
inline void swap (
array_expand_1<array_base>& a,
array_expand_1<array_base>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_expand_1<array_base>::
expand (
unsigned long new_size
)
{
if (this->max_size() < new_size)
{
array_base temp;
temp.set_max_size(new_size);
temp.set_size(new_size);
for (unsigned long i = 0; i < this->size(); ++i)
{
exchange((*this)[i],temp[i]);
}
temp.swap(*this);
}
else
{
this->set_size(new_size);
}
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
typename array_base::type& array_expand_1<array_base>::
back (
)
{
return (*this)[this->size()-1];
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
const typename array_base::type& array_expand_1<array_base>::
back (
) const
{
return (*this)[this->size()-1];
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_expand_1<array_base>::
pop_back (
typename array_base::type& item
)
{
exchange(item,(*this)[this->size()-1]);
this->set_size(this->size()-1);
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_expand_1<array_base>::
pop_back (
)
{
this->set_size(this->size()-1);
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_expand_1<array_base>::
push_back (
typename array_base::type& item
)
{
if (this->max_size() == this->size())
{
// double the size of the array
array_base temp;
temp.set_max_size(this->size()*2 + 1);
temp.set_size(this->size()+1);
for (unsigned long i = 0; i < this->size(); ++i)
{
exchange((*this)[i],temp[i]);
}
exchange(item,temp[temp.size()-1]);
temp.swap(*this);
}
else
{
this->set_size(this->size()+1);
exchange(item,(*this)[this->size()-1]);
}
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY_EXPANd_1_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_ARRAY_EXPANd_ABSTRACT_
#ifdef DLIB_ARRAY_EXPANd_ABSTRACT_
#include "array_kernel_abstract.h"
namespace dlib
{
template <
typename array_base
>
class array_expand : public array_base
{
/*!
REQUIREMENTS ON ARRAY_BASE
must be an implementation of array/array_kernel_abstract.h
POINTERS AND REFERENCES
expand() may invalidate pointers and references to internal data.
WHAT THIS EXTENSION DOES FOR ARRAY
This extension gives an array the ability to expand its size() beyond
its max_size() without clearing out all its elements. It also adds
a std::vector style push/pop back set of functions.
!*/
typedef typename array_base::type T;
public:
void expand (
unsigned long new_size
);
/*!
ensures
- #size() == new_size
- #max_size() == max(new_size,max_size())
- for all i < size():
- #(*this)[i] == (*this)[i]
(i.e. all the original elements of *this are still present
and at their same positions.)
- for all valid i >= size():
- #(*this)[i] has an undefined value
(i.e. any new elements of the array have an undefined value)
throws
- std::bad_alloc or any exception thrown by T's constructor.
If an exception is thrown then it has no effect on *this.
!*/
const T& back (
) const;
/*!
requires
- size() != 0
ensures
- returns a const reference to (*this)[size()-1]
!*/
T& back (
);
/*!
requires
- size() != 0
ensures
- returns a non-const reference to (*this)[size()-1]
!*/
void pop_back (
T& item
);
/*!
requires
- size() != 0
ensures
- #size() == size() - 1
- swaps (*this)[size()-1] into item
- All elements with an index less than size()-1 are
unmodified by this operation.
!*/
void pop_back (
);
/*!
requires
- size() != 0
ensures
- #size() == size() - 1
- All elements with an index less than size()-1 are
unmodified by this operation.
!*/
void push_back (
T& item
);
/*!
ensures
- #size() == size()+1
- swaps item into (*this)[#size()-1]
- #back() == item
- #item has some undefined value (whatever happens to
get swapped out of the array)
throws
- std::bad_alloc or any exception thrown by T's constructor.
If an exception is thrown then it has no effect on *this.
!*/
};
template <
typename array_base
>
inline void swap (
array_expand<array_base>& a,
array_expand<array_base>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
}
#endif // DLIB_ARRAY_EXPANd_ABSTRACT_
// Copyright (C) 2008 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY_EXPAND_C_
#define DLIB_ARRAY_EXPAND_C_
#include "array_expand_abstract.h"
#include "../algs.h"
#include "../assert.h"
namespace dlib
{
template <
typename array_base
>
class array_expand_c : public array_base
{
typedef typename array_base::type T;
public:
const T& back (
) const;
T& back (
);
void pop_back (
);
void pop_back (
T& item
);
};
template <
typename array_base
>
inline void swap (
array_expand_c<array_base>& a,
array_expand_c<array_base>& b
) { a.swap(b); }
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
typename array_base::type& array_expand_c<array_base>::
back (
)
{
// make sure requires clause is not broken
DLIB_CASSERT( this->size() > 0 ,
"\tT& array_expand::back()"
<< "\n\tsize() must be bigger than 0"
<< "\n\tsize(): " << this->size()
<< "\n\tthis: " << this
);
// call the real function
return array_base::back();
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
const typename array_base::type& array_expand_c<array_base>::
back (
) const
{
// make sure requires clause is not broken
DLIB_CASSERT( this->size() > 0 ,
"\tconst T& array_expand::back()"
<< "\n\tsize() must be bigger than 0"
<< "\n\tsize(): " << this->size()
<< "\n\tthis: " << this
);
// call the real function
return array_base::back();
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_expand_c<array_base>::
pop_back (
)
{
// make sure requires clause is not broken
DLIB_CASSERT( this->size() > 0 ,
"\tvoid array_expand::pop_back()"
<< "\n\tsize() must be bigger than 0"
<< "\n\tsize(): " << this->size()
<< "\n\tthis: " << this
);
// call the real function
return array_base::pop_back();
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_expand_c<array_base>::
pop_back (
typename array_base::type& item
)
{
// make sure requires clause is not broken
DLIB_CASSERT( this->size() > 0 ,
"\tvoid array_expand::pop_back()"
<< "\n\tsize() must be bigger than 0"
<< "\n\tsize(): " << this->size()
<< "\n\tthis: " << this
);
// call the real function
return array_base::pop_back(item);
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY_EXPAND_C_
This diff is collapsed.
This diff is collapsed.
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_ARRAY_KERNEl_ABSTRACT_
#ifdef DLIB_ARRAY_KERNEl_ABSTRACT_
#include "../interfaces/enumerable.h"
#include "../serialize.h"
#include "../memory_manager/memory_manager_kernel_abstract.h"
namespace dlib
{
template <
typename T,
typename mem_manager = memory_manager<char>::kernel_1a
>
class array : public enumerable<T>
{
/*!
REQUIREMENTS ON T
T must have a default constructor.
REQUIREMENTS ON mem_manager
must be an implementation of memory_manager/memory_manager_kernel_abstract.h or
must be an implementation of memory_manager_global/memory_manager_global_kernel_abstract.h or
must be an implementation of memory_manager_stateless/memory_manager_stateless_kernel_abstract.h
mem_manager::type can be set to anything.
POINTERS AND REFERENCES TO INTERNAL DATA
swap(), max_size(), set_size(), and operator[] functions do
not invalidate pointers or references to internal data.
All other functions have no such guarantee.
INITIAL VALUE
size() == 0
max_size() == 0
ENUMERATION ORDER
The enumerator will iterate over the elements of the array in the
order (*this)[0], (*this)[1], (*this)[2], ...
WHAT THIS OBJECT REPRESENTS
array contains items of type T
This object represents an ordered array of items, each item is
associated with an integer value.
The items are numbered from 0 though size() - 1 and
the operator[] functions run in constant time
!*/
public:
typedef T type;
typedef mem_manager mem_manager_type;
array (
);
/*!
ensures
- #*this is properly initialized
throws
- std::bad_alloc or any exception thrown by T's constructor
!*/
virtual ~array (
);
/*!
ensures
- all memory associated with *this has been released
!*/
void clear (
);
/*!
ensures
- #*this has its initial value
throws
- std::bad_alloc or any exception thrown by T's constructor
if this exception is thrown then the array object is unusable
until clear() is called and succeeds
!*/
const T& operator[] (
unsigned long pos
) const;
/*!
requires
- pos < size()
ensures
- returns a const reference to the element at position pos
!*/
T& operator[] (
unsigned long pos
);
/*!
requires
- pos < size()
ensures
- returns a non-const reference to the element at position pos
!*/
void set_size (
unsigned long size
);
/*!
requires
- size <= max_size()
ensures
- #size() == size
- any element with index between 0 and size - 1 which was in the
array before the call to set_size() retains its value and index.
All other elements have undetermined (but valid for their type)
values. (e.g. this object might buffer old T objects and reuse
them without reinitializing them between calls to set_size())
- #at_start() == true
throws
- std::bad_alloc or any exception thrown by T's constructor
may throw this exception if there is not enough memory and
if it does throw then the call to set_size() has no effect
!*/
unsigned long max_size(
) const;
/*!
ensures
- returns the maximum size of *this
!*/
void set_max_size(
unsigned long max
);
/*!
ensures
- #max_size() == max
- #size() == 0
- #at_start() == true
throws
- std::bad_alloc or any exception thrown by T's constructor
may throw this exception if there is not enough
memory and if it does throw then max_size() == 0
!*/
void swap (
array<T>& item
);
/*!
ensures
- swaps *this and item
!*/
private:
// restricted functions
array(array<T>&); // copy constructor
array<T>& operator=(array<T>&); // assignment operator
};
template <
typename T
>
inline void swap (
array<T>& a,
array<T>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
template <
typename T
>
void serialize (
const array<T>& item,
std::ostream& out
);
/*!
provides serialization support
!*/
template <
typename T
>
void deserialize (
array<T>& item,
std::istream& in
);
/*!
provides deserialization support
!*/
}
#endif // DLIB_ARRAY_KERNEl_ABSTRACT_
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY_KERNEl_C_
#define DLIB_ARRAY_KERNEl_C_
#include "array_kernel_abstract.h"
#include "../algs.h"
#include "../assert.h"
namespace dlib
{
template <
typename array_base
>
class array_kernel_c : public array_base
{
typedef typename array_base::type T;
public:
const T& operator[] (
unsigned long pos
) const;
T& operator[] (
unsigned long pos
);
void set_size (
unsigned long size
);
const T& element (
) const;
T& element(
);
};
template <
typename array_base
>
inline void swap (
array_kernel_c<array_base>& a,
array_kernel_c<array_base>& b
) { a.swap(b); }
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
const typename array_base::type& array_kernel_c<array_base>::
operator[] (
unsigned long pos
) const
{
// make sure requires clause is not broken
DLIB_CASSERT( pos < this->size() ,
"\tconst T& array::operator[]"
<< "\n\tpos must < size()"
<< "\n\tpos: " << pos
<< "\n\tsize(): " << this->size()
<< "\n\tthis: " << this
);
// call the real function
return array_base::operator[](pos);
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
typename array_base::type& array_kernel_c<array_base>::
operator[] (
unsigned long pos
)
{
// make sure requires clause is not broken
DLIB_CASSERT( pos < this->size() ,
"\tT& array::operator[]"
<< "\n\tpos must be < size()"
<< "\n\tpos: " << pos
<< "\n\tsize(): " << this->size()
<< "\n\tthis: " << this
);
// call the real function
return array_base::operator[](pos);
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_kernel_c<array_base>::
set_size (
unsigned long size
)
{
// make sure requires clause is not broken
DLIB_CASSERT(( size <= this->max_size() ),
"\tvoid array::set_size"
<< "\n\tsize must be <= max_size()"
<< "\n\tsize: " << size
<< "\n\tmax size: " << this->max_size()
<< "\n\tthis: " << this
);
// call the real function
array_base::set_size(size);
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
const typename array_base::type& array_kernel_c<array_base>::
element (
) const
{
// make sure requires clause is not broken
DLIB_CASSERT(this->current_element_valid(),
"\tconst T& array::element()"
<< "\n\tThe current element must be valid if you are to access it."
<< "\n\tthis: " << this
);
// call the real function
return array_base::element();
}
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
typename array_base::type& array_kernel_c<array_base>::
element (
)
{
// make sure requires clause is not broken
DLIB_CASSERT(this->current_element_valid(),
"\tT& array::element()"
<< "\n\tThe current element must be valid if you are to access it."
<< "\n\tthis: " << this
);
// call the real function
return array_base::element();
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY_KERNEl_C_
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY_SORt_1_
#define DLIB_ARRAY_SORt_1_
#include "array_sort_abstract.h"
#include "../algs.h"
#include "../sort.h"
namespace dlib
{
template <
typename array_base
>
class array_sort_1 : public array_base
{
typedef typename array_base::type T;
public:
/*!
this is a median of three version of the QuickSort algorithm and
it swaps the entire array into a temporary C style array and sorts that and
this uses the dlib::qsort_array function
!*/
void sort (
);
};
template <
typename array_base
>
inline void swap (
array_sort_1<array_base>& a,
array_sort_1<array_base>& b
) { a.swap(b); }
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_sort_1<array_base>::
sort (
)
{
if (this->size() > 1)
{
T* temp = new T[this->size()];
for (unsigned long i = 0; i < this->size(); ++i)
exchange(temp[i],(*this)[i]);
// call the quick sort function for arrays that is in algs.h
dlib::qsort_array(temp,0,this->size()-1);
for (unsigned long i = 0; i < this->size(); ++i)
exchange((*this)[i],temp[i]);
delete [] temp;
}
this->reset();
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY_SORt_1_
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY_SORt_2_
#define DLIB_ARRAY_SORt_2_
#include "array_sort_abstract.h"
#include "../algs.h"
#include "../sort.h"
namespace dlib
{
template <
typename array_base
>
class array_sort_2 : public array_base
{
public:
/*!
this is a median of three version of the QuickSort algorithm and
this uses the dlib::qsort_array function
!*/
void sort (
);
};
template <
typename array_base
>
inline void swap (
array_sort_2<array_base>& a,
array_sort_2<array_base>& b
) { a.swap(b); }
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename array_base
>
void array_sort_2<array_base>::
sort (
)
{
if (this->size() > 1)
{
// call the quick sort function for arrays that is in algs.h
dlib::qsort_array(*this,0,this->size()-1);
}
this->reset();
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY_SORt_2_
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_ARRAY_SORt_ABSTRACT_
#ifdef DLIB_ARRAY_SORt_ABSTRACT_
#include "array_kernel_abstract.h"
namespace dlib
{
template <
typename array_base
>
class array_sort : public array_base
{
/*!
REQUIREMENTS ON ARRAY_BASE
must be an implementation of array/array_kernel_abstract.h
POINTERS AND REFERENCES
sort() may invalidate pointers and references to internal data.
WHAT THIS EXTENSION DOES FOR ARRAY
This gives an array the ability to sort its contents by calling sort().
!*/
public:
void sort (
);
/*!
ensures
- for all elements in #*this the ith element is <= the i+1 element
- #at_start() == true
throws
- std::bad_alloc or any exception thrown by T's constructor
data may be lost if sort() throws
!*/
};
template <
typename array_base
>
inline void swap (
array_sort<array_base>& a,
array_sort<array_base>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
}
#endif // DLIB_ARRAY_SORt_ABSTRACT_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY2d_
#define DLIB_ARRAY2d_
#include "array2d/array2d_kernel_1.h"
#include "array2d/array2d_kernel_c.h"
#include "memory_manager.h"
namespace dlib
{
template <
typename T,
typename mem_manager = memory_manager<char>::kernel_1a
>
class array2d
{
array2d() {}
public:
//----------- kernels ---------------
// kernel_1a
typedef array2d_kernel_1<T,mem_manager>
kernel_1a;
typedef array2d_kernel_c<kernel_1a>
kernel_1a_c;
};
}
#endif // DLIB_ARRAY2d_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY2D_KERNEl_1_
#define DLIB_ARRAY2D_KERNEl_1_
#include "array2d_kernel_abstract.h"
#include "../algs.h"
#include "../interfaces/enumerable.h"
#include "../serialize.h"
#include "../memory_manager.h"
namespace dlib
{
template <
typename T,
typename mem_manager = memory_manager<char>::kernel_1a
>
class array2d_kernel_1 : public enumerable<T>
{
/*!
INITIAL VALUE
- nc_ == 0
- nr_ == 0
- data == 0
- rows == 0
- at_start_ == true
- cur == 0
- last == 0
CONVENTION
- nc_ == nc()
- nr_ == nc()
- if (data != 0) then
- last == a pointer to the last element in the data array
- data == pointer to an array of nc_*nr_ T objects
- rows == pointer to an array of nr_ row objects
- for all x < nr_:
- rows[x].data == data + x*nc_
- rows[x].nc_ == nc_
- else
- nc_ == 0
- nr_ == 0
- data == 0
- rows == 0
- last == 0
- nr_ * nc_ == size()
- if (cur == 0) then
- current_element_valid() == false
- else
- current_element_valid() == true
- *cur == element()
- at_start_ == at_start()
!*/
class row_helper;
public:
typedef T type;
typedef mem_manager mem_manager_type;
// -----------------------------------
class row
{
/*!
CONVENTION
- nc_ == nc()
- for all x < nc_:
- (*this)[x] == data[x]
!*/
friend class array2d_kernel_1;
friend class row_helper;
public:
long nc (
) const { return nc_; }
const T& operator[] (
long column
) const { return data[column]; }
T& operator[] (
long column
) { return data[column]; }
private:
long nc_;
T* data;
// restricted functions
row(){}
row(row&);
row& operator=(row&);
};
// -----------------------------------
array2d_kernel_1 (
) :
nc_(0),
nr_(0),
rows(0),
data(0),
cur(0),
last(0),
at_start_(true)
{
}
virtual ~array2d_kernel_1 (
) { clear(); }
long nc (
) const { return nc_; }
long nr (
) const { return nr_; }
row& operator[] (
long row
) { return rows[row]; }
const row& operator[] (
long row
) const { return rows[row]; }
void swap (
array2d_kernel_1& item
)
{
exchange(data,item.data);
exchange(rows,item.rows);
exchange(nr_,item.nr_);
exchange(nc_,item.nc_);
exchange(at_start_,item.at_start_);
exchange(cur,item.cur);
exchange(last,item.last);
pool.swap(item.pool);
rpool.swap(item.rpool);
}
void clear (
)
{
if (data != 0)
{
rpool.deallocate_array(reinterpret_cast<row_helper*>(rows));
pool.deallocate_array(data);
nc_ = 0;
nr_ = 0;
rows = 0;
data = 0;
at_start_ = true;
cur = 0;
last = 0;
}
}
void set_size (
long nr__,
long nc__
);
bool at_start (
) const { return at_start_; }
void reset (
) const { at_start_ = true; cur = 0; }
bool current_element_valid (
) const { return (cur != 0); }
const T& element (
) const { return *cur; }
T& element (
) { return *cur; }
bool move_next (
) const
{
if (cur != 0)
{
if (cur != last)
{
++cur;
return true;
}
cur = 0;
return false;
}
else if (at_start_)
{
cur = data;
at_start_ = false;
return (data != 0);
}
else
{
return false;
}
}
unsigned long size (
) const { return static_cast<unsigned long>(nc_ * nr_); }
private:
// this object exists just so we can have a row type object that
// has a public default constructor so the memory_manager can construct it.
// I would have made rpool a friend of row but some compilers can't handle
// that without crapping out.
class row_helper : public row {};
typename mem_manager::template rebind<T>::other pool;
typename mem_manager::template rebind<row_helper>::other rpool;
long nc_;
long nr_;
row* rows;
T* data;
mutable T* cur;
T* last;
mutable bool at_start_;
// restricted functions
array2d_kernel_1(array2d_kernel_1&); // copy constructor
array2d_kernel_1& operator=(array2d_kernel_1&); // assignment operator
};
// ----------------------------------------------------------------------------------------
template <
typename T,
typename mem_manager
>
inline void swap (
array2d_kernel_1<T,mem_manager>& a,
array2d_kernel_1<T,mem_manager>& b
) { a.swap(b); }
template <
typename T,
typename mem_manager
>
void serialize (
const array2d_kernel_1<T,mem_manager>& item,
std::ostream& out
)
{
try
{
serialize(item.nc(),out);
serialize(item.nr(),out);
item.reset();
while (item.move_next())
serialize(item.element(),out);
item.reset();
}
catch (serialization_error e)
{
throw serialization_error(e.info + "\n while serializing object of type array2d_kernel_1");
}
}
template <
typename T
>
void deserialize (
array2d_kernel_1<T>& item,
std::istream& in
)
{
try
{
long nc, nr;
deserialize(nc,in);
deserialize(nr,in);
item.set_size(nr,nc);
while (item.move_next())
deserialize(item.element(),in);
item.reset();
}
catch (serialization_error e)
{
item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d_kernel_1");
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename T,
typename mem_manager
>
void array2d_kernel_1<T,mem_manager>::
set_size (
long nr__,
long nc__
)
{
// set the enumerator back at the start
at_start_ = true;
cur = 0;
// don't do anything if we are already the right size.
if (nc_ == nc__ && nr_ == nr__)
{
return;
}
nc_ = nc__;
nr_ = nr__;
// free any existing memory
if (data != 0)
{
pool.deallocate_array(data);
rpool.deallocate_array(reinterpret_cast<row_helper*>(rows));
data = 0;
rows = 0;
}
// now setup this object to have the new size
try
{
if (nr_ > 0)
{
rows = rpool.allocate_array(nr_);
data = pool.allocate_array(nr_*nc_);
last = data + nr_*nc_ - 1;
}
}
catch (...)
{
if (rows)
rpool.deallocate_array(reinterpret_cast<row_helper*>(rows));
if (data)
pool.deallocate_array(data);
rows = 0;
data = 0;
nc_ = 0;
nr_ = 0;
last = 0;
throw;
}
// now set up all the rows
for (long i = 0; i < nr_; ++i)
{
rows[i].nc_ = nc_;
rows[i].data = data + i*nc_;
}
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY2D_KERNEl_1_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_ARRAY2D_KERNEl_ABSTRACT_
#ifdef DLIB_ARRAY2D_KERNEl_ABSTRACT_
#include "../interfaces/enumerable.h"
#include "../serialize.h"
#include "../memory_manager/memory_manager_kernel_abstract.h"
namespace dlib
{
template <
typename T,
typename mem_manager = memory_manager<char>::kernel_1a
>
class array2d : public enumerable<T>
{
/*!
REQUIREMENTS ON T
T must have a default constructor.
REQUIREMENTS ON mem_manager
must be an implementation of memory_manager/memory_manager_kernel_abstract.h or
must be an implementation of memory_manager_global/memory_manager_global_kernel_abstract.h or
must be an implementation of memory_manager_stateless/memory_manager_stateless_kernel_abstract.h
mem_manager::type can be set to anything.
POINTERS AND REFERENCES TO INTERNAL DATA
No member functions in this object will invalidate pointers
or references to internal data except for the set_size()
and clear() member functions.
INITIAL VALUE
nr() == 0
nc() == 0
ENUMERATION ORDER
The enumerator will iterate over the elements of the array starting
with row 0 and then proceeding to row 1 and so on. Each row will be
fully enumerated before proceeding on to the next row and the elements
in a row will be enumerated beginning with the 0th column, then the 1st
column and so on.
WHAT THIS OBJECT REPRESENTS
This object represents a 2-Dimensional array of objects of
type T.
!*/
public:
// ----------------------------------------
typedef T type;
typedef mem_manager mem_manager_type;
// ----------------------------------------
class row
{
/*!
POINTERS AND REFERENCES TO INTERNAL DATA
No member functions in this object will invalidate pointers
or references to internal data.
WHAT THIS OBJECT REPRESENTS
This object represents a row of Ts in an array2d object.
!*/
public:
long nc (
) const;
/*!
ensures
- returns the number of columns in this row
!*/
const T& operator[] (
long column
) const;
/*!
requires
- 0 <= column < nc()
ensures
- returns a const reference to the T in the given column
!*/
T& operator[] (
long column
);
/*!
requires
- 0 <= column < nc()
ensures
- returns a non-const reference to the T in the given column
!*/
private:
// restricted functions
row();
row(row&);
row& operator=(row&);
};
// ----------------------------------------
array2d (
);
/*!
ensures
- #*this is properly initialized
throws
- std::bad_alloc
!*/
virtual ~array2d (
);
/*!
ensures
- all resources associated with *this has been released
!*/
void clear (
);
/*!
ensures
- #*this has an initial value for its type
!*/
long nc (
) const;
/*!
ensures
- returns the number of elements there are in a row. i.e. returns
the number of columns in *this
!*/
long nr (
) const;
/*!
ensures
- returns the number of rows in *this
!*/
void set_size (
long rows,
long cols
);
/*!
requires
- cols > 0 && rows > 0 or
cols == 0 && rows == 0
ensures
- #nc() == cols
- #nr() == rows
- #at_start() == true
- if (the call to set_size() doesn't change the dimensions of this array) then
- all elements in this array retain their values from before this function was called
- else
- all elements in this array have initial values for their type
throws
- std::bad_alloc
If this exception is thrown then #*this will have an initial
value for its type.
!*/
row& operator[] (
long row_index
);
/*!
requires
- 0 <= row_index < nr()
ensures
- returns a non-const row of nc() elements that represents the
given row_index'th row in *this.
!*/
const row& operator[] (
long row_index
) const;
/*!
requires
- 0 <= row_index < nr()
ensures
- returns a const row of nc() elements that represents the
given row_index'th row in *this.
!*/
void swap (
array2d& item
);
/*!
ensures
- swaps *this and item
!*/
private:
// restricted functions
array2d(array2d&); // copy constructor
array2d& operator=(array2d&); // assignment operator
};
template <
typename T
>
inline void swap (
array2d<T>& a,
array2d<T>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
template <
typename T
>
void serialize (
const array2d<T>& item,
std::ostream& out
);
/*!
provides serialization support
!*/
template <
typename T
>
void deserialize (
array2d<T>& item,
std::istream& in
);
/*!
provides deserialization support
!*/
}
#endif // DLIB_ARRAY2D_KERNEl_ABSTRACT_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ARRAY2D_KERNEl_C_
#define DLIB_ARRAY2D_KERNEl_C_
#include "array2d_kernel_abstract.h"
#include "../algs.h"
#include "../assert.h"
#include "../interfaces/enumerable.h"
namespace dlib
{
template <
typename array2d_base // is an implementation of array2d_kernel_abstract.h
>
class array2d_kernel_c : public enumerable<typename array2d_base::type>
{
/*!
CONVENTION
- if (obj.size() > 0) then
- rows == an array of size obj.nr() row objects and
each row object in the array has a valid pointer to its
associated row in obj.
- else
- rows == 0
!*/
typedef typename array2d_base::type T;
public:
typedef typename array2d_base::type type;
typedef typename array2d_base::mem_manager_type mem_manager_type;
// -----------------------------------
class row
{
friend class array2d_kernel_c;
public:
long nc (
) const { return data->nc(); }
const T& operator[] (
long column
) const;
T& operator[] (
long column
);
private:
typename array2d_base::row* data;
// restricted functions
row(){}
row(row&);
row& operator=(row&);
};
// -----------------------------------
array2d_kernel_c (
) :
rows(0)
{
}
virtual ~array2d_kernel_c (
) { clear(); }
long nc (
) const { return obj.nc(); }
long nr (
) const { return obj.nr(); }
row& operator[] (
long row
);
const row& operator[] (
long row
) const;
void swap (
array2d_kernel_c& item
)
{
exchange(obj,item.obj);
exchange(rows,item.rows);
}
void clear (
)
{
obj.clear();
if (rows != 0)
{
delete [] rows;
rows = 0;
}
}
void set_size (
long nr__,
long nc__
);
bool at_start (
) const { return obj.at_start();; }
void reset (
) const { obj.reset(); }
bool current_element_valid (
) const { return obj.current_element_valid(); }
const T& element (
) const;
T& element (
);
bool move_next (
) const { return obj.move_next(); }
unsigned long size (
) const { return obj.size(); }
private:
array2d_base obj;
row* rows;
};
template <
typename array2d_base
>
inline void swap (
array2d_kernel_c<array2d_base>& a,
array2d_kernel_c<array2d_base>& b
) { a.swap(b); }
template <
typename array2d_base
>
void serialize (
const array2d_kernel_c<array2d_base>& item,
std::ostream& out
)
{
try
{
serialize(item.nc(),out);
serialize(item.nr(),out);
item.reset();
while (item.move_next())
serialize(item.element(),out);
item.reset();
}
catch (serialization_error e)
{
throw serialization_error(e.info + "\n while serializing object of type array2d_kernel_c");
}
}
template <
typename array2d_base
>
void deserialize (
array2d_kernel_c<array2d_base>& item,
std::istream& in
)
{
try
{
long nc, nr;
deserialize(nc,in);
deserialize(nr,in);
item.set_size(nr,nc);
while (item.move_next())
deserialize(item.element(),in);
item.reset();
}
catch (serialization_error e)
{
item.clear();
throw serialization_error(e.info + "\n while deserializing object of type array2d_kernel_c");
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// member function definitions
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
template <
typename array2d_base
>
const typename array2d_base::type& array2d_kernel_c<array2d_base>::
element (
) const
{
// make sure requires clause is not broken
DLIB_CASSERT(current_element_valid() == true,
"\tT& array2d::element()()"
<< "\n\tYou can only call element() when you are at a valid one."
<< "\n\tthis: " << this
);
return obj.element();
}
// ----------------------------------------------------------------------------------------
template <
typename array2d_base
>
typename array2d_base::type& array2d_kernel_c<array2d_base>::
element (
)
{
// make sure requires clause is not broken
DLIB_CASSERT(current_element_valid() == true,
"\tT& array2d::element()()"
<< "\n\tYou can only call element() when you are at a valid one."
<< "\n\tthis: " << this
);
return obj.element();
}
// ----------------------------------------------------------------------------------------
template <
typename array2d_base
>
void array2d_kernel_c<array2d_base>::
set_size (
long nr_,
long nc_
)
{
// make sure requires clause is not broken
DLIB_CASSERT(nc_ > 0 && nr_ > 0 ||
nc_ == 0 && nr_ == 0,
"\tvoid array2d::set_size(long nr_, long nc_)"
<< "\n\tYou have to give a non zero nc and nr or just make both zero."
<< "\n\tthis: " << this
<< "\n\tnc_: " << nc_
<< "\n\tnr_: " << nr_
);
obj.set_size(nr_,nc_);
// set up the rows array
if (rows != 0)
delete [] rows;
try
{
rows = new row[obj.nr()];
}
catch (...)
{
rows = 0;
obj.clear();
throw;
}
for (long i = 0; i < obj.nr(); ++i)
{
rows[i].data = &obj[i];
}
}
// ----------------------------------------------------------------------------------------
template <
typename array2d_base
>
typename array2d_kernel_c<array2d_base>::row& array2d_kernel_c<array2d_base>::
operator[] (
long row
)
{
// make sure requires clause is not broken
DLIB_CASSERT(row < nr() && row >= 0,
"\trow& array2d::operator[](long row)"
<< "\n\tThe row index given must be less than the number of rows."
<< "\n\tthis: " << this
<< "\n\trow: " << row
<< "\n\tnr(): " << nr()
);
return rows[row];
}
// ----------------------------------------------------------------------------------------
template <
typename array2d_base
>
const typename array2d_kernel_c<array2d_base>::row& array2d_kernel_c<array2d_base>::
operator[] (
long row
) const
{
// make sure requires clause is not broken
DLIB_CASSERT(row < nr() && row >= 0,
"\tconst row& array2d::operator[](long row) const"
<< "\n\tThe row index given must be less than the number of rows."
<< "\n\tthis: " << this
<< "\n\trow: " << row
<< "\n\tnr(): " << nr()
);
return rows[row];
}
// ----------------------------------------------------------------------------------------
template <
typename array2d_base
>
const typename array2d_base::type& array2d_kernel_c<array2d_base>::row::
operator[] (
long column
) const
{
// make sure requires clause is not broken
DLIB_CASSERT(column < nc() && column >= 0,
"\tconst T& array2d::operator[](long column) const"
<< "\n\tThe column index given must be less than the number of columns."
<< "\n\tthis: " << this
<< "\n\tcolumn: " << column
<< "\n\tnc(): " << nc()
);
return (*data)[column];
}
// ----------------------------------------------------------------------------------------
template <
typename array2d_base
>
typename array2d_base::type& array2d_kernel_c<array2d_base>::row::
operator[] (
long column
)
{
// make sure requires clause is not broken
DLIB_CASSERT(column < nc() && column >= 0,
"\tT& array2d::operator[](long column)"
<< "\n\tThe column index given must be less than the number of columns."
<< "\n\tthis: " << this
<< "\n\tcolumn: " << column
<< "\n\tnc(): " << nc()
);
return (*data)[column];
}
// ----------------------------------------------------------------------------------------
}
#endif // DLIB_ARRAY2D_KERNEl_C_
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_ASSERt_
#define DLIB_ASSERt_
#include <sstream>
#include <iosfwd>
#include "error.h"
// -----------------------------
// Use some stuff from boost here
// (C) Copyright John Maddock 2001 - 2003.
// (C) Copyright Darin Adler 2001.
// (C) Copyright Peter Dimov 2001.
// (C) Copyright Bill Kempf 2002.
// (C) Copyright Jens Maurer 2002.
// (C) Copyright David Abrahams 2002 - 2003.
// (C) Copyright Gennaro Prota 2003.
// (C) Copyright Eric Friedman 2003.
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef BOOST_JOIN
#define BOOST_JOIN( X, Y ) BOOST_DO_JOIN( X, Y )
#define BOOST_DO_JOIN( X, Y ) BOOST_DO_JOIN2(X,Y)
#define BOOST_DO_JOIN2( X, Y ) X##Y
#endif
// -----------------------------
namespace dlib
{
template <bool value> struct compile_time_assert;
template <> struct compile_time_assert<true> { enum {value=1}; };
template <typename T, typename U> struct assert_are_same_type;
template <typename T> struct assert_are_same_type<T,T> {enum{value=1};};
template <typename T, typename U> struct assert_are_not_same_type {enum{value=1}; };
template <typename T> struct assert_are_not_same_type<T,T> {};
}
#define COMPILE_TIME_ASSERT(expression) \
typedef char BOOST_JOIN(DLIB_CTA, __LINE__)[::dlib::compile_time_assert<(bool)(expression)>::value]
#define ASSERT_ARE_SAME_TYPE(type1, type2) \
typedef char BOOST_JOIN(DLIB_AAST, __LINE__)[::dlib::assert_are_same_type<type1,type2>::value]
#define ASSERT_ARE_NOT_SAME_TYPE(type1, type2) \
typedef char BOOST_JOIN(DLIB_AANST, __LINE__)[::dlib::assert_are_not_same_type<type1,type2>::value]
// -----------------------------
#if defined DEBUG || defined _DEBUG
// make sure ENABLE_ASSERTS is defined if we are indeed using them.
#ifndef ENABLE_ASSERTS
#define ENABLE_ASSERTS
#endif
#endif
// -----------------------------
#ifdef __GNUC__
#define DLIB_FUNCTION_NAME __PRETTY_FUNCTION__
#elif _MSC_VER
#define DLIB_FUNCTION_NAME __FUNCSIG__
#else
#define DLIB_FUNCTION_NAME "unknown function"
#endif
#define DLIB_CASSERT(_exp,_message) \
{if ( !(_exp) ) \
{ \
std::ostringstream dlib__out; \
dlib__out << "\n\nError occurred at line " << __LINE__ << ".\n"; \
dlib__out << "Error occurred in file " << __FILE__ << ".\n"; \
dlib__out << "Error occurred in function " << DLIB_FUNCTION_NAME << ".\n\n"; \
dlib__out << "Failing expression was " << #_exp << ".\n"; \
dlib__out << _message << "\n"; \
dlib_assert_breakpoint(); \
throw dlib::fatal_error(dlib::EBROKEN_ASSERT,dlib__out.str()); \
}}
#ifdef ENABLE_ASSERTS
#define DLIB_ASSERT(_exp,_message) DLIB_CASSERT(_exp,_message)
#else
#define DLIB_ASSERT(_exp,_message)
#endif
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// breakpoints
extern "C"
{
inline void dlib_assert_breakpoint(
) {}
/*!
ensures
- this function does nothing
It exists just so you can put breakpoints on it in a debugging tool.
It is called only when an DLIB_ASSERT or DLIB_CASSERT fails and is about to
throw an exception.
!*/
}
// -----------------------------
#endif // DLIB_ASSERt_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_BASe64_
#define DLIB_BASe64_
#include "base64/base64_kernel_1.h"
namespace dlib
{
class base64
{
base64() {}
public:
//----------- kernels ---------------
// kernel_1a
typedef base64_kernel_1
kernel_1a;
};
}
#endif // DLIB_BASe64_
This diff is collapsed.
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_BASE64_KERNEl_1_
#define DLIB_BASE64_KERNEl_1_
#include "../algs.h"
#include <iosfwd>
namespace dlib
{
class base64_kernel_1
{
/*!
INITIAL VALUE
- bad_value == 100
- encode_table == a pointer to an array of 64 chars
- where x is a 6 bit value the following is true:
- encode_table[x] == the base64 encoding of x
- decode_table == a pointer to an array of UCHAR_MAX chars
- where x is any char value:
- if (x is a valid character in the base64 coding scheme) then
- decode_table[x] == the 6 bit value that x encodes
- else
- decode_table[x] == bad_value
CONVENTION
- The state of this object never changes so just refer to its
initial value.
!*/
public:
class decode_error : public dlib::error { public:
decode_error( const std::string& e) : error(e) {}};
base64_kernel_1 (
);
virtual ~base64_kernel_1 (
);
void encode (
std::istream& in,
std::ostream& out
) const;
void decode (
std::istream& in,
std::ostream& out
) const;
private:
char* encode_table;
unsigned char* decode_table;
const unsigned char bad_value;
// restricted functions
base64_kernel_1(base64_kernel_1&); // copy constructor
base64_kernel_1& operator=(base64_kernel_1&); // assignment operator
};
}
#ifdef NO_MAKEFILE
#include "base64_kernel_1.cpp"
#endif
#endif // DLIB_BASE64_KERNEl_1_
// Copyright (C) 2006 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_BASE64_KERNEl_ABSTRACT_
#ifdef DLIB_BASE64_KERNEl_ABSTRACT_
#include "../algs.h"
#include <iosfwd>
namespace dlib
{
class base64
{
/*!
INITIAL VALUE
This object does not have any state associated with it.
WHAT THIS OBJECT REPRESENTS
This object consists of the two functions encode and decode.
These functions allow you to encode and decode data to and from
the Base64 Content-Transfer-Encoding defined in section 6.8 of
rfc2045.
!*/
public:
class decode_error : public dlib::error {};
base64 (
);
/*!
ensures
- #*this is properly initialized
throws
- std::bad_alloc
!*/
virtual ~base64 (
);
/*!
ensures
- all memory associated with *this has been released
!*/
void encode (
std::istream& in,
std::ostream& out
) const;
/*!
ensures
- reads all data from in (until EOF is reached) and encodes it
and writes it to out
throws
- std::ios_base::failure
if there was a problem writing to out then this exception will
be thrown.
- any other exception
this exception may be thrown if there is any other problem
!*/
void decode (
std::istream& in,
std::ostream& out
) const;
/*!
ensures
- reads data from in (until EOF is reached) and decodees it
and writes it to out.
throws
- std::ios_base::failure
if there was a problem writing to out then this exception will
be thrown.
- decode_error
if an error was detected in the encoded data that prevented
it from being correctly decoded then this exception is
thrown.
- any other exception
this exception may be thrown if there is any other problem
!*/
private:
// restricted functions
base64(base64&); // copy constructor
base64& operator=(base64&); // assignment operator
};
}
#endif // DLIB_BASE64_KERNEl_ABSTRACT_
// Copyright (C) 2007 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_BAYES_UTILs_H_
#define DLIB_BAYES_UTILs_H_
#include "bayes_utils/bayes_utils.h"
#endif // DLIB_BAYES_UTILs_H_
This diff is collapsed.
This diff is collapsed.
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_BIGINt_
#define DLIB_BIGINt_
#include "bigint/bigint_kernel_1.h"
#include "bigint/bigint_kernel_2.h"
#include "bigint/bigint_kernel_c.h"
namespace dlib
{
class bigint
{
bigint() {}
public:
//----------- kernels ---------------
// kernel_1a
typedef bigint_kernel_1
kernel_1a;
typedef bigint_kernel_c<kernel_1a>
kernel_1a_c;
// kernel_2a
typedef bigint_kernel_2
kernel_2a;
typedef bigint_kernel_c<kernel_2a>
kernel_2a_c;
};
}
#endif // DLIB_BIGINt_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_BINARY_SEARCH_TREe_
#define DLIB_BINARY_SEARCH_TREe_
#include "binary_search_tree/binary_search_tree_kernel_1.h"
#include "binary_search_tree/binary_search_tree_kernel_2.h"
#include "binary_search_tree/binary_search_tree_kernel_c.h"
#include "memory_manager.h"
#include <functional>
namespace dlib
{
template <
typename domain,
typename range,
typename mem_manager = memory_manager<char>::kernel_1a,
typename compare = std::less<domain>
>
class binary_search_tree
{
binary_search_tree() {}
public:
//----------- kernels ---------------
// kernel_1a
typedef binary_search_tree_kernel_1<domain,range,mem_manager,compare>
kernel_1a;
typedef binary_search_tree_kernel_c<kernel_1a>
kernel_1a_c;
// kernel_2a
typedef binary_search_tree_kernel_2<domain,range,mem_manager,compare>
kernel_2a;
typedef binary_search_tree_kernel_c<kernel_2a>
kernel_2a_c;
};
}
#endif // DLIB_BINARY_SEARCH_TREe_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#ifndef DLIB_BIT_STREAm_
#define DLIB_BIT_STREAm_
#include "bit_stream/bit_stream_kernel_1.h"
#include "bit_stream/bit_stream_kernel_c.h"
#include "bit_stream/bit_stream_multi_1.h"
#include "bit_stream/bit_stream_multi_c.h"
namespace dlib
{
class bit_stream
{
bit_stream() {}
public:
//----------- kernels ---------------
// kernel_1a
typedef bit_stream_kernel_1
kernel_1a;
typedef bit_stream_kernel_c<kernel_1a >
kernel_1a_c;
//---------- extensions ------------
// multi_1 extend kernel_1a
typedef bit_stream_multi_1<kernel_1a>
multi_1a;
typedef bit_stream_multi_c<bit_stream_multi_1<kernel_1a_c> >
multi_1a_c;
};
}
#endif // DLIB_BIT_STREAm_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Copyright (C) 2003 Davis E. King (davisking@users.sourceforge.net)
// License: Boost Software License See LICENSE.txt for the full license.
#undef DLIB_BIT_STREAM_MULTi_ABSTRACT_
#ifdef DLIB_BIT_STREAM_MULTi_ABSTRACT_
#include "bit_stream_kernel_abstract.h"
namespace dlib
{
template <
typename bit_stream_base
>
class bit_stream_multi : public bit_stream_base
{
/*!
REQUIREMENTS ON BIT_STREAM_BASE
it is an implementation of bit_stream/bit_stream_kernel_abstract.h
WHAT THIS EXTENSION DOES FOR BIT_STREAM
this gives a bit_stream object the ability to read/write multible bits
at a time
!*/
public:
void multi_write (
unsigned long data,
int num_to_write
);
/*!
requires
- is_in_write_mode() == true
- 0 <= num_to_write <= 32
ensures
- num_to_write low order bits from data will be written to the ostream
- object associated with *this
example: if data is 10010 then the bits will be written in the
order 1,0,0,1,0
!*/
int multi_read (
unsigned long& data,
int num_to_read
);
/*!
requires
- is_in_read_mode() == true
- 0 <= num_to_read <= 32
ensures
- tries to read num_to_read bits into the low order end of #data
example: if the incoming bits were 10010 then data would end
up with 10010 as its low order bits
- all of the bits in #data not filled in by multi_read() are zero
- returns the number of bits actually read into #data
!*/
};
template <
typename bit_stream_base
>
inline void swap (
bit_stream_multi<bit_stream_base>& a,
bit_stream_multi<bit_stream_base>& b
) { a.swap(b); }
/*!
provides a global swap function
!*/
}
#endif // DLIB_BIT_STREAM_MULTi_ABSTRACT_
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment