STK++ 0.9.13
STK::hidden::CsvToArrayImpl< String, Array2D< OtherType > > Struct Template Reference

#include <STK_CsvToArray.h>

Static Public Member Functions

static void run (TReadWriteCsv< String > const &rw, Array2D< OtherType > *p_data, Real const propMiss)
 

Detailed Description

template<class OtherType>
struct STK::hidden::CsvToArrayImpl< String, Array2D< OtherType > >

Definition at line 54 of file STK_CsvToArray.h.

Member Function Documentation

◆ run()

template<class OtherType >
static void STK::hidden::CsvToArrayImpl< String, Array2D< OtherType > >::run ( TReadWriteCsv< String > const rw,
Array2D< OtherType > *  p_data,
Real const  propMiss 
)
inlinestatic

Definition at line 56 of file STK_CsvToArray.h.

57 {
58 int jSize = 0;
59 for(int jVar = rw.begin(); jVar<=rw.lastIdx(); jVar++)
60 {
61 if ( (rw.var(jVar).nbMiss()/Real(rw.var(jVar).size())) <= propMiss)
62 { jSize++;}
63 }
64 // resize
65 p_data->resize(rw.rows(), Range(rw.begin(), jSize));
66 for(int jVar = rw.begin(), jCol=rw.begin(); jVar<=rw.lastIdx(); jVar++)
67 {
68 if ( (rw.var(jVar).nbMiss()/Real(rw.var(jVar).size())) <= propMiss)
69 for (int i =p_data->beginRows(); i<= p_data->lastIdxRows(); ++i)
70 { p_data->elt(i, jCol) = stringToType<OtherType>(rw(i,jVar));}
71 jCol++;
72 }
73 }
double Real
STK fundamental type of Real values.
TRange< UnknownSize > Range
Definition STK_Range.h:59

The documentation for this struct was generated from the following file: