Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120139864
functionObjects.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Wed, Jul 2, 05:22
Size
1 KB
Mime Type
text/x-c++
Expires
Fri, Jul 4, 05:22 (2 d)
Engine
blob
Format
Raw Data
Handle
27146266
Attached To
rCADDMESH CADD_mesher
functionObjects.h
View Options
/****************************************************************************
**
** Copyright (c) 2008-2012 C.B. Barber. All rights reserved.
** $Id: //main/2011/qhull/src/libqhullrcpp/functionObjects.h#1 $$Change: 1640 $
** $DateTime: 2014/01/15 09:12:08 $$Author: bbarber $
**
****************************************************************************/
#ifndef QHFUNCTIONOBJECTS_H
#define QHFUNCTIONOBJECTS_H
#include <stdlib.h>
#include <math.h>
namespace orgQhull {
#//Type
//! Sum of absolute values of the elements in a container
class AbsoluteSumOf;
//! Sum of the elements in a container
class SumOf;
//! Sum of squares of the elements in a container
class SumSquaresOf;
#//Class
//! Absolute sum of the elements in a container
class AbsoluteSumOf
{
private:
double sum;
public:
inline AbsoluteSumOf() : sum(0.0) {}
inline void operator()(double v) { sum += fabs(v); }
inline operator double() { return sum; }
};//AbsoluteSumOf
//! Sum of the elements in a container
class SumOf
{
private:
double sum;
public:
inline SumOf() : sum(0.0) {}
inline void operator()(double v) { sum += v; }
inline operator double() { return sum; }
};//SumOf
//! Sum of squares of the elements in a container
class SumSquaresOf
{
private:
double sum;
public:
inline SumSquaresOf() : sum(0.0) {}
inline void operator()(double v) { sum += v*v; }
inline operator double() { return sum; }
};//SumSquaresOf
}//orgQhull
#endif //QHFUNCTIONOBJECTS_H
Event Timeline
Log In to Comment