ivl 679
ivl Namespace Reference

Namespaces

namespace  array_details
 

print an array


Classes

class  array
 1-dimensional array of type T More...
class  array< T, data::binary_elem_func< F, A1, A2, SWAP_ARGS, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::binary_elem_func_ptr< F, A1, A2, SWAP_ARGS, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::stack< N, USE_REALLOC, USE_PREALLOC, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::catarray< A1, A2, CATDIM, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::empty< DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::fixed< N, NAMING, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::fixed_val_repeat< T, V, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::indirect< A, B, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::mask< A, B, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::member< A, T, DERIVED_INFO > >
class  array< T, data::range< DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::ref_iterator< IT, CONST_IT, LENGTH, HAS_C_PTR, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::ref_val_repeat< DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::slice< A, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::subarray< A, I, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::unary_elem_func< F, A, DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::val_repeat< DERIVED_INFO > >
 1-dimensional array of type T More...
class  array< T, data::wrap_array< A, ATTR, DERIVED_INFO > >
class  array_2d
 2-dimensional array of type T More...
class  array_base
 Base class for all type of arrays. More...
class  array_nd
 Multi-dimensional array of type T. More...
class  array_nd< T, data::normal_2d< DERIVED_INFO > >
 Multi-dimensional array of type T. More...
class  array_nd< T, data::normal_image< N, DERIVED_INFO > >
 Multi-dimensional array of type T. More...
class  array_nd< T, data::subarray< A, I, DERIVED_INFO > >
 Multi-dimensional array of type T. More...
class  array_nd< T, data::wrap_array< A, ATTR, DERIVED_INFO > >
class  color
class  image
 A single or multi channel image of type T based on array. More...
class  index_array
class  range
 A range of Numbers. More...
class  same_place_reverse_iterator
class  slice
 A slice. More...

Typedefs

typedef array< bool, mem > bool_array
typedef array< size_t, mem > size_array

Enumerations

enum  padarray_direction
 padenum More...

Functions

static __attribute__ ((unused)) struct max_impl
template<class A >
A & by_ref (const A &a)
template<class T , class S >
array_nd< T, S >::create_new cat (size_t dim, const array< array_nd< T, S > > &a)
 Concatenates arrays along dimension dim.
template<class T , class S >
array_2d< T > diag (const array< T, S > &a, int k=0)
 create diagonal matrix
template<class T , class S >
array< T > diag (const array_2d< T, S > &a, int k=0)
 diagonal of the matrix
template<class T >
array< T, data::empty<> > empty ()
template<class T >
array_2d< T > eye (size_t s, const T &zero=0, const T &one=1)
 identity matrix
template<class T , class D >
array_2d< T > eye (const array< size_t, D > &indx, const T &zero=0, const T &one=1)
 identity matrix of arbitrary shape
template<class T , class D >
array_2d< T, D >::create_similar fliplr (const array_2d< T, D > &a)
 flip matrix right to left
template<class T , class D >
array_2d< T, D >::create_similar flipud (const array_2d< T, D > &a)
 flip matrix upside down
template<class T , class D >
image< T, D >::create_similar flipud (const image< T, D > &a)
 Horizontal and vertical flipping.
template<class T , class D >
image< T, D >::create_similar grayscale (const image< T, D > &a)
 Grayscale.
template<class T , class S , class D >
array_2d< T, S >::create_new horzcat (const array_2d< T, S > &a, const array_2d< T, D > &b)
 horizontal concatenation with another matrix
template<class T >
inf ()
 infinity<T>
template<class T >
size_t intersect (const ivl::array< T > &a, const ivl::array< T > &b)
 intersection of array<T>, returns number of intesections
template<class T >
size_t intersect (const ivl::array< T > &a, const ivl::array< T > &b, ivl::array< T > &common, ivl::array< ivl::size_array > &ia, ivl::array< ivl::size_array > &ib)
template<class T >
size_t intersect_s (const ivl::array< T > &a, const ivl::array< T > &b, ivl::array< T > &common, ivl::array< ivl::size_array > &ia, ivl::array< ivl::size_array > &ib)
template<class T >
size_t intersect_us (const ivl::array< T > &a, const ivl::array< T > &b)
template<class T >
size_t intersect_us (const ivl::array< T > &a, const ivl::array< T > &b, ivl::array< T > &common, ivl::size_array &ia, ivl::size_array &ib)
template<class T >
size_t intersect_us (const ivl::array< T > &a, const ivl::array< T > &b, const ivl::size_array &fa, const ivl::size_array &fb)
template<class T >
size_t intersect_us (const ivl::array< T > &a, const ivl::array< T > &b, const ivl::size_array &fa, const ivl::size_array &fb, ivl::array< T > &common, ivl::size_array &ia, ivl::size_array &ib)
template<template< typename, typename > class F, class A , class B >
void loop_on (A &a, const B &b)
 might call threads (not for now)!
template<class A >
core_details::resolve_lval< A >
::type 
lval (const A &a)
template<class T , class S , class D >
ivl::array_2d< T, S >::create_new mtimes (const ivl::array_2d< T, S > &x, const ivl::array_2d< T, D > &y)
 Matrix multiplication algorithm.
template<class T >
nan ()
 NaN<T>
template<class T >
NaN ()
 NaN<T>
template<class T , class S >
std::ostream & operator<< (std::ostream &os, const array_base< T, S, true > &in)
 ostream operator<< overload for array_base
std::ostream & operator<< (std::ostream &os, const index_array &a)
 ostream operator<< overload for index_array
template<class T , class D >
array_nd< T, D >::create_new padarray (const array_nd< T, D > &in, size_array sz, padarray_method mthd, padarray_direction dir=both)
 pad array
template<class T , class D >
array_nd< T, D >::NewDerived padarray (const array_nd< T, D > &in, size_array sz, T padval=0, padarray_direction dir=both)
 pad array
template<class T >
void radixsort (ivl::array< ivl::array< T > > &source, ivl::size_array &ind)
 sort an array of positive numbers using the radix sort algorithm
template<class T >
void radixsort (ivl::array< T > &source)
 sort an array of positive numbers using the radix sort algorithm
template<class T >
void radixsort (ivl::array< ivl::array< T > > &source)
 sort an array of positive numbers using the radix sort algorithm
template<class T >
void radixsort (ivl::array< T > &source, ivl::size_array &ind)
template<class T >
array_nd< T > repmat (const array_nd< T > &a, const size_array &sz)
 Replicate and tile an array.
template<class T , class S >
array_2d< T, S >::create_new rot90 (const array_2d< T, S > &a, int k=1)
 rotate matrix
template<class A >
core_details::resolve_rval< A >
::type 
rval (const A &a)
template<template< typename, typename > class F, class A , class B >
void safe_loop_on (A &a, const B &b)
 might call threads (not for now)!
template<class T , class S >
array_2d< T, S >::create_new transpose (const array_2d< T, S > &a)
 transpose matrix
template<class T , class S >
array_2d< T, S >::create_similar tril (const array_2d< T, S > &a, int k=0)
 lower triangular part of matrix
template<class T , class S >
array_2d< T, S >::create_similar triu (const array_2d< T, S > &a, int k=0)
 upper triangular part of matrix
template<class T >
ivl::array< T > unique (const ivl::array< T > &a)
 returns the unique elements <T> of an array ( output is sorted )
template<class T >
ivl::array< T > unique_count (const ivl::array< T > &a, ivl::size_array &f)
template<class T >
ivl::array< T > unique_count (const ivl::array< T > &a, ivl::size_array &f, ivl::array< ivl::size_array > &index)
template<class T >
ivl::array< T > unique_count_core (const ivl::array< T > &s_a, ivl::size_array &f, ivl::array< ivl::size_array > &index, bool option=true)
template<class T >
ivl::array< T > unique_count_s (const ivl::array< T > &a, ivl::size_array &f)
template<class T >
ivl::array< T > unique_count_s (const ivl::array< T > &a, ivl::size_array &f, ivl::array< ivl::size_array > &index)
template<class T >
ivl::array< T > unique_s (const ivl::array< T > &a)
 returns the unique elements <T> of an already SORTED array ( output is still sorted )
template<class T >
array< array< T > > unwrap (const array_2d< T > &a)
 Unwrap an array_2d to an array of arrays.
template<class T , class S , class D >
array_2d< T, S >::create_new vertcat (const array_2d< T, S > &a, const array_2d< T, D > &b)
 vertical concatenation with another matrix
template<class T >
array_2d< T > wrap (const array< array< T > > a)
 Wrap an array of arrays to an array_2d.
template<typename _Iterator >
bool operator== (const same_place_reverse_iterator< _Iterator > &__x, const same_place_reverse_iterator< _Iterator > &__y)

Variables

static const double epsilon = std::numeric_limits<double>::epsilon()
 pi math constant
static const double infty = std::numeric_limits<double>::infinity()
 infinity of double
static const double pi = 3.14159265358979323846264338327950288419716939937510
 epsilon

Detailed Description

Sockets implementation in ivl


Typedef Documentation

typedef array<bool, mem> ivl::bool_array

array of bool

typedef array<size_t, mem> ivl::size_array

array of size_t


Enumeration Type Documentation

padenum

Todo:
document

Function Documentation

static ivl::__attribute__ ( (unused)  ) [static]

Largest of all elements

Note: In WIN32 targets you have to either #undef max or compile with IVL_USE_MINMAX to be able to use this function

Largest of all elements

Note: In WIN32 targets you have to either #undef min or compile with IVL_USE_MINMAX to be able to use this function

Find an element value

Returns:
linear offsets of all occurences of the element in the array

returns linear offsets of all occurences of element

Todo:
Put this in a cpp file
Todo:
Put this in a cpp file

Find elements in an array_nd

Returns:
Array of index vectors for found elements

Find with rows and columns

return array of s random numbers, uniformly distributed from 0.0 to 1.0

return array of s random numbers, uniformly distributed between from and to

Create an array_nd of random numbers.

The numbers will be uniformly distributed between 0 to RAND_MAX

Parameters:
szContains the dimensions of the array_nd that will be created.

Create an array_nd of random numbers.

The numbers will be uniformly distributed between 0 to RAND_MAX

Parameters:
szContains the dimensions of the array_nd that will be created.

Largest of all elements

Note: In WIN32 targets you have to either #undef min or compile with IVL_USE_MINMAX to be able to use this function

Find an element value

Returns:
linear offsets of all occurences of the element in the array

returns linear offsets of all occurences of element

Todo:
Put this in a cpp file
Todo:
Put this in a cpp file

Find elements in an array_nd

Returns:
Array of index vectors for found elements

Find with rows and columns

return array of s random numbers, uniformly distributed from 0.0 to 1.0

return array of s random numbers, uniformly distributed between from and to

Create an array_nd of random numbers.

The numbers will be uniformly distributed between 0 to RAND_MAX

Parameters:
szContains the dimensions of the array_nd that will be created.

Create an array_nd of random numbers.

The numbers will be uniformly distributed between 0 to RAND_MAX

Parameters:
szContains the dimensions of the array_nd that will be created.

template<class A >
A & ivl::by_ref ( const A &  a) [inline]

! normalize an output function argument. allows subarrays and all other referencing arrays to be passed by reference as output variables in functions. This is actually a simple const-cast. Can't be avoided since subarrays are normally temporary objects, and declaring them as variables would be not good since the type of a subarray is too complicated.

template<class T >
array<T, data::empty<> > ivl::empty ( ) [inline]

returns empty array Used for array_nd<T>::cut()

template<class T >
size_t ivl::intersect ( const ivl::array< T > &  a,
const ivl::array< T > &  b,
ivl::array< T > &  common,
ivl::array< ivl::size_array > &  ia,
ivl::array< ivl::size_array > &  ib 
) [inline]

intersection of array<T>, returns number of intesections common are the common values <T> in both a and b ia, ib are the indices of the common values to both a and b (how to go from intersection back to single arrays)

template<class T >
size_t ivl::intersect_s ( const ivl::array< T > &  a,
const ivl::array< T > &  b,
ivl::array< T > &  common,
ivl::array< ivl::size_array > &  ia,
ivl::array< ivl::size_array > &  ib 
) [inline]

intersection of array<T>, returns number of intesections common are the common values <T> in both a and b ia, ib are the indices of the common values to both a and b (how to go from intersection back to single arrays)

template<class T >
size_t ivl::intersect_us ( const ivl::array< T > &  a,
const ivl::array< T > &  b 
) [inline]

intersection of array<T> which are both unique and sorted, returns number of intesections calculates intersection assuming that frequencies are 1 for each element of a, b

template<class T >
size_t ivl::intersect_us ( const ivl::array< T > &  a,
const ivl::array< T > &  b,
ivl::array< T > &  common,
ivl::size_array ia,
ivl::size_array ib 
) [inline]

intersection of array<T> which are both unique and sorted, returns number of intesections common are the common values <T> in both a and b ia, ib are the indices of the common values to both a and b (how to go from intersection back to single arrays) calculates intersection assuming that frequencies are 1 for each element of a, b

TODO, add also frequencies to the intersection

template<class T >
size_t ivl::intersect_us ( const ivl::array< T > &  a,
const ivl::array< T > &  b,
const ivl::size_array fa,
const ivl::size_array fb 
) [inline]

intersection of array<T> which are both unique and sorted, returns number of intesections calculates intersection assuming that fa, fb are the frequencies for each element of a, b

template<class T >
size_t ivl::intersect_us ( const ivl::array< T > &  a,
const ivl::array< T > &  b,
const ivl::size_array fa,
const ivl::size_array fb,
ivl::array< T > &  common,
ivl::size_array ia,
ivl::size_array ib 
) [inline]

intersection of array<T> which are both unique and sorted, returns number of intesections common are the common values <T> in both a and b ia, ib are the indices of the common values to both a and b (how to go from intersection back to single arrays) calculates intersection assuming that fa, fb are the frequencies for each element of a, b

template<class A >
core_details::resolve_lval< A >::type ivl::lval ( const A &  a) [inline]

! normalize an output function argument. makes sure that an array can be passed to a function as an argument, making a possible copy of the output array. that is, it has random access.

template<typename _Iterator >
bool ivl::operator== ( const same_place_reverse_iterator< _Iterator > &  __x,
const same_place_reverse_iterator< _Iterator > &  __y 
) [inline]
Parameters:
xA same_place_reverse_iterator.
yA same_place_reverse_iterator.
Returns:
A simple bool.

Reverse iterators forward many operations to their underlying base() iterators. Others are implemented in terms of one another.

template<class T , class D >
array_nd<T, D>::create_new ivl::padarray ( const array_nd< T, D > &  in,
size_array  sz,
padarray_method  mthd,
padarray_direction  dir = both 
)

pad array

Todo:
move to correct place, document, etc
template<class T , class D >
array_nd<T, D>::NewDerived ivl::padarray ( const array_nd< T, D > &  in,
size_array  sz,
padval = 0,
padarray_direction  dir = both 
)

pad array

Todo:
move to correct place, document, etc
template<class T >
void ivl::radixsort ( ivl::array< T > &  source,
ivl::size_array ind 
) [inline]

sort an array of positive numbers using the radix sort algorithm and keeping index (how to go from the sorted array to the un-sorted)

template<class T >
array_nd<T> ivl::repmat ( const array_nd< T > &  a,
const size_array &  sz 
)

Replicate and tile an array.

Replicates array_nd by the number of times and along the dimensions specified by sz. For exmaple:

 repmat(a, [3 2]) 

will replicate a 3 times along the first dimension and 2 times along the second.

template<class A >
core_details::resolve_rval< A >::type ivl::rval ( const A &  a)

! normalize an input function argument. makes sure that an array or function result can be passed to a function as an argument, making a possible copy of the input array. also it allows a subarray of the same object to be used as input and output without invalid data due to overlapping (by making a copy). Any arrays that are not default array objects (dont have a c pointer with their data, or more precisely are not is_linear) will be copied. Note: that, in cases that the array is valid, this could decrease performance because of the copy, however, in some cases it could also increase performance. This is because some arrays like element function arrays do complicated stuff to retrieve every element. The easy but not absolute rule is that we use rval when the function will use each element of the array more than once. Of course rval must be used when, the program won't compile without it i.e. the array is not valid, or when the array is not safe, i.e. it is used as input and output simultaneously. Safety: the safety rule is to always use rval even if you don't have to. Note: If the input array is exactly the same as the output array, but it is a normal array, rval won't make a copy and safety will not be guarranteed. This by-reference array C++ inherent problem is simply solved by the r-value ivl mechanism by checking to see if the input- output arguments are the same, and hence you don't have to do anything when the function you are calling is a well-defined rvalue function. Warning: feature maybe not implemented yet!

template<class T >
ivl::array<T> ivl::unique_count ( const ivl::array< T > &  a,
ivl::size_array f,
ivl::array< ivl::size_array > &  index 
) [inline]

returns the unique elements <T> of an array ( output is sorted ) f counts how many times each unique elements appears in a index keeps the new order of elements (how to go from unique back to non-unique)

template<class T >
ivl::array<T> ivl::unique_count ( const ivl::array< T > &  a,
ivl::size_array f 
) [inline]

returns the unique elements <T> of an array ( output is sorted ) f counts how many times each unique elements appears in a

template<class T >
ivl::array<T> ivl::unique_count_core ( const ivl::array< T > &  s_a,
ivl::size_array f,
ivl::array< ivl::size_array > &  index,
bool  option = true 
) [inline]

returns the unique elements of an already SORTED array ( output is still sorted ) f counts how many times each unique elements appears in a index keeps the new order of elements (how to go from unique back to non-unique) option - true: calculate index, false: do not calculate index

template<class T >
ivl::array<T> ivl::unique_count_s ( const ivl::array< T > &  a,
ivl::size_array f,
ivl::array< ivl::size_array > &  index 
) [inline]

returns the unique elements <T> of an already SORTED array ( output is still sorted ) f counts how many times each unique elements appears in a index keeps the new order of elements (how to go from unique back to non-unique)

template<class T >
ivl::array<T> ivl::unique_count_s ( const ivl::array< T > &  a,
ivl::size_array f 
) [inline]

returns the unique elements <T> of an already SORTED array ( output is still sorted ) f counts how many times each unique elements appears in a

 All Classes Namespaces Files Functions Variables Typedefs Enumerations