cisst-saw
Toggle main menu visibility
Loading...
Searching...
No Matches
tmp
cisst-saw
cisst
cisstVector
vctStoreBackUnaryOperations.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, Anton Deguet
7
Created on: 2003-08-18
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
#pragma once
22
#ifndef _vctStoreBackUnaryOperations_h
23
#define _vctStoreBackUnaryOperations_h
24
29
55
template
<
class
_inputOutputElementType>
56
class
vctStoreBackUnaryOperations
57
{
58
public
:
59
typedef
_inputOutputElementType
InputOutputElementType
;
60
65
class
MakeAbs
{
66
public
:
71
static
inline
InputOutputElementType
Operate
(
InputOutputElementType
& inputOutput) {
72
return
(inputOutput = (inputOutput >
InputOutputElementType
(0))
73
?
74
InputOutputElementType
(inputOutput)
75
:
76
InputOutputElementType
(-inputOutput));
77
}
78
};
79
84
class
MakeNegation
{
85
public
:
90
static
inline
InputOutputElementType
Operate
(
InputOutputElementType
& inputOutput) {
91
return
(inputOutput =
InputOutputElementType
(-inputOutput));
92
}
93
};
94
99
class
MakeFloor
{
100
public
:
101
static
inline
InputOutputElementType
Operate
(
InputOutputElementType
& inputOutput) {
102
return
(inputOutput =
InputOutputElementType
( floor((
double
)inputOutput) ));
103
}
104
};
105
110
class
MakeCeil
{
111
public
:
112
static
inline
InputOutputElementType
Operate
(
InputOutputElementType
& inputOutput) {
113
return
(inputOutput =
InputOutputElementType
( ceil((
double
)inputOutput) ));
114
}
115
};
116
117
118
};
119
120
121
#endif
// _vctStoreBackUnaryOperations_h
122
vctStoreBackUnaryOperations::MakeAbs
Returns the absolute value of the input as an OutputType object.
Definition
vctStoreBackUnaryOperations.h:65
vctStoreBackUnaryOperations::MakeAbs::Operate
static InputOutputElementType Operate(InputOutputElementType &inputOutput)
Definition
vctStoreBackUnaryOperations.h:71
vctStoreBackUnaryOperations::MakeCeil
Returns the ceiling of the input, that is, the smallest integer greater-than or equal to the input,...
Definition
vctStoreBackUnaryOperations.h:110
vctStoreBackUnaryOperations::MakeCeil::Operate
static InputOutputElementType Operate(InputOutputElementType &inputOutput)
Definition
vctStoreBackUnaryOperations.h:112
vctStoreBackUnaryOperations::MakeFloor
Returns the floor of the input, that is, the largest integer less-than or equal to the input,...
Definition
vctStoreBackUnaryOperations.h:99
vctStoreBackUnaryOperations::MakeFloor::Operate
static InputOutputElementType Operate(InputOutputElementType &inputOutput)
Definition
vctStoreBackUnaryOperations.h:101
vctStoreBackUnaryOperations::MakeNegation
Returns the negation of the input as an OutputType object.
Definition
vctStoreBackUnaryOperations.h:84
vctStoreBackUnaryOperations::MakeNegation::Operate
static InputOutputElementType Operate(InputOutputElementType &inputOutput)
Definition
vctStoreBackUnaryOperations.h:90
vctStoreBackUnaryOperations
Define store back unary operations on an object as classes.
Definition
vctStoreBackUnaryOperations.h:57
vctStoreBackUnaryOperations::InputOutputElementType
_inputOutputElementType InputOutputElementType
Definition
vctStoreBackUnaryOperations.h:59
Generated by
1.18.0