Elaboradar 0.1
Caricamento in corso...
Ricerca in corso...
Nessun risultato

◆ load_ascii()

void elaboradar::Assets::load_ascii ( const std::string &  fname,
const char *  desc,
radarelab::Matrix2D< float > &  matrix 
)
protected

Load a Matrix2D, from space-separated column-major ascii floats.

Definizione alla linea 515 del file assets.cpp.

516{
517 LOG_INFO("Opening %s %s", desc, fname.c_str());
518 FILE* in = fopen_checked(fname.c_str(), "rt", desc);
519
520 for (unsigned x = 0; x < matrix.cols(); ++x)
521 for (unsigned y = 0; y < matrix.rows(); ++y)
522 {
523 float val;
524 fscanf(in, "%f ", &val);
525 matrix(y, x) = val;
526 }
527
528 fclose(in);
529}
FILE * fopen_checked(const char *fname, const char *mode, const char *description)
A wrapper of fopen that throws an exception if it cannot open the file.
Definition: utils.cpp:144

Referenzia radarelab::fopen_checked().

Referenziato da load_dem().