LSST Applications g0d97872fb5+4fd969bb9d,g1653933729+34a971ddd9,g28da252d5a+072f89fe25,g2bbee38e9b+a99b0ab4cd,g2bc492864f+a99b0ab4cd,g2ca4be77d2+c0e3b27cd8,g2cdde0e794+704103fe75,g3156d2b45e+6e87dc994a,g347aa1857d+a99b0ab4cd,g35bb328faa+34a971ddd9,g3a166c0a6a+a99b0ab4cd,g3e281a1b8c+8ec26ec694,g4005a62e65+ba0306790b,g414038480c+9ed5ed841a,g569e0e2b34+cb4faa46ad,g5a97de2502+520531a62c,g717e5f8c0f+29153700a5,g7ede599f99+367733290c,g80478fca09+17051a22cc,g82479be7b0+f2f1ea0a87,g858d7b2824+29153700a5,g8b782ad322+29153700a5,g8cd86fa7b1+05420e7f7d,g9125e01d80+34a971ddd9,ga5288a1d22+e7f674aaf3,gae0086650b+34a971ddd9,gae74b0b5c6+45ef5cdc51,gb58c049af0+ace264a4f2,gc28159a63d+a99b0ab4cd,gcf0d15dbbd+8051a81198,gda6a2b7d83+8051a81198,gdaeeff99f8+7774323b41,gdf4d240d4a+34a971ddd9,ge2409df99d+cb167bac99,ge33fd446bb+29153700a5,ge79ae78c31+a99b0ab4cd,gf0baf85859+890af219f9,gf5289d68f6+9faa5c5784,w.2024.36
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
lsst::gauss2d::VectorImage< T > Class Template Reference

#include <vectorimage.h>

Inheritance diagram for lsst::gauss2d::VectorImage< T >:
lsst::gauss2d::Image< T, VectorImage< T > > lsst::gauss2d::Object

Public Member Functions

 VectorImage (size_t n_rows, size_t n_cols, const T *value_init=Image< T, VectorImage< T > >::_value_default_ptr(), std::shared_ptr< const CoordinateSystem > coordsys=nullptr)
 
 ~VectorImage ()=default
 
T & _get_value_impl (size_t row, size_t col)
 
T & _get_value_unchecked_impl (size_t row, size_t col)
 
void add_value_unchecked_impl (size_t row, size_t col, T value)
 
get_value_unchecked_impl (size_t row, size_t col) const
 
void set_value_impl (size_t row, size_t col, T value)
 
void set_value_unchecked_impl (size_t row, size_t col, T value)
 
size_t get_n_cols_impl () const
 
size_t get_n_rows_impl () const
 
T & _get_value (size_t row, size_t col)
 
T & _get_value_unchecked (size_t row, size_t col)
 
void _check_row_col (size_t row, size_t col) const
 
void _check_row_col_impl (size_t row, size_t col) const
 
const CoordinateSystemget_coordsys () const
 
std::shared_ptr< const CoordinateSystemget_coordsys_ptr_const () const
 
size_t get_n_cols () const
 
size_t get_n_rows () const
 
size_t get_n_rows_impl ()=delete
 
void add_value (size_t row, size_t col, T value)
 
void add_value_impl (size_t row, size_t col, T value)
 
void add_value_unchecked (size_t row, size_t col, T value)
 
void fill (T value)
 
void fill_impl (T value)
 
get_value (size_t row, size_t col) const
 
get_value_impl (size_t row, size_t col) const
 
get_value_unchecked (size_t row, size_t col) const
 
void set_value (size_t row, size_t col, T value)
 
void set_value_unchecked (size_t row, size_t col, T value)
 
std::array< size_t, 2 > shape () const
 
size_t size () const
 
std::string repr (bool name_keywords, std::string_view namespace_separator) const override
 Return a full, callable string representation of this.
 
std::string str () const override
 Return a brief, human-readable string representation of this.
 
Image< T, VectorImage< T > > & operator+= (T value)
 
Image< T, VectorImage< T > > & operator*= (T value)
 
bool operator== (const Image &other) const
 
const bool operator!= (const Image &other) const
 

Static Public Member Functions

static const T * _value_default_ptr ()
 
static std::string_view null_str (const std::string_view &namespace_separator)
 

Static Public Attributes

static constexpr T _value_default
 
static constexpr std::string_view CC_NAMESPACE_SEPARATOR = "::"
 The C++ namespace separator.
 
static constexpr std::string_view NULL_STR_GENERAL = "None"
 
static constexpr std::string_view PY_NAMESPACE_SEPARATOR = "."
 

Detailed Description

template<typename T>
class lsst::gauss2d::VectorImage< T >

Definition at line 43 of file vectorimage.h.

Constructor & Destructor Documentation

◆ VectorImage()

template<typename T >
lsst::gauss2d::VectorImage< T >::VectorImage ( size_t n_rows,
size_t n_cols,
const T * value_init = Image<T, VectorImage<T>>::_value_default_ptr(),
std::shared_ptr< const CoordinateSystem > coordsys = nullptr )
inlineexplicit

Definition at line 45 of file vectorimage.h.

48 : Image<T, VectorImage<T>>(coordsys), _n_rows(n_rows), _n_cols(n_cols) {
49 _data.resize(n_rows);
50 // No real option but to resize with vectors
51 // Just reserving would cause _unchecked calls to break
52 T value_init_override
53 = value_init != nullptr ? *value_init : (Image<T, VectorImage<T>>::_value_default);
54 for (size_t row = 0; row < _n_rows; row++) {
55 _data[row].resize(n_cols, value_init_override);
56 }
57 }
T resize(T... args)
int row
Definition CR.cc:145
g2d::python::Image< double > Image
Definition test_image.cc:14

◆ ~VectorImage()

template<typename T >
lsst::gauss2d::VectorImage< T >::~VectorImage ( )
default

Member Function Documentation

◆ _check_row_col()

void lsst::gauss2d::Image< T, VectorImage< T > >::_check_row_col ( size_t row,
size_t col ) const
inlineinherited

Definition at line 133 of file image.h.

◆ _check_row_col_impl()

void lsst::gauss2d::Image< T, VectorImage< T > >::_check_row_col_impl ( size_t row,
size_t col ) const
inlineinherited

Definition at line 134 of file image.h.

◆ _get_value()

T & lsst::gauss2d::Image< T, VectorImage< T > >::_get_value ( size_t row,
size_t col )
inlineinherited

Definition at line 123 of file image.h.

◆ _get_value_impl()

template<typename T >
T & lsst::gauss2d::VectorImage< T >::_get_value_impl ( size_t row,
size_t col )
inline

Definition at line 60 of file vectorimage.h.

60 {
61 // This doesn't work on vector<bool> because it's bit-packed
62 // One could specialize: if constexpr (std::is_same_v<bool, T>)
63 // ... if there were a workable alternative, but there isn't.
64 if constexpr (std::is_same_v<bool, T>) {
65 throw std::logic_error("VectorImage<bool> cannot use _get_value");
66 } else {
67 // TODO: Check at performance vs default implementation
68 return this->_data.at(row).at(col);
69 }
70 }
T at(T... args)
int col
Definition CR.cc:144

◆ _get_value_unchecked()

T & lsst::gauss2d::Image< T, VectorImage< T > >::_get_value_unchecked ( size_t row,
size_t col )
inlineinherited

Definition at line 128 of file image.h.

◆ _get_value_unchecked_impl()

template<typename T >
T & lsst::gauss2d::VectorImage< T >::_get_value_unchecked_impl ( size_t row,
size_t col )
inline

Definition at line 71 of file vectorimage.h.

71 {
72 // See note in _get_value
73 if constexpr (std::is_same_v<bool, T>) {
74 throw std::logic_error("VectorImage<bool> cannot use _get_value_unchecked");
75 } else {
76 return this->_data[row][col];
77 }
78 }

◆ _value_default_ptr()

static const T * lsst::gauss2d::Image< T, VectorImage< T > >::_value_default_ptr ( )
inlinestaticinherited

Definition at line 121 of file image.h.

◆ add_value()

void lsst::gauss2d::Image< T, VectorImage< T > >::add_value ( size_t row,
size_t col,
T value )
inlineinherited

Definition at line 150 of file image.h.

◆ add_value_impl()

void lsst::gauss2d::Image< T, VectorImage< T > >::add_value_impl ( size_t row,
size_t col,
T value )
inlineinherited

Definition at line 151 of file image.h.

◆ add_value_unchecked()

void lsst::gauss2d::Image< T, VectorImage< T > >::add_value_unchecked ( size_t row,
size_t col,
T value )
inlineinherited

Definition at line 152 of file image.h.

◆ add_value_unchecked_impl()

template<typename T >
void lsst::gauss2d::VectorImage< T >::add_value_unchecked_impl ( size_t row,
size_t col,
T value )
inline

Definition at line 79 of file vectorimage.h.

79{ this->_data[row][col] += value; }

◆ fill()

void lsst::gauss2d::Image< T, VectorImage< T > >::fill ( T value)
inlineinherited

Definition at line 158 of file image.h.

◆ fill_impl()

void lsst::gauss2d::Image< T, VectorImage< T > >::fill_impl ( T value)
inlineinherited

Definition at line 159 of file image.h.

◆ get_coordsys()

const CoordinateSystem & lsst::gauss2d::Image< T, VectorImage< T > >::get_coordsys ( ) const
inlineinherited

Definition at line 142 of file image.h.

◆ get_coordsys_ptr_const()

std::shared_ptr< const CoordinateSystem > lsst::gauss2d::Image< T, VectorImage< T > >::get_coordsys_ptr_const ( ) const
inlineinherited

Definition at line 143 of file image.h.

◆ get_n_cols()

size_t lsst::gauss2d::Image< T, VectorImage< T > >::get_n_cols ( ) const
inlineinherited

Definition at line 145 of file image.h.

◆ get_n_cols_impl()

template<typename T >
size_t lsst::gauss2d::VectorImage< T >::get_n_cols_impl ( ) const
inline

Definition at line 84 of file vectorimage.h.

84{ return _n_cols; };

◆ get_n_rows()

size_t lsst::gauss2d::Image< T, VectorImage< T > >::get_n_rows ( ) const
inlineinherited

Definition at line 147 of file image.h.

◆ get_n_rows_impl() [1/2]

template<typename T >
size_t lsst::gauss2d::VectorImage< T >::get_n_rows_impl ( ) const
inline

Definition at line 85 of file vectorimage.h.

85{ return _n_rows; };

◆ get_n_rows_impl() [2/2]

size_t lsst::gauss2d::Image< T, VectorImage< T > >::get_n_rows_impl ( )
deleteinherited

◆ get_value()

T lsst::gauss2d::Image< T, VectorImage< T > >::get_value ( size_t row,
size_t col ) const
inlineinherited

Definition at line 168 of file image.h.

◆ get_value_impl()

T lsst::gauss2d::Image< T, VectorImage< T > >::get_value_impl ( size_t row,
size_t col ) const
inlineinherited

Definition at line 169 of file image.h.

◆ get_value_unchecked()

T lsst::gauss2d::Image< T, VectorImage< T > >::get_value_unchecked ( size_t row,
size_t col ) const
inlineinherited

Definition at line 173 of file image.h.

◆ get_value_unchecked_impl()

template<typename T >
T lsst::gauss2d::VectorImage< T >::get_value_unchecked_impl ( size_t row,
size_t col ) const
inline

Definition at line 80 of file vectorimage.h.

80{ return this->_data[row][col]; }

◆ null_str()

static std::string_view lsst::gauss2d::Object::null_str ( const std::string_view & namespace_separator)
inlinestaticinherited

Definition at line 49 of file object.h.

49 {
50 return namespace_separator == CC_NAMESPACE_SEPARATOR ? "nullptr" : NULL_STR_GENERAL;
51 }
static constexpr std::string_view CC_NAMESPACE_SEPARATOR
The C++ namespace separator.
Definition object.h:45
static constexpr std::string_view NULL_STR_GENERAL
Definition object.h:46

◆ operator!=()

const bool lsst::gauss2d::Image< T, VectorImage< T > >::operator!= ( const Image< T, VectorImage< T > > & other) const
inlineinherited

Definition at line 248 of file image.h.

◆ operator*=()

Image< T, VectorImage< T > > & lsst::gauss2d::Image< T, VectorImage< T > >::operator*= ( T value)
inlineinherited

Definition at line 213 of file image.h.

◆ operator+=()

Image< T, VectorImage< T > > & lsst::gauss2d::Image< T, VectorImage< T > >::operator+= ( T value)
inlineinherited

Definition at line 202 of file image.h.

◆ operator==()

bool lsst::gauss2d::Image< T, VectorImage< T > >::operator== ( const Image< T, VectorImage< T > > & other) const
inlineinherited

Definition at line 232 of file image.h.

◆ repr()

std::string lsst::gauss2d::Image< T, VectorImage< T > >::repr ( bool name_keywords,
std::string_view namespace_separator ) const
inlineoverridevirtualinherited

Return a full, callable string representation of this.

Parameters
name_keywordsWhether to prefix arguments with "{name}=", where name is the arg name in the header (as with keyword arguments in Python).
namespace_separatorThe string to use to delimit namespaces, i.e. :: in C++ and . in Python.
Returns
A callable string representation of this, which should return an an identical object to this.
Note
The representation with name_keywords=false must be callable in C++. The representation with name_keywords=true should be callable in Python, if there are any bindings.

Implements lsst::gauss2d::Object.

Definition at line 190 of file image.h.

◆ set_value()

void lsst::gauss2d::Image< T, VectorImage< T > >::set_value ( size_t row,
size_t col,
T value )
inlineinherited

Definition at line 177 of file image.h.

◆ set_value_impl()

template<typename T >
void lsst::gauss2d::VectorImage< T >::set_value_impl ( size_t row,
size_t col,
T value )
inline

Definition at line 81 of file vectorimage.h.

81{ this->_data.at(row).at(col) = value; }

◆ set_value_unchecked()

void lsst::gauss2d::Image< T, VectorImage< T > >::set_value_unchecked ( size_t row,
size_t col,
T value )
inlineinherited

Definition at line 179 of file image.h.

◆ set_value_unchecked_impl()

template<typename T >
void lsst::gauss2d::VectorImage< T >::set_value_unchecked_impl ( size_t row,
size_t col,
T value )
inline

Definition at line 82 of file vectorimage.h.

82{ this->_data[row][col] = value; }

◆ shape()

std::array< size_t, 2 > lsst::gauss2d::Image< T, VectorImage< T > >::shape ( ) const
inlineinherited

Definition at line 186 of file image.h.

◆ size()

size_t lsst::gauss2d::Image< T, VectorImage< T > >::size ( ) const
inlineinherited

Definition at line 188 of file image.h.

◆ str()

std::string lsst::gauss2d::Image< T, VectorImage< T > >::str ( ) const
inlineoverridevirtualinherited

Return a brief, human-readable string representation of this.

Implements lsst::gauss2d::Object.

Definition at line 197 of file image.h.

Member Data Documentation

◆ _value_default

constexpr T lsst::gauss2d::Image< T, VectorImage< T > >::_value_default
staticconstexprinherited

Definition at line 120 of file image.h.

◆ CC_NAMESPACE_SEPARATOR

constexpr std::string_view lsst::gauss2d::Object::CC_NAMESPACE_SEPARATOR = "::"
staticconstexprinherited

The C++ namespace separator.

Definition at line 45 of file object.h.

◆ NULL_STR_GENERAL

constexpr std::string_view lsst::gauss2d::Object::NULL_STR_GENERAL = "None"
staticconstexprinherited

Definition at line 46 of file object.h.

◆ PY_NAMESPACE_SEPARATOR

constexpr std::string_view lsst::gauss2d::Object::PY_NAMESPACE_SEPARATOR = "."
staticconstexprinherited

Definition at line 47 of file object.h.


The documentation for this class was generated from the following file: