Poster of Linux kernelThe best gift for a Linux geek
Parallel::Utils

Parallel::Utils

Section: C Library Functions (3) Updated: Thu Apr 7 2011
Local index Up
 

NAME

Parallel::Utils -  

SYNOPSIS


 

Functions


template<typename KeyType > bool is_sorted (const std::vector< KeyType > &v)

template<typename KeyType > double to_double (const KeyType &k)

template<typename KeyType > KeyType to_key_type (const double f)

template<> double to_double (const Hilbert::HilbertIndices &bvt)

template<> Hilbert::HilbertIndices to_key_type (const double f)
 

Function Documentation

 

template<typename KeyType > bool Parallel::Utils::is_sorted (const std::vector< KeyType > &v) [inline]Utility function that returns true if the vector v is sorted, false otherwise. O(N), the length of the vector. This is implemented solely because the std::is_sorted appears to be an STL extension.

Definition at line 47 of file parallel_conversion_utils.h.

Referenced by Parallel::BinSorter< KeyType >::BinSorter(), and Parallel::Histogram< KeyType >::Histogram().

      {
        if (v.empty())
          return true;

        for (unsigned int i=1; i<v.size(); i++)
          if (v[i] < v[i-1])
            return false;

        return true;    
      }
 

template<typename KeyType > double Parallel::Utils::to_double (const KeyType &k) [inline]A utility function which converts whatever KeyType is to a double for the histogram bounds

Definition at line 65 of file parallel_conversion_utils.h.

Referenced by Parallel::BinSorter< KeyType >::binsort(), and Parallel::Histogram< KeyType >::make_histogram().

      {
        return static_cast<double>(k);
      }
 

template<> double Parallel::Utils::to_double (const Hilbert::HilbertIndices &bvt) [inline]

Definition at line 87 of file parallel_conversion_utils.h.

      {
        return static_cast<double>(bvt.rack2);
      }
 

template<typename KeyType > KeyType Parallel::Utils::to_key_type (const doublef) [inline]A utility to convert a double to some sort of KeyType, for interpreting how histogram bounds relate to KeyType positions.

Definition at line 78 of file parallel_conversion_utils.h.

      {
        return static_cast<KeyType>(f);
      }
 

template<> Hilbert::HilbertIndices Parallel::Utils::to_key_type (const doublef) [inline]

Definition at line 95 of file parallel_conversion_utils.h.

      {
        Hilbert::HilbertIndices bvt;

        bvt.rack0 = 0;
        bvt.rack1 = 0;
        bvt.rack2 = static_cast<Hilbert::inttype>(f);

        return bvt;
      }
 

Author

Generated automatically by Doxygen for libMesh from the source code.


 

Index

NAME
SYNOPSIS
Functions
Function Documentation
template<typename KeyType > bool Parallel::Utils::is_sorted (const std::vector< KeyType > &v) [inline]Utility function that returns true if the vector v is sorted, false otherwise. O(N), the length of the vector. This is implemented solely because the std::is_sorted appears to be an STL extension.
template<typename KeyType > double Parallel::Utils::to_double (const KeyType &k) [inline]A utility function which converts whatever KeyType is to a double for the histogram bounds
template<> double Parallel::Utils::to_double (const Hilbert::HilbertIndices &bvt) [inline]
template<typename KeyType > KeyType Parallel::Utils::to_key_type (const doublef) [inline]A utility to convert a double to some sort of KeyType, for interpreting how histogram bounds relate to KeyType positions.
template<> Hilbert::HilbertIndices Parallel::Utils::to_key_type (const doublef) [inline]
Author

This document was created by man2html, using the manual pages.
Time: 21:52:00 GMT, April 16, 2011