1#ifndef __JLANG__JVECTORIZE__
2#define __JLANG__JVECTORIZE__
18namespace JPP {
using namespace JLANG; }
25 template<
class JElement_t,
class JAllocator_t = std::allocator<JElement_t> >
38 buffer.assign(this->begin(), this->end());
53 for (
typename array_type::const_iterator i =
object.begin(); i !=
object.end(); ++i) {
68 template<
class JValue_t,
size_t N>
75 for (
size_t i = 0; i != N; ++i) {
95 buffer.assign(__begin, __end);
109 template<
class T,
class JType_t,
class JValue_t>
114 for (T __p = __begin; __p != __end; ++__p) {
115 buffer.push_back(*__p.*value);
130 template<
class T,
class JType_t,
class JValue_t>
135 for (T __p = __begin; __p != __end; ++__p) {
136 buffer.push_back((*__p.*function)());
149 template<
class JKey_t,
class JValue_t,
class JComparator_t,
class JAllocator_t>
162 template<
class JKey_t,
class JValue_t,
class JComparator_t,
class JAllocator_t>
179 template<
class T,
class JResult_t,
class JComparator_t>
182 JResult_t std::iterator_traits<T>::value_type::*value,
183 const JComparator_t& comparator)
190 if (p0 == __end) {
return p0; }
191 if (
p1 == __end) {
return p1; }
194 if (comparator((*p0).*value, (*p1).*value))
200 for ( ; p2 != __end; ++p2) {
202 if (comparator((*p0).*value, (*p1).*value)) {
203 if (comparator((*p1).*value, (*p2).*value)) {
206 }
else if (comparator((*p0).*value, (*p2).*value)) {
210 if (comparator((*p2).*value, (*p0).*value)) {
233 for (
typename array_type<T>::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
255 for (
typename array_type<T>::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
272 template<
class T,
class JCompare_t>
277 for (
typename array_type<T>::const_iterator p = buffer.begin(); p != buffer.end(); ++p) {
279 typename array_type<T>::const_iterator q = p;
281 while (++q != buffer.end() && !compare(*p,*q)) {}
283 if (q == buffer.end()) {
300 return getCount(buffer, std::equal_to<T>());
Forward declarations of STD containers.
Auxiliary classes and methods for language specific functionality.
array_type< JValue_t > get_values(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of values of map.
T getMaximum(const array_type< T > &buffer, const T value)
Get maximum of values.
T make_set(T __begin, T __end, JResult_t std::iterator_traits< T >::value_type::*value, const JComparator_t &comparator)
Method to exclude outliers from already sorted data.
size_t getCount(const array_type< T > &buffer, const JCompare_t &compare)
Count number of unique values.
array_type< JKey_t > get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
array_type< JValue_t > make_array(const JValue_t(&array)[N])
Method to create array of values.
T getMinimum(const array_type< T > &buffer, const T value)
Get minimum of values.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary data structure for return type of make methods.
const array_type * operator->() const
Smart pointer.
friend std::ostream & operator<<(std::ostream &out, const array_type &object)
Write array to output stream.