proj home

Files   Classes   Functions   Hierarchy  

arrays.h File Reference

#include <cassert>
#include <vector>
#include <typedefs.h>

Include dependency graph for arrays.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

template<typename F , typename I >
void arraysreadelements2 (vector< F > &v, I const *arr, uintc vnum)
 Supply the vector, array and number of new elements.
template<typename F , typename I >
void arraysreadelements3 (vector< F > &v, I const *arr, uintc vnum)


Function Documentation

template<typename F , typename I >
void arraysreadelements2 ( vector< F > &  v,
I const *  arr,
uintc  vnum 
) [inline]

Supply the vector, array and number of new elements.

The constructor does the work converting the type. F - final type I - input type

Definition at line 16 of file arrays.h.

Referenced by vistest::test02(), and vistest::test03().

00017 {
00018   assert(arr!=0);
00019 
00020   // Assume arr has size vnum*2.
00021   for (uint i=0; i<vnum; ++i)
00022     v.push_back( F(arr[i*2],arr[i*2+1]) );
00023 }

template<typename F , typename I >
void arraysreadelements3 ( vector< F > &  v,
I const *  arr,
uintc  vnum 
) [inline]

Definition at line 28 of file arrays.h.

00029 {
00030   assert(arr!=0);
00031 
00032   // Assume arr has size vnum*3.
00033   for (uint i=0; i<vnum; ++i)
00034     v.push_back( F(arr[i*3],arr[i*3+1],arr[i*3+2]) );
00035 }


Generated on Fri Mar 4 00:49:42 2011 for Chelton Evans Source by  doxygen 1.5.8