File: samplerow.cpp

package info (click to toggle)
aoflagger 3.4.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,960 kB
  • sloc: cpp: 83,076; python: 10,187; sh: 260; makefile: 178
file content (17 lines) | stat: -rw-r--r-- 375 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "samplerow.h"

SampleRow SampleRow::MakeWithoutMissings() const {
  size_t newSize = 0;
  for (const num_t v : _values) {
    if (std::isfinite(v)) ++newSize;
  }
  SampleRow newRow(newSize);
  size_t indexToNew = 0;
  for (const num_t v : _values) {
    if (std::isfinite(v)) {
      newRow._values[indexToNew] = v;
      ++indexToNew;
    }
  }
  return newRow;
}