Fish - FiberLib for VISH 0.3
Fish - The Fiber Bundle API for the Vish Visualization Shell
Fiber::BinaryOperator< Operator, PrimaryValueType, SecondaryValueType, ResultValueType > Struct Template Reference

Implementing a binary operation on two fields with on-demand computation per fragment and discarding data when memory is tight. More...

#include <BinaryOperator.hpp>

Public Types

typedef PrimaryValueType primary_value_type
typedef SecondaryValueType secondary_value_type
typedef ResultValueType result_type

Public Member Functions

 BinaryOperator (const RefPtr< Field > &theSecondaryField)
 The constructor, wants to know about the secondary field.
template<Dims_t Dims>
bool computeFragment (MemArray< Dims, result_type > &Result, const MemArray< Dims, primary_value_type > &PrimaryArray, const RefPtr< FragmentID > &myFragmentID)

Public Attributes

RefPtr< FieldSecondaryField

Detailed Description

template<class Operator, class PrimaryValueType, class SecondaryValueType = PrimaryValueType, class ResultValueType = PrimaryValueType>
struct Fiber::BinaryOperator< Operator, PrimaryValueType, SecondaryValueType, ResultValueType >

Implementing a binary operation on two fields with on-demand computation per fragment and discarding data when memory is tight.

To be used in conjunction with the ComputationalField class. The Operator API is compatible with the Operators as defined in the Eagle library, and it is easiest to just use one of those.

Example usage:

RefPtr<Field> BinaryDoubleAdditionComputationalField(const RefPtr<Field>&L, const RefPtr<Field>&R)
{
BinaryOperator<Eagle::Operator<'+'>, double > BO(R);
return newComputationalField(BO, L);
}
StrongPtr< Object, ObjectBase > RefPtr
ComputationalField< FieldOperator > * newComputationalField(const FieldOperator &FO, const RefPtr< Field > &InputField, const MemCore::RefPtr< MemCore::Cache > &theCache=MemCore::Cache::MemCache())
A convenience template function to construct a computational field (class ComputationalField) from an...
Definition ComputationalField.hpp:266
BinaryOperator(const RefPtr< Field > &theSecondaryField)
The constructor, wants to know about the secondary field.
Definition BinaryOperator.hpp:49

This class implements the computeFragment() function as expected by the ComputationalField class.

Constructor & Destructor Documentation

◆ BinaryOperator()

template<class Operator, class PrimaryValueType, class SecondaryValueType = PrimaryValueType, class ResultValueType = PrimaryValueType>
Fiber::BinaryOperator< Operator, PrimaryValueType, SecondaryValueType, ResultValueType >::BinaryOperator ( const RefPtr< Field > & theSecondaryField)
inline

The constructor, wants to know about the secondary field.

The primary field will be specified via the ComputationalField constructor.