-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCOGDefuzz.cpp
More file actions
101 lines (87 loc) · 2.28 KB
/
Copy pathCOGDefuzz.cpp
File metadata and controls
101 lines (87 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
// File: COGDefuzz.h
//
// Purpose: Center of Gravity Defuzzification method
//
// Author: Michael Zarozinski
// Date: 07/03/01
//
// Copyright © 2001 Louder Than A Bomb! Software
//
// $Log: COGDefuzz.cpp,v $
// Revision 1.2 2001-12-18 15:34:07-05 michael_zarozinski
// <>
//
// Revision 1.0 2001-12-11 20:43:08-05 michael_zarozinski
// Initial revision
//
// Revision 1.1 2001-08-05 12:37:50-04 michael_zarozinski
// check in before change defuzz obj - right now it's held in the member_func class and that doesn't work very well for things like MOM
//
// Revision 1.0 2001-08-01 21:48:18-04 michael_zarozinski
// Initial revision
//
//
//
// Static variables
static const char *Id = "$Header: C:\\Work\\RCS\\C\\Work\\Source\\Spark\\ClassLib\\SparkDll\\COGDefuzz.cpp,v 1.2 2001-12-18 15:34:07-05 michael_zarozinski Exp michael_zarozinski $";
// include files
#include "COGDefuzz.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#include "debug.h"
#endif
//
// Function:
//
// Purpose:
//
// Arguments:
//
//
//
// Algorithm:
//
//
//
// Returns:
//
//
//
// Globals:
//
// none
//
// Author: Michael Zarozinski
// Date:
//
// Modification History
// Author Date Modification
// ------ ---- ------------
//
//
COGDefuzz::COGDefuzz()
{
values = NULL;
}; // end COGDefuzz::COGDefuzz()
COGDefuzz::COGDefuzz(int array_max)
{
if (array_max > 0)
values = new _cog_struct[array_max];
// ???? should be an init() function????
}; // end COGDefuzz::COGDefuzz()
COGDefuzz::~COGDefuzz()
{
if (values)
delete[] values;
}; // end COGDefuzz::~COGDefuzz()
int COGDefuzz::get_defuzz_type(){ return DefuzzBase::COG;};
float COGDefuzz::get_cog(int _idx){return values[_idx].cog;};
float COGDefuzz::get_area(int _idx){return values[_idx].area;};
float COGDefuzz::get_moment(int _idx){return values[_idx].moment;};
unsigned char COGDefuzz::get_idx(int _idx){return values[_idx].idx;};
void COGDefuzz::set_cog(int _idx, float val){ values[_idx].cog = val;};
void COGDefuzz::set_area(int _idx, float val){ values[_idx].area = val;};
void COGDefuzz::set_moment(int _idx, float val){ values[_idx].moment = val;};
void COGDefuzz::set_idx(int _idx, unsigned char val){ values[_idx].idx = val;};