20 #ifndef IPO_DETAIL_SHAREDFUNCTIONPTR_HPP
21 #define IPO_DETAIL_SHAREDFUNCTIONPTR_HPP
24 #include"../../ipo_function/Function.hpp"
50 try {
count =
new size_t; }
catch( std::bad_alloc& e ){
182 bool unique()
const {
return count != 0 and *count == 1; }
193 explicit operator bool()
const {
return pointer != 0; }
bool operator==(SharedFunctionPtr const &v) const
Two SharedFunctionPtr are identically equal if they point to the same object.
Shared pointer to ipo::Function object.
SharedFunctionPtr(SharedFunctionPtr &&v)
Move constructor.
bool operator!=(SharedFunctionPtr const &v) const
Two SharedFunctionPtr are different equal if they point to different objectd.
SharedFunctionPtr()
The default constructor is only really useful for assigning to.
size_t use_count() const
Find how many SharedFunctionPtr objects share this pointer.
SharedFunctionPtr(ipo_function::Function &function)
Construct from a Function object.
SharedFunctionPtr & operator=(SharedFunctionPtr const &v)
The assignment operator.
SharedFunctionPtr(SharedFunctionPtr const &v)
The copy constructor.
void swap(SharedFunctionPtr &v)
Swap two SharedFunctionPtr objects.
void swap(Array &first, Array &second)
Swap contents of container with those of another.
SharedFunctionPtr(ipo_function::Function *function)
Construct from a pointer to a function.
This class computes a function at a vector.
ipo_function::Function * operator->() const
Get a pointer to the function.
bool owner
Ownership flag.
~SharedFunctionPtr()
The destructor only deletes the pointers if count reaches zero.
SharedFunctionPtr & operator=(SharedFunctionPtr &&v)
Move operator.
ipo_function::Function & operator*() const
Get a reference to the function.
size_t * count
The shared reference count.
ipo_function::Function * pointer
The shared pointer.
bool unique() const
Find if this is the only object sharing the gsl_SharedFunctionPtr.
This namespace holds all the interior-point optimisation classes.