Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::DataObjects::VectorColumn< Type > Class Template Reference

VectorColumn : table column type capable of storing vectors of primitive types. More...

#include <VectorColumn.h>

Inheritance diagram for Mantid::DataObjects::VectorColumn< Type >:
Mantid::API::Column

Public Member Functions

VectorColumnclone () const override
 Create another copy of the column.
 
const std::vector< std::vector< Type > > & data () const
 Reference to the data.
 
bool equals (const Column &otherColumn, double tolerance, bool const nanEqual=false) const override
 
bool equalsRelErr (const Column &otherColumn, double tolerance, bool const nanEqual=false) const override
 
void fromDouble (size_t i, double value) override
 Assign from double.
 
const std::type_info & get_pointer_type_info () const override
 Returns typeid for the pointer type to the data element in the column.
 
const std::type_info & get_type_info () const override
 Returns typeid for the data in the column.
 
bool isBool () const override
 Specialized type check.
 
bool isNumber () const override
 Are elements of the column interpretable as a number?
 
void print (size_t index, std::ostream &s) const override
 Print specified item to the stream.
 
void read (const size_t index, std::istringstream &in) override
 Set item from a stream.
 
void read (size_t index, const std::string &text) override
 Set item from a string value.
 
size_t size () const override
 Number of individual elements in the column.
 
long int sizeOfData () const override
 Overall memory size taken by the column (bytes)
 
double toDouble (size_t i) const override
 Cast to double.
 
 VectorColumn ()
 
- Public Member Functions inherited from Mantid::API::Column
template<class T >
T & cell (size_t index)
 Templated method for returning a value. No type checks are done.
 
template<class T >
const T & cell (size_t index) const
 Templated method for returning a value (const version).
 
 Column ()
 
int getLinkedYCol () const
 
int getPlotType () const
 get plot type
 
virtual bool getReadOnly () const
 Returns column read-only flag.
 
template<class T >
bool isType () const
 Type check.
 
template<>
bool isType () const
 
const std::string & name () const
 Name (caption) of the column.
 
template<class T = double>
std::vector< T > numeric_fill (size_t maxSize=std::numeric_limits< size_t >::max()) const
 Fills a std vector with values from the column if the types are compatible.
 
virtual double operator[] (size_t i) const
 return value casted to double (should be pure virtual)
 
void setLinkedYCol (const int yCol)
 
void setName (const std::string &str)
 Renames the column.
 
void setPlotType (int t)
 Set plot type where.
 
void setReadOnly (bool isReadOnly)
 Sets column read-only flag.
 
virtual void sortIndex (bool ascending, size_t start, size_t end, std::vector< size_t > &indexVec, std::vector< std::pair< size_t, size_t > > &equalRanges) const
 Sort all or part of a vector of indices according to values in corresponding cells of this column.
 
virtual void sortValues (const std::vector< size_t > &indexVec)
 Re-arrange values in this column according to indices in indexVec.
 
const std::string & type () const
 Type of the column data.
 
virtual ~Column ()=default
 Virtual destructor.
 

Protected Member Functions

void insert (size_t index) override
 Inserts an item.
 
void remove (size_t index) override
 Removes an item.
 
void resize (size_t count) override
 Sets the new column size.
 
const void * void_pointer (size_t index) const override
 Pointer to a data element.
 
void * void_pointer (size_t index) override
 Pointer to a data element.
 
- Protected Member Functions inherited from Mantid::API::Column
bool possibleToCompare (const Column &otherColumn) const
 

Private Member Functions

std::string typeName ()
 Returns the name of the column with the given type.
 

Private Attributes

std::vector< std::vector< Type > > m_data
 All the vectors stored.
 

Additional Inherited Members

- Protected Attributes inherited from Mantid::API::Column
bool m_isReadOnly
 Column read-only flag.
 
int m_linkedYCol = -1
 For error columns - the index of the related data column.
 
std::string m_name
 name
 
int m_plotType
 plot type where None = 0 (means it has specifically been set to 'no plot type') NotSet = -1000 (this is the default and means plot style has not been set) X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6
 
std::string m_type
 type
 

Detailed Description

template<class Type>
class Mantid::DataObjects::VectorColumn< Type >

VectorColumn : table column type capable of storing vectors of primitive types.

Plese add more specializations to VectorColumn.cpp as you need them. I don't guarantee it will work correctly with complex or user types, but it might.

Definition at line 31 of file VectorColumn.h.

Constructor & Destructor Documentation

◆ VectorColumn()

template<class Type >
Mantid::DataObjects::VectorColumn< Type >::VectorColumn ( )
inline

Definition at line 33 of file VectorColumn.h.

Member Function Documentation

◆ clone()

template<class Type >
VectorColumn * Mantid::DataObjects::VectorColumn< Type >::clone ( ) const
inlineoverridevirtual

Create another copy of the column.

Implements Mantid::API::Column.

Definition at line 97 of file VectorColumn.h.

References m_data.

◆ data()

template<class Type >
const std::vector< std::vector< Type > > & Mantid::DataObjects::VectorColumn< Type >::data ( ) const
inline

Reference to the data.

Definition at line 119 of file VectorColumn.h.

References m_data.

Referenced by Mantid::DataObjects::VectorColumn< Type >::equals(), and Mantid::DataObjects::VectorColumn< Type >::equalsRelErr().

◆ equals()

template<class Type >
bool Mantid::DataObjects::VectorColumn< Type >::equals ( const Column otherColumn,
double  tolerance,
bool const  nanEqual = false 
) const
inlineoverridevirtual

◆ equalsRelErr()

template<class Type >
bool Mantid::DataObjects::VectorColumn< Type >::equalsRelErr ( const Column otherColumn,
double  tolerance,
bool const  nanEqual = false 
) const
inlineoverridevirtual

◆ fromDouble()

template<class Type >
void Mantid::DataObjects::VectorColumn< Type >::fromDouble ( size_t  i,
double  value 
)
inlineoverridevirtual

Assign from double.

Implements Mantid::API::Column.

Definition at line 112 of file VectorColumn.h.

References UNUSED_ARG, and value.

◆ get_pointer_type_info()

template<class Type >
const std::type_info & Mantid::DataObjects::VectorColumn< Type >::get_pointer_type_info ( ) const
inlineoverridevirtual

Returns typeid for the pointer type to the data element in the column.

Implements Mantid::API::Column.

Definition at line 42 of file VectorColumn.h.

◆ get_type_info()

template<class Type >
const std::type_info & Mantid::DataObjects::VectorColumn< Type >::get_type_info ( ) const
inlineoverridevirtual

Returns typeid for the data in the column.

Implements Mantid::API::Column.

Definition at line 39 of file VectorColumn.h.

◆ insert()

template<class Type >
void Mantid::DataObjects::VectorColumn< Type >::insert ( size_t  index)
inlineoverrideprotectedvirtual

Inserts an item.

Implements Mantid::API::Column.

Definition at line 172 of file VectorColumn.h.

References index, and m_data.

◆ isBool()

template<class Type >
bool Mantid::DataObjects::VectorColumn< Type >::isBool ( ) const
inlineoverridevirtual

Specialized type check.

Implements Mantid::API::Column.

Definition at line 85 of file VectorColumn.h.

◆ isNumber()

template<class Type >
bool Mantid::DataObjects::VectorColumn< Type >::isNumber ( ) const
inlineoverridevirtual

Are elements of the column interpretable as a number?

Implements Mantid::API::Column.

Definition at line 87 of file VectorColumn.h.

◆ print()

template<class Type >
void Mantid::DataObjects::VectorColumn< Type >::print ( size_t  index,
std::ostream &  s 
) const
inlineoverridevirtual

Print specified item to the stream.

Implements Mantid::API::Column.

Definition at line 45 of file VectorColumn.h.

References index, and m_data.

◆ read() [1/2]

template<class Type >
void Mantid::DataObjects::VectorColumn< Type >::read ( const size_t  index,
std::istringstream &  in 
)
inlineoverridevirtual

Set item from a stream.

Reimplemented from Mantid::API::Column.

Definition at line 78 of file VectorColumn.h.

References index.

◆ read() [2/2]

template<class Type >
void Mantid::DataObjects::VectorColumn< Type >::read ( size_t  index,
const std::string &  text 
)
inlineoverridevirtual

Set item from a string value.

Reimplemented from Mantid::API::Column.

Definition at line 62 of file VectorColumn.h.

References index, m_data, and Mantid::Kernel::StringTokenizer::TOK_TRIM.

◆ remove()

template<class Type >
void Mantid::DataObjects::VectorColumn< Type >::remove ( size_t  index)
inlineoverrideprotectedvirtual

Removes an item.

Implements Mantid::API::Column.

Definition at line 178 of file VectorColumn.h.

References index, and m_data.

◆ resize()

template<class Type >
void Mantid::DataObjects::VectorColumn< Type >::resize ( size_t  count)
inlineoverrideprotectedvirtual

Sets the new column size.

Implements Mantid::API::Column.

Definition at line 169 of file VectorColumn.h.

References count, and m_data.

◆ size()

template<class Type >
size_t Mantid::DataObjects::VectorColumn< Type >::size ( ) const
inlineoverridevirtual

Number of individual elements in the column.

Implements Mantid::API::Column.

Definition at line 36 of file VectorColumn.h.

References m_data.

Referenced by Mantid::DataObjects::VectorColumn< Type >::equals(), and Mantid::DataObjects::VectorColumn< Type >::equalsRelErr().

◆ sizeOfData()

template<class Type >
long int Mantid::DataObjects::VectorColumn< Type >::sizeOfData ( ) const
inlineoverridevirtual

Overall memory size taken by the column (bytes)

Implements Mantid::API::Column.

Definition at line 90 of file VectorColumn.h.

References m_data.

◆ toDouble()

template<class Type >
double Mantid::DataObjects::VectorColumn< Type >::toDouble ( size_t  i) const
inlineoverridevirtual

Cast to double.

Implements Mantid::API::Column.

Definition at line 106 of file VectorColumn.h.

References UNUSED_ARG.

◆ typeName()

template<class Type >
std::string Mantid::DataObjects::VectorColumn< Type >::typeName ( )
private

Returns the name of the column with the given type.

Is specialized using DECLARE_VECTORCOLUMN

◆ void_pointer() [1/2]

template<class Type >
const void * Mantid::DataObjects::VectorColumn< Type >::void_pointer ( size_t  index) const
inlineoverrideprotectedvirtual

Pointer to a data element.

Implements Mantid::API::Column.

Definition at line 184 of file VectorColumn.h.

References index, and m_data.

◆ void_pointer() [2/2]

template<class Type >
void * Mantid::DataObjects::VectorColumn< Type >::void_pointer ( size_t  index)
inlineoverrideprotectedvirtual

Pointer to a data element.

Implements Mantid::API::Column.

Definition at line 181 of file VectorColumn.h.

References index, and m_data.

Member Data Documentation

◆ m_data

template<class Type >
std::vector<std::vector<Type> > Mantid::DataObjects::VectorColumn< Type >::m_data
private

All the vectors stored.

Definition at line 188 of file VectorColumn.h.


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