Skip to content

Commit

Permalink
fixed typos & menus for distance matrix distortion
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-tierny committed Jul 12, 2023
1 parent e873aad commit 686622f
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 55 deletions.
8 changes: 0 additions & 8 deletions core/base/distanceMatrixDistorsion/CMakeLists.txt

This file was deleted.

8 changes: 8 additions & 0 deletions core/base/distanceMatrixDistortion/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ttk_add_base_library(distanceMatrixDistortion
SOURCES
DistanceMatrixDistortion.cpp
HEADERS
DistanceMatrixDistortion.h
DEPENDS
geometry
)
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#include <DistanceMatrixDistorsion.h>
#include <DistanceMatrixDistortion.h>
#include <Geometry.h> // To check wheter a double is zero.
#include <Os.h>
#include <random>
#include <vector>

ttk::DistanceMatrixDistorsion::DistanceMatrixDistorsion() {
this->setDebugMsgPrefix("DistanceMatrixDistorsion");
ttk::DistanceMatrixDistortion::DistanceMatrixDistortion() {
this->setDebugMsgPrefix("DistanceMatrixDistortion");
}

int ttk::DistanceMatrixDistorsion::execute(
int ttk::DistanceMatrixDistortion::execute(
const std::vector<double *> &highDistMatrix,
const std::vector<double *> &lowDistMatrix,
double &distorsionValue,
Expand All @@ -20,7 +20,7 @@ int ttk::DistanceMatrixDistorsion::execute(
this->printErr(" Sizes mismatch: the high distance matrix has "
+ std::to_string(n)
+ " rows and the low distance matrix has "
+ std::to_string(lowDistMatrix.size()) + " rows\n.");
+ std::to_string(lowDistMatrix.size()) + " rows.");
return 0;
}

Expand Down Expand Up @@ -55,7 +55,7 @@ int ttk::DistanceMatrixDistorsion::execute(
if(maxi <= EPS) // We consider maxi is equal to zero.
{
this->printMsg(
"The two distance matrices provided for SIM computation are equal.\n");
"The two distance matrices provided for SIM computation are equal.");
maxi = 1;
}

Expand All @@ -78,7 +78,7 @@ int ttk::DistanceMatrixDistorsion::execute(

distorsionValue = totalSum / n;

this->printMsg("Size of output in ttk/base = " + std::to_string(n) + "\n");
this->printMsg("Size of output in ttk/base = " + std::to_string(n));

this->printMsg("Computed distorsion value: "
+ std::to_string(distorsionValue));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/// \ingroup base
/// \class ttk::DistanceMatrixDistorsion
/// \class ttk::DistanceMatrixDistortion
/// \author Alexandre Talon <alexandre.talon@lip6.fr>
/// \date January 2022
///
/// This module defines the %DistanceMatrixDistorsion class that computes a
/// This module defines the %DistanceMatrixDistortion class that computes a
/// score indicating how good the low dimension distance matrix represents the
/// high dimension one. The score is computed according to the SIM formula.
///
Expand All @@ -13,7 +13,7 @@
/// Mathieu Pont, Jules Vidal and Julien Tierny.
/// IEEE Transactions on Visualization and Computer Graphics, 2023.
///
/// \sa DistanceMatrixDistorsion
/// \sa DistanceMatrixDistortion

#pragma once

Expand All @@ -24,14 +24,14 @@
namespace ttk {

/**
* The DistanceMatrixDistorsion class provides a method to compute the
* The DistanceMatrixDistortion class provides a method to compute the
* distorsion score between two distance matrices representing the same
* points.
*/
class DistanceMatrixDistorsion : virtual public Debug {
class DistanceMatrixDistortion : virtual public Debug {

public:
DistanceMatrixDistorsion();
DistanceMatrixDistortion();

int execute(const std::vector<double *> &highDistMatrix,
const std::vector<double *> &lowDistMatrix,
Expand Down
9 changes: 0 additions & 9 deletions core/vtk/ttkDistanceMatrixDistorsion/ttk.module

This file was deleted.

4 changes: 0 additions & 4 deletions core/vtk/ttkDistanceMatrixDistorsion/vtk.module

This file was deleted.

9 changes: 9 additions & 0 deletions core/vtk/ttkDistanceMatrixDistortion/ttk.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
NAME
ttkDistanceMatrixDistortion
SOURCES
ttkDistanceMatrixDistortion.cpp
HEADERS
ttkDistanceMatrixDistortion.h
DEPENDS
distanceMatrixDistortion
ttkAlgorithm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <ttkDistanceMatrixDistorsion.h>
#include <ttkDistanceMatrixDistortion.h>

#include <vtkInformation.h>

Expand All @@ -18,14 +18,14 @@

// A VTK macro that enables the instantiation of this class via ::New()
// You do not have to modify this
vtkStandardNewMacro(ttkDistanceMatrixDistorsion);
vtkStandardNewMacro(ttkDistanceMatrixDistortion);

ttkDistanceMatrixDistorsion::ttkDistanceMatrixDistorsion() {
ttkDistanceMatrixDistortion::ttkDistanceMatrixDistortion() {
this->SetNumberOfInputPorts(2);
this->SetNumberOfOutputPorts(1);
}

int ttkDistanceMatrixDistorsion::FillInputPortInformation(
int ttkDistanceMatrixDistortion::FillInputPortInformation(
int port, vtkInformation *info) {
if(port == 0) {
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkTable");
Expand All @@ -37,7 +37,7 @@ int ttkDistanceMatrixDistorsion::FillInputPortInformation(
return 0;
}

int ttkDistanceMatrixDistorsion::FillOutputPortInformation(
int ttkDistanceMatrixDistortion::FillOutputPortInformation(
int port, vtkInformation *info) {
if(port == 0) {
info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkTable");
Expand All @@ -60,7 +60,7 @@ inline void fillWithInputColumns(vtkTable *input,
}
}

int ttkDistanceMatrixDistorsion::RequestData(
int ttkDistanceMatrixDistortion::RequestData(
vtkInformation *ttkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector) {
Expand Down Expand Up @@ -136,7 +136,7 @@ int ttkDistanceMatrixDistorsion::RequestData(
tmpCol->SetName("SimValue");
// No deep copy, makes output->RowData points to the data of tmpCol.
output->AddColumn(tmpCol);
distorsionValArray->SetName("DistorsionValue");
distorsionValArray->SetName("DistortionValue");
distorsionValArray->SetNumberOfTuples(1);
distorsionValArray->SetTuple1(0, distorsionValue);
output->GetFieldData()->AddArray(distorsionValArray);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/// \ingroup vtk
/// \class ttkDistanceMatrixDistorsion
/// \class ttkDistanceMatrixDistortion
/// \author Alexandre Talon <alexandre.talon@lip6.fr>
/// \date January 2022.
///
/// \brief TTK VTK-filter that wraps the ttk::DistanceMatrixDistorsion module.
/// \brief TTK VTK-filter that wraps the ttk::DistanceMatrixDistortion module.
///
/// This VTK filter uses the ttk::DistanceMatrixDistorsion module to compute the
/// This VTK filter uses the ttk::DistanceMatrixDistortion module to compute the
/// distorsion between two distance matrices representing the same points (for
/// instance in low and high dimensions), according to the SIM formula.
///
Expand All @@ -27,24 +27,24 @@
/// See the related ParaView example state files for usage examples within a
/// VTK pipeline.
///
/// \sa ttk::DistanceMatrixDistorsion
/// \sa ttk::DistanceMatrixDistortion
/// \sa ttkAlgorithm

#pragma once

// VTK Module
#include <ttkDistanceMatrixDistorsionModule.h>
#include <ttkDistanceMatrixDistortionModule.h>

// VTK Includes
#include <ttkAlgorithm.h>

// TTK Base Includes
#include <DistanceMatrixDistorsion.h>
#include <DistanceMatrixDistortion.h>

class TTKDISTANCEMATRIXDISTORSION_EXPORT ttkDistanceMatrixDistorsion
class TTKDISTANCEMATRIXDISTORTION_EXPORT ttkDistanceMatrixDistortion
: public ttkAlgorithm // we inherit from the generic ttkAlgorithm class
,
protected ttk::DistanceMatrixDistorsion // and we inherit from the base
protected ttk::DistanceMatrixDistortion // and we inherit from the base
// class
{
private:
Expand Down Expand Up @@ -77,8 +77,8 @@ class TTKDISTANCEMATRIXDISTORSION_EXPORT ttkDistanceMatrixDistorsion
Modified();
}

static ttkDistanceMatrixDistorsion *New();
vtkTypeMacro(ttkDistanceMatrixDistorsion, ttkAlgorithm);
static ttkDistanceMatrixDistortion *New();
vtkTypeMacro(ttkDistanceMatrixDistortion, ttkAlgorithm);

// Two functions because two inputs. Used for columns selection.
void SetScalarFieldsHigh(const std::string &s) {
Expand All @@ -91,8 +91,8 @@ class TTKDISTANCEMATRIXDISTORSION_EXPORT ttkDistanceMatrixDistorsion
}

protected:
ttkDistanceMatrixDistorsion();
~ttkDistanceMatrixDistorsion() override = default;
ttkDistanceMatrixDistortion();
~ttkDistanceMatrixDistortion() override = default;

int FillInputPortInformation(int port, vtkInformation *info) override;

Expand Down
4 changes: 4 additions & 0 deletions core/vtk/ttkDistanceMatrixDistortion/vtk.module
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NAME
ttkDistanceMatrixDistortion
DEPENDS
ttkAlgorithm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<ServerManagerConfiguration>
<ProxyGroup name="filters">
<SourceProxy name="ttkDistanceMatrixDistorsion" class="ttkDistanceMatrixDistorsion" label="TTK DistanceMatrixDistorsion">
<Documentation long_help="DistanceMatrixDistorsion plugin" short_help="DistanceMatrixDistorsion plugin">This plugin, given two distance matrices representing the same points, computes the distortion between the two, according the SIM formula. It also provides, for each point, the distorsion for its own distances to the other points.</Documentation>
<SourceProxy name="ttkDistanceMatrixDistortion" class="ttkDistanceMatrixDistortion" label="TTK DistanceMatrixDistortion">
<Documentation long_help="DistanceMatrixDistortion plugin" short_help="DistanceMatrixDistortion plugin">This plugin, given two distance matrices representing the same points, computes the distortion between the two, according the SIM formula. It also provides, for each point, the distorsion for its own distances to the other points.</Documentation>

<!-- INPUT DATA OBJECTS -->
<InputProperty
Expand Down

0 comments on commit 686622f

Please sign in to comment.