STK++ 0.9.13
STK::hidden::CsvToArrayImpl< Type, CArray< Type > > Struct Template Reference

#include <STK_CsvToArray.h>

Static Public Member Functions

static void run (TReadWriteCsv< Type > const &rw, CArray< Type > *p_data, Real const propMiss)
 

Detailed Description

template<class Type>
struct STK::hidden::CsvToArrayImpl< Type, CArray< Type > >

Definition at line 91 of file STK_CsvToArray.h.

Member Function Documentation

◆ run()

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

Definition at line 93 of file STK_CsvToArray.h.

94 {
95 int jSize = 0;
96 for(int jVar = rw.begin(); jVar<=rw.lastIdx(); jVar++)
97 {
98 if ( (rw.var(jVar).nbMiss()/Real(rw.var(jVar).size())) <= propMiss)
99 { jSize++;}
100 }
101 // resize
102 p_data->resize(rw.rows(), Range(rw.begin(), jSize));
103 for(int jVar = rw.begin(), jCol=rw.begin(); jVar<=rw.lastIdx(); jVar++)
104 {
105 if ( (rw.var(jVar).nbMiss()/Real(rw.var(jVar).size())) <= propMiss)
106 {
107 for (int i =p_data->beginRows(); i<= p_data->lastIdxRows(); ++i)
108 { p_data->elt(i, jCol) = rw(i,jVar);}
109 jCol++;
110 }
111 }
112 }
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: