cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstNumerical
nmrSingleVariablePowerBasis.h
Go to the documentation of this file.
1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3
4
/*
5
6
Author(s): Ofri Sadowsky
7
Created on: 2003-08-20
8
9
(C) Copyright 2003-2007 Johns Hopkins University (JHU), All Rights
10
Reserved.
11
12
--- begin cisst license - do not edit ---
13
14
This software is provided "as is" under an open source license, with
15
no warranty. The complete license can be found in license.txt and
16
http://www.cisst.org/cisst/license.txt.
17
18
--- end cisst license ---
19
*/
20
21
22
#ifndef _nmrSingleVariablePowerBasis_h
23
#define _nmrSingleVariablePowerBasis_h
24
25
26
#include <vector>
27
#include <algorithm>
28
#include <assert.h>
29
30
#include <
cisstCommon/cmnPortability.h
>
31
#include <
cisstNumerical/nmrPolynomialTermPowerIndex.h
>
32
#include <
cisstNumerical/nmrExport.h
>
33
34
#ifdef CISST_COMPILER_IS_MSVC
35
#pragma warning(push)
36
#pragma warning(disable:4996)
37
#endif
// ifdef CISST_COMPILER_IS_MSVC
42
class
CISST_EXPORT
CISST_DEPRECATED
nmrSingleVariablePowerBasis
43
{
44
public
:
45
typedef
double
VariableType
;
46
typedef
nmrPolynomialTermPowerIndex::PowerType
PowerType
;
47
48
private
:
49
typedef
std::vector<VariableType> PowersContainerType;
50
PowersContainerType PowersContainer;
51
52
public
:
53
nmrSingleVariablePowerBasis
(
PowerType
degree)
54
: PowersContainer(
std
::max<
PowerType
>(degree+1,2), 0)
55
{
56
PowersContainer[0] = 1;
57
}
58
62
void
Initialize
(
PowerType
degree)
63
{
64
PowersContainer.resize(degree+1);
65
PowersContainer.assign(degree+1, 0);
66
PowersContainer[0] = 1;
67
}
68
70
PowerType
GetDegree
()
const
71
{
72
return
PowersContainer.size() - 1;
73
}
74
76
VariableType
GetVariable
()
const
77
{
78
return
PowersContainer[1];
79
}
80
82
VariableType
GetVariablePower
(
PowerType
power)
const
83
{
84
assert(power <=
GetDegree
());
85
return
PowersContainer[power];
86
}
87
89
VariableType
operator[]
(
PowerType
power)
const
90
{
91
return
PowersContainer[power];
92
}
93
95
void
SetVariable
(
VariableType
variable);
96
};
97
#ifdef CISST_COMPILER_IS_MSVC
98
#pragma warning(pop)
99
#endif
// ifdef CISST_COMPILER_IS_MSVC
100
101
#endif
nmrPolynomialTermPowerIndex::PowerType
int PowerType
Definition
nmrPolynomialTermPowerIndex.h:98
nmrSingleVariablePowerBasis::GetVariablePower
VariableType GetVariablePower(PowerType power) const
Definition
nmrSingleVariablePowerBasis.h:82
nmrSingleVariablePowerBasis::VariableType
double VariableType
Definition
nmrSingleVariablePowerBasis.h:45
nmrSingleVariablePowerBasis::GetDegree
PowerType GetDegree() const
Definition
nmrSingleVariablePowerBasis.h:70
nmrSingleVariablePowerBasis::nmrSingleVariablePowerBasis
nmrSingleVariablePowerBasis(PowerType degree)
Definition
nmrSingleVariablePowerBasis.h:53
nmrSingleVariablePowerBasis::Initialize
void Initialize(PowerType degree)
Definition
nmrSingleVariablePowerBasis.h:62
nmrSingleVariablePowerBasis::operator[]
VariableType operator[](PowerType power) const
Definition
nmrSingleVariablePowerBasis.h:89
nmrSingleVariablePowerBasis::GetVariable
VariableType GetVariable() const
Definition
nmrSingleVariablePowerBasis.h:76
nmrSingleVariablePowerBasis::SetVariable
void SetVariable(VariableType variable)
nmrSingleVariablePowerBasis::PowerType
nmrPolynomialTermPowerIndex::PowerType PowerType
Definition
nmrSingleVariablePowerBasis.h:46
CISST_EXPORT
#define CISST_EXPORT
Definition
cmnExportMacros.h:50
cmnPortability.h
Portability across compilers and operating systems tools.
CISST_DEPRECATED
#define CISST_DEPRECATED
Definition
cmnPortability.h:314
std
STL namespace.
nmrExport.h
Rules of exporting.
nmrPolynomialTermPowerIndex.h
Declare class nmrPolynomialTermPowerIndex to represent the power index of a single term in a multi-va...
Generated by
1.18.0