libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
cardano.h
Go to the documentation of this file.
1
/**
2
* \file pappsomspp/vendors/tims/mzcalibration/cardano.h
3
* \date 17/12/2022
4
* \brief cubic solver adapted from
5
* https://www.codeproject.com/articles/798474/to-solve-a-cubic-equation
6
thanks
7
* to "Sergey Bochkanov" <sergey.bochkanov@alglib.net> for his advise
8
*/
9
10
/*******************************************************************************
11
* Copyright (c) 2022 Olivier Langella <Olivier.Langella@u-psud.fr>.
12
*
13
* This file is part of the PAPPSOms++ library.
14
*
15
* PAPPSOms++ is free software: you can redistribute it and/or modify
16
* it under the terms of the GNU General Public License as published by
17
* the Free Software Foundation, either version 3 of the License, or
18
* (at your option) any later version.
19
*
20
* PAPPSOms++ is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23
* GNU General Public License for more details.
24
*
25
* You should have received a copy of the GNU General Public License
26
* along with PAPPSOms++. If not, see <http://www.gnu.org/licenses/>.
27
*
28
******************************************************************************/
29
30
#pragma once
31
32
#include <vector>
33
#include <cstdint>
34
35
enum class
CardanoResultCase
: std::int8_t
36
{
37
notvalid
,
38
zerod
,
39
negatived
,
40
positived
,
41
quadratic
,
42
line
43
};
44
45
46
struct
InHousePolynomialSolverResult
47
{
48
CardanoResultCase
type
;
49
double
x1
;
50
double
x2
;
51
double
x3
;
52
};
53
54
55
InHousePolynomialSolverResult
56
inHousePolynomialSolve
(
const
std::vector<double> &polynome);
CardanoResultCase
CardanoResultCase
Definition
cardano.h:36
CardanoResultCase::positived
@ positived
CardanoResultCase::line
@ line
CardanoResultCase::notvalid
@ notvalid
CardanoResultCase::zerod
@ zerod
CardanoResultCase::quadratic
@ quadratic
CardanoResultCase::negatived
@ negatived
inHousePolynomialSolve
InHousePolynomialSolverResult inHousePolynomialSolve(const std::vector< double > &polynome)
Definition
cardano.cpp:118
InHousePolynomialSolverResult
Definition
cardano.h:47
InHousePolynomialSolverResult::x2
double x2
Definition
cardano.h:50
InHousePolynomialSolverResult::type
CardanoResultCase type
Definition
cardano.h:48
InHousePolynomialSolverResult::x3
double x3
Definition
cardano.h:51
InHousePolynomialSolverResult::x1
double x1
Definition
cardano.h:49
pappsomspp
vendors
tims
mzcalibration
cardano.h
Generated on Tue Dec 19 2023 19:41:40 for libpappsomspp by
1.9.8