BlosSOM
Interactive dimensionality reduction on large datasets (EmbedSOM and FLOWER combined)
Public Member Functions | Public Attributes | List of all members
LandmarkModel Struct Reference

Model of the high- and low-dimensional landmarks. More...

#include <landmark_model.h>

Inheritance diagram for LandmarkModel:
Inheritance graph
[legend]
Collaboration diagram for LandmarkModel:
Collaboration graph
[legend]

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...
 
- Public Member Functions inherited from Dirt
 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...
 
- Public Attributes inherited from Dirt
int dirt
 

Detailed Description

Model of the high- and low-dimensional landmarks.

Definition at line 33 of file landmark_model.h.

Constructor & Destructor Documentation

◆ LandmarkModel()

LandmarkModel::LandmarkModel ( )

Creates empty landmarks with dimension 0.

Definition at line 25 of file landmark_model.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ add()

void LandmarkModel::add ( const glm::vec2 &  mouse_pos)

Creates new landmark with the two- and high-dimensional coordinates as the closeset landmark.

Parameters
mouse_posMouse screen position.

Definition at line 93 of file landmark_model.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ closest_landmark()

size_t LandmarkModel::closest_landmark ( const glm::vec2 &  mouse_pos) const

Counts closest landmark to the given position.

Parameters
mouse_posMouse screen position.
Returns
size_t Index of the closest landmark.

Definition at line 153 of file landmark_model.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ duplicate()

void LandmarkModel::duplicate ( size_t  ind)

Creates new landmark with the same two- and high-dimensional coordinates as the given landmark.

Parameters
indIndex of the landmark which will be duplicated.

Definition at line 77 of file landmark_model.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_grid()

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.

Parameters
sideSide of the square.

Definition at line 32 of file landmark_model.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ move()

void LandmarkModel::move ( size_t  ind,
const glm::vec2 &  mouse_pos 
)

Sets two-dimensional position of the pressed landmark to mouse position.

Parameters
indIndex of the pressed landmark.
mouse_posMouse screen position.

Definition at line 70 of file landmark_model.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ n_landmarks()

size_t LandmarkModel::n_landmarks ( ) const
inline

Reurns number of the 2D landmarks.

Returns
size_t Number of the 2D landmarks.

Definition at line 120 of file landmark_model.h.

Here is the caller graph for this function:

◆ remove()

void LandmarkModel::remove ( size_t  ind)

Removes landmark and corresponding edges.

Parameters
indIndex of the removed landmark.

Definition at line 110 of file landmark_model.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_dim()

void LandmarkModel::update_dim ( size_t  dim)

Updates current dimension and calls init_grid().

Parameters
dim

Definition at line 61 of file landmark_model.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ d

size_t LandmarkModel::d

Dimension size.

Definition at line 36 of file landmark_model.h.

◆ edge_lengths

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.

◆ edges

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.

Warning
constraint: first vertex ID < second vertex ID

Definition at line 55 of file landmark_model.h.

◆ hidim_vertices

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.

◆ lodim_vertices

std::vector<glm::vec2> LandmarkModel::lodim_vertices

Array storing two-dimensional landmark coordinates.

Definition at line 41 of file landmark_model.h.


The documentation for this struct was generated from the following files: