BlosSOM
Interactive dimensionality reduction on large datasets (EmbedSOM and FLOWER combined)
|
Model of the high- and low-dimensional landmarks. More...
#include <landmark_model.h>
Public Member Functions | |
LandmarkModel () | |
Creates empty landmarks with dimension 0. More... | |
void | update_dim (size_t dim) |
Updates current dimension and calls init_grid(). More... | |
void | init_grid (size_t side) |
Creates squared landmarks layout, without edges. More... | |
void | move (size_t ind, const glm::vec2 &mouse_pos) |
Sets two-dimensional position of the pressed landmark to mouse position. More... | |
void | duplicate (size_t ind) |
Creates new landmark with the same two- and high-dimensional coordinates as the given landmark. More... | |
void | add (const glm::vec2 &mouse_pos) |
Creates new landmark with the two- and high-dimensional coordinates as the closeset landmark. More... | |
void | remove (size_t ind) |
Removes landmark and corresponding edges. More... | |
size_t | closest_landmark (const glm::vec2 &mouse_pos) const |
Counts closest landmark to the given position. More... | |
size_t | n_landmarks () const |
Reurns number of the 2D landmarks. More... | |
![]() | |
Dirt () | |
void | touch () |
Make the cache dirty. More... | |
Public Attributes | |
size_t | d |
Dimension size. More... | |
std::vector< float > | hidim_vertices |
One-dimensional array storing d-dimensional landmark coordinates in row-major order. More... | |
std::vector< glm::vec2 > | lodim_vertices |
Array storing two-dimensional landmark coordinates. More... | |
std::vector< float > | edge_lengths |
Lengths of all edges. More... | |
std::vector< std::pair< size_t, size_t > > | edges |
Array of vertex ID pairs. More... | |
![]() | |
int | dirt |
Model of the high- and low-dimensional landmarks.
Definition at line 33 of file landmark_model.h.
LandmarkModel::LandmarkModel | ( | ) |
Creates empty landmarks with dimension 0.
Definition at line 25 of file landmark_model.cpp.
void LandmarkModel::add | ( | const glm::vec2 & | mouse_pos | ) |
Creates new landmark with the two- and high-dimensional coordinates as the closeset landmark.
mouse_pos | Mouse screen position. |
Definition at line 93 of file landmark_model.cpp.
size_t LandmarkModel::closest_landmark | ( | const glm::vec2 & | mouse_pos | ) | const |
Counts closest landmark to the given position.
mouse_pos | Mouse screen position. |
Definition at line 153 of file landmark_model.cpp.
void LandmarkModel::duplicate | ( | size_t | ind | ) |
Creates new landmark with the same two- and high-dimensional coordinates as the given landmark.
ind | Index of the landmark which will be duplicated. |
Definition at line 77 of file landmark_model.cpp.
void LandmarkModel::init_grid | ( | size_t | side | ) |
Creates squared landmarks layout, without edges.
It will create side
* side
two-dimensional landmarks and side
* side
* LandmarkModel::d high-dimensional landmarks.
side | Side of the square. |
Definition at line 32 of file landmark_model.cpp.
void LandmarkModel::move | ( | size_t | ind, |
const glm::vec2 & | mouse_pos | ||
) |
Sets two-dimensional position of the pressed landmark to mouse position.
ind | Index of the pressed landmark. |
mouse_pos | Mouse screen position. |
Definition at line 70 of file landmark_model.cpp.
|
inline |
Reurns number of the 2D landmarks.
Definition at line 120 of file landmark_model.h.
void LandmarkModel::remove | ( | size_t | ind | ) |
Removes landmark and corresponding edges.
ind | Index of the removed landmark. |
Definition at line 110 of file landmark_model.cpp.
void LandmarkModel::update_dim | ( | size_t | dim | ) |
Updates current dimension and calls init_grid().
dim |
Definition at line 61 of file landmark_model.cpp.
size_t LandmarkModel::d |
Dimension size.
Definition at line 36 of file landmark_model.h.
std::vector<float> LandmarkModel::edge_lengths |
Lengths of all edges.
The ID of the edge is the index of the array and corresponds to edges indices.
Definition at line 47 of file landmark_model.h.
std::vector<std::pair<size_t, size_t> > LandmarkModel::edges |
Array of vertex ID pairs.
The ID of the edge is the index of the array and corresponds to edge_lengths indices.
Definition at line 55 of file landmark_model.h.
std::vector<float> LandmarkModel::hidim_vertices |
One-dimensional array storing d-dimensional landmark coordinates in row-major order.
Definition at line 39 of file landmark_model.h.
std::vector<glm::vec2> LandmarkModel::lodim_vertices |
Array storing two-dimensional landmark coordinates.
Definition at line 41 of file landmark_model.h.