LSST Applications g063fba187b+cac8b7c890,g0f08755f38+6aee506743,g1653933729+a8ce1bb630,g168dd56ebc+a8ce1bb630,g1a2382251a+b4475c5878,g1dcb35cd9c+8f9bc1652e,g20f6ffc8e0+6aee506743,g217e2c1bcf+73dee94bd0,g28da252d5a+1f19c529b9,g2bbee38e9b+3f2625acfc,g2bc492864f+3f2625acfc,g3156d2b45e+6e55a43351,g32e5bea42b+1bb94961c2,g347aa1857d+3f2625acfc,g35bb328faa+a8ce1bb630,g3a166c0a6a+3f2625acfc,g3e281a1b8c+c5dd892a6c,g3e8969e208+a8ce1bb630,g414038480c+5927e1bc1e,g41af890bb2+8a9e676b2a,g7af13505b9+809c143d88,g80478fca09+6ef8b1810f,g82479be7b0+f568feb641,g858d7b2824+6aee506743,g89c8672015+f4add4ffd5,g9125e01d80+a8ce1bb630,ga5288a1d22+2903d499ea,gb58c049af0+d64f4d3760,gc28159a63d+3f2625acfc,gcab2d0539d+b12535109e,gcf0d15dbbd+46a3f46ba9,gda6a2b7d83+46a3f46ba9,gdaeeff99f8+1711a396fd,ge79ae78c31+3f2625acfc,gef2f8181fd+0a71e47438,gf0baf85859+c1f95f4921,gfa517265be+6aee506743,gfa999e8aa5+17cd334064,w.2024.51
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: