libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
cosinesimilarity.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/processing/compartraces/cosinesimilarity.h
3
* \date 12/06/2023
4
* \author Olivier Langella
5
* \brief computes cosine similarity of 2 traces vector
6
* https://en.wikipedia.org/wiki/Cosine_similarity
7
*/
8
9
/*******************************************************************************
10
* Copyright (c) 2023 Olivier Langella <Olivier.Langella@u-psud.fr>.
11
*
12
* This file is part of PAPPSOms-tools.
13
*
14
* PAPPSOms-tools is free software: you can redistribute it and/or modify
15
* it under the terms of the GNU General Public License as published by
16
* the Free Software Foundation, either version 3 of the License, or
17
* (at your option) any later version.
18
*
19
* PAPPSOms-tools is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22
* GNU General Public License for more details.
23
*
24
* You should have received a copy of the GNU General Public License
25
* along with PAPPSOms-tools. If not, see <http://www.gnu.org/licenses/>.
26
*
27
******************************************************************************/
28
29
#pragma once
30
31
32
#include "
pappsomspp/export-import-config.h
"
33
#include "
pappsomspp/core/trace/trace.h
"
34
35
36
namespace
pappso
37
{
38
/**
39
* @todo write docs
40
*/
41
class
PMSPP_LIB_DECL
CosineSimilarity
42
{
43
public
:
44
/**
45
* Default constructor
46
*/
47
CosineSimilarity
(
PrecisionPtr
precision);
48
49
/**
50
* Copy constructor
51
*
52
* @param other TODO
53
*/
54
CosineSimilarity
(
const
CosineSimilarity
&other);
55
56
/**
57
* Destructor
58
*/
59
~CosineSimilarity
();
60
61
double
similarity(
pappso::Trace
trace_a,
pappso::Trace
trace_b)
const
;
62
63
private
:
64
PrecisionPtr
mp_precision
;
65
FilterInterfaceSPtr
msp_filterExclusion
;
66
};
67
}
// namespace pappso
pappso::CosineSimilarity
Definition
cosinesimilarity.h:42
pappso::CosineSimilarity::mp_precision
PrecisionPtr mp_precision
Definition
cosinesimilarity.h:64
pappso::CosineSimilarity::msp_filterExclusion
FilterInterfaceSPtr msp_filterExclusion
Definition
cosinesimilarity.h:65
pappso::PrecisionBase
Definition
precision.h:44
pappso::Trace
A simple container of DataPoint instances.
Definition
trace.h:152
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition
export-import-config.h:14
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition
aa.cpp:39
pappso::FilterInterfaceSPtr
std::shared_ptr< FilterInterface > FilterInterfaceSPtr
Definition
filterinterface.h:46
trace.h
pappsomspp
core
processing
compartraces
cosinesimilarity.h
Generated on Tue May 19 2026 12:52:14 for libpappsomspp by
1.9.8