project DManager (Data Management)


Classes

class  STK::DataFrame
 DataFrame is a List and a 2D container containing Variables. More...
class  STK::ExportToCsv
 Export data to a Csv stream. More...
class  STK::ImportFromCsv
 import data from a Csv File. More...
class  STK::IVariable
 IVariable is an Interface class for all Variables classes. More...
class  STK::ReadWriteCsv
 the ReadWriteCsv class : allow to write and/or to read a csv file. More...

Enumerations

enum  STK::CSV::readflags { STK::CSV::RF_APPEND_DATA = 0x00000004, STK::CSV::RF_REPLACE_DATA = 0x00000008 }

Functions

template<class TYPE , class TContainer1D >
void STK::heapSort (ITContainer1D< TYPE, TContainer1D > &T)
 Sort the container T in ascending order.
istream & STK::operator>> (istream &is, ReadWriteCsv &df)
ostream & STK::operator<< (ostream &os, const ReadWriteCsv &df)

Enumeration Type Documentation

enumeration of read flags These flags determine the behavior of the reading methods.

Enumerator:
RF_APPEND_DATA 
RF_REPLACE_DATA 

Definition at line 69 of file STK_ReadWriteCsv.h.

00070   {
00071     RF_APPEND_DATA    = 0x00000004,
00072     RF_REPLACE_DATA   = 0x00000008
00073   };


Function Documentation

template<class TYPE , class TContainer1D >
void STK::heapSort ( ITContainer1D< TYPE, TContainer1D > &  T  )  [inline]

Parameters:
T the container to sort

Definition at line 59 of file STK_HeapSort.h.

References STK::ITContainer1D< TYPE, TContainer1D >::first(), and STK::ITContainer1D< TYPE, TContainer1D >::size().

Referenced by STK::Stat::Univariate< Real, TContainer1D >::compOrderStatistics().

00060 {
00061   // number of elements
00062   Integer nelt = T.size();
00063   // if the container is not base one
00064   Integer shift = T.first() - 1, shift1 = T.first();
00065   // Sort T using a heapsort
00066   // index first will be decreased until it reach 1,
00067   // then  last will be decremented until it reach 1
00068   for (Integer first = nelt/2 + 1, last = nelt;;)
00069   { // the current value to sort
00070     TYPE current;
00071     if (first>1)
00072     { // Decrease first and get the next
00073       current = T[shift + (--first)];
00074     }
00075     else  // first == 1
00076     { // get current at the end of the array
00077       current = T[shift + last];
00078       // Put the top of the heap at the end
00079       T[shift + last] = T[shift1];
00080       // decrease last.  last==1 : we end the job
00081       if (--last == 1)
00082       { T[shift1] = current;
00083         break;
00084       }
00085     }
00086     // organize the heap
00087     Integer i=first, j=first+1;
00088     while (j <= last)
00089     { // j+1 is greatest child
00090       if ( j < last && T[shift + j] < T[shift1 + j] ) j++;
00091       // we have find a child gt current
00092       if (current >= T[shift + j]) break;
00093       // else shift the inner value
00094       T[shift + i] = T[shift + j];
00095       // go down in the tree
00096       i = j;
00097       j*= 2;
00098     }
00099     // plug current in its final location
00100     T[shift + i] = current;
00101   }
00102 }

istream& STK::operator>> ( istream &  is,
ReadWriteCsv &  df 
)

Read the data from the stream and returns the stream when done.

Parameters:
is input stream
df the ReadWriteCsv to read

ostream & STK::operator<< ( ostream &  os,
const ReadWriteCsv &  df 
)

write the data into the stream and returns the stream when done.

Parameters:
os output stream
df the ReadWriteCsv to write

Definition at line 770 of file STK_ReadWriteCsv.cpp.

References STK::ITContainer1D< TYPE, TContainer1D >::first(), STK::ReadWriteCsv::getLargestLastVe(), STK::ReadWriteCsv::getLowerFirstVe(), STK::ITContainer1D< TYPE, TContainer1D >::last(), STK::ReadWriteCsv::str_data_, and STK::ReadWriteCsv::writeSelection().

00771 {
00772   try
00773   {
00774     df.writeSelection( os
00775                      , df.getLowerFirstVe()
00776                      , df.getLargestLastVe()
00777                      , df.str_data_.first()
00778                      , df.str_data_.last()
00779                      );
00780   }
00781   // catch and re-throw any exceptions
00782   catch(const std::exception& e) { throw e; }
00783   catch(...) { throw std::exception(); }
00784   return os;
00785 }


Generated on Fri Sep 25 10:30:59 2009 for STK++ by  doxygen 1.5.8