Skip to content

Libs/Particles/ParticleSystemEvaluation.h

Namespaces

Name
shapeworks
User usage reporting (telemetry)

Classes

Name
class shapeworks::ParticleSystemEvaluation

Source code

#pragma once

#include <Eigen/Core>
#include <vector>

namespace shapeworks {

class ParticleSystemEvaluation {
 public:
  explicit ParticleSystemEvaluation(const std::vector<std::string>& paths);

  explicit ParticleSystemEvaluation(const Eigen::MatrixXd& matrix, int num_values_per_particle = 3);

  const Eigen::MatrixXd& get_matrix() const { return matrix_; };

  int get_num_values_per_particle() const { return num_values_per_particle_; }

  const std::vector<std::string>& get_paths() const { return paths_; }

  long num_samples() const { return matrix_.cols(); }

  long num_dims() const { return matrix_.rows(); }

  bool exact_compare(const ParticleSystemEvaluation& other) const;

  bool evaluation_compare(const ParticleSystemEvaluation& other) const;

  static bool read_particle_file(std::string filename, Eigen::VectorXd& points);

 private:
  friend struct SharedCommandData;

  ParticleSystemEvaluation() {}

  Eigen::MatrixXd matrix_;
  std::vector<std::string> paths_;
  int num_values_per_particle_ = 3;  // e.g. 3 for x/y/z, 4 for x/y/z/scalar, 1 for scalar-only
};
}  // namespace shapeworks

Updated on 2024-05-10 at 16:25:50 +0000