Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Private Types | List of all members
protocols::mean_field::jagged_array< T, A > Class Template Reference

utility::vector1<utility::vector1>> vector of vectors to create the effect of a jagged array More...

#include <jagged_array.hh>

Inheritance diagram for protocols::mean_field::jagged_array< T, A >:
Inheritance graph
[legend]

Classes

struct  func_T2
 

Public Types

typedef super::value_type value_type
 
typedef super::reference reference
 
typedef super::const_reference const_reference
 
typedef super::pointer pointer
 
typedef super::const_pointer const_pointer
 
typedef super::iterator iterator
 
typedef super::const_iterator const_iterator
 
typedef super::reverse_iterator reverse_iterator
 
typedef
super::const_reverse_iterator 
const_reverse_iterator
 
typedef super::size_type size_type
 
typedef super::difference_type difference_type
 
typedef super::allocator_type allocator_type
 
typedef super::index_type index_type
 
typedef super::ssize_type ssize_type
 
typedef super::Value Value
 
typedef super::Reference Reference
 
typedef super::ConstReference ConstReference
 
typedef super::Pointer Pointer
 
typedef super::ConstPointer ConstPointer
 
typedef super::Iterator Iterator
 
typedef super::ConstIterator ConstIterator
 
typedef super::ReverseIterator ReverseIterator
 
typedef super::ConstReverseIterator ConstReverseIterator
 
typedef super::Size Size
 
typedef super::Difference Difference
 
typedef super::Allocator Allocator
 
typedef super::Index Index
 
typedef super::SSize SSize
 

Public Member Functions

 jagged_array (allocator_type const &alloc=allocator_type())
 Default constructor. More...
 
 jagged_array (jagged_array< T > const &v)
 Copy constructor. More...
 
 jagged_array (utility::vector1< utility::vector1< T, A > > const &v)
 Assignable copy constructor. More...
 
 jagged_array (size_type const num)
 Size constructor constructs an empty jagged_array of size num. More...
 
 jagged_array (size_type const num, utility::vector1< T > const &vals)
 Size and vals constructor constructs a jagged_array of size num filled with copies of vals. More...
 
 jagged_array (utility::vector1< size_type > const &dims)
 Uniform value constructor. More...
 
 jagged_array (utility::vector1< size_type > const &dims, utility::vector1< T > const &vals)
 Constructor that reserves size based on vector of size types, fills vectors with vals. More...
 
template<typename InputIterator >
 jagged_array (InputIterator const beg, InputIterator const ending, allocator_type const &alloc=allocator_type())
 Iterator range constructor. More...
 
 ~jagged_array () override
 Destructor. More...
 
jagged_arrayoperator= (jagged_array< T > const &v)
 Copy assignment. More...
 
template<ssize_type L_, typename T_ , typename A_ >
jagged_arrayoperator= (utility::vector1< utility::vector1< T, A > > const &v)
 Assignable copy assignment. More...
 
void assign (utility::vector1< size_type > const &dims)
 clears jagged_array and reserves size based on vector of size types More...
 
void assign (utility::vector1< size_type > const &dims, utility::vector1< T > const &vals)
 clears jagged_array and reserves size based on vector of size types, fills vectors with vals More...
 
int index (T const &t) const
 Find the index of an element. If not found then return 0;. More...
 
bool has_value (T const &t) const
 Checks if element is present and returns bool depending whether present. More...
 
void show (std::ostream &output=std::cout) const
 shows a string representation of the jagged_array More...
 
template<typename T_2 >
void apply_func_to_all (typename func_T2< T_2 >::two_param_func func, T_2 operand)
 applies param *func to all values in the jagged_array (1-param func) More...
 
template<typename T_2 >
void apply_func_to_each_col (typename func_T2< T_2 >::two_param_func func, utility::vector1< T_2 > operands)
 applies param *func to all values in the jagged_array (2-param func) using column_dependent operand More...
 
template<typename T_2 >
void apply_func_to_each_elem (typename func_T2< T_2 >::two_param_func func, jagged_array< T_2 > operands)
 applies param *func to all values in the jagged_array (2-param func) using 2D-index dependent operand (i.e. matrix arithmetic) More...
 
template<typename T_2 >
void apply_func_to_each_elem (typename func_T2< T_2 >::three_param_func func, jagged_array< T > operands, T_2 third_oper)
 applies param *func to all values in the jagged_array (3-param func) using 2D-index dependent operand and a third, general operand More...
 
utility::vector1< T > get_totals_columns () const
 returns vector1 of totals of columns of jagged_array More...
 
get_total () const
 returns total of all elements in jagged array More...
 
Size size_col (Size col) const
 returns size of specified column More...
 
Size max_size_col () const
 returns the maximum size of any columns More...
 
bool equal_size (jagged_array< T > const &other) const
 checks if a second jagged_array is of equal size for all columns More...
 
template<typename T_2 >
bool equal_size (jagged_array< T_2 > const &other) const
 checks if a second jagged_array (of different type) is of equal size for all columns More...
 

Private Types

typedef utility::vector1
< utility::vector1< T, A > > 
super
 
typedef T(* one_param_func )(T const &)
 
typedef T(* two_param_func )(T const &, T const &)
 
typedef T(* three_param_func )(T const &, T const &, T const &)
 

Detailed Description

template<typename T, typename A = std::allocator< T >>
class protocols::mean_field::jagged_array< T, A >

utility::vector1<utility::vector1>> vector of vectors to create the effect of a jagged array

Member Typedef Documentation

template<typename T, typename A = std::allocator< T >>
typedef super::Allocator protocols::mean_field::jagged_array< T, A >::Allocator
template<typename T, typename A = std::allocator< T >>
typedef super::allocator_type protocols::mean_field::jagged_array< T, A >::allocator_type
template<typename T, typename A = std::allocator< T >>
typedef super::const_iterator protocols::mean_field::jagged_array< T, A >::const_iterator
template<typename T, typename A = std::allocator< T >>
typedef super::const_pointer protocols::mean_field::jagged_array< T, A >::const_pointer
template<typename T, typename A = std::allocator< T >>
typedef super::const_reference protocols::mean_field::jagged_array< T, A >::const_reference
template<typename T, typename A = std::allocator< T >>
typedef super::const_reverse_iterator protocols::mean_field::jagged_array< T, A >::const_reverse_iterator
template<typename T, typename A = std::allocator< T >>
typedef super::ConstIterator protocols::mean_field::jagged_array< T, A >::ConstIterator
template<typename T, typename A = std::allocator< T >>
typedef super::ConstPointer protocols::mean_field::jagged_array< T, A >::ConstPointer
template<typename T, typename A = std::allocator< T >>
typedef super::ConstReference protocols::mean_field::jagged_array< T, A >::ConstReference
template<typename T, typename A = std::allocator< T >>
typedef super::ConstReverseIterator protocols::mean_field::jagged_array< T, A >::ConstReverseIterator
template<typename T, typename A = std::allocator< T >>
typedef super::Difference protocols::mean_field::jagged_array< T, A >::Difference
template<typename T, typename A = std::allocator< T >>
typedef super::difference_type protocols::mean_field::jagged_array< T, A >::difference_type
template<typename T, typename A = std::allocator< T >>
typedef super::Index protocols::mean_field::jagged_array< T, A >::Index
template<typename T, typename A = std::allocator< T >>
typedef super::index_type protocols::mean_field::jagged_array< T, A >::index_type
template<typename T, typename A = std::allocator< T >>
typedef super::iterator protocols::mean_field::jagged_array< T, A >::iterator
template<typename T, typename A = std::allocator< T >>
typedef super::Iterator protocols::mean_field::jagged_array< T, A >::Iterator
template<typename T, typename A = std::allocator< T >>
typedef T( * protocols::mean_field::jagged_array< T, A >::one_param_func)(T const &)
private
template<typename T, typename A = std::allocator< T >>
typedef super::pointer protocols::mean_field::jagged_array< T, A >::pointer
template<typename T, typename A = std::allocator< T >>
typedef super::Pointer protocols::mean_field::jagged_array< T, A >::Pointer
template<typename T, typename A = std::allocator< T >>
typedef super::reference protocols::mean_field::jagged_array< T, A >::reference
template<typename T, typename A = std::allocator< T >>
typedef super::Reference protocols::mean_field::jagged_array< T, A >::Reference
template<typename T, typename A = std::allocator< T >>
typedef super::reverse_iterator protocols::mean_field::jagged_array< T, A >::reverse_iterator
template<typename T, typename A = std::allocator< T >>
typedef super::ReverseIterator protocols::mean_field::jagged_array< T, A >::ReverseIterator
template<typename T, typename A = std::allocator< T >>
typedef super::Size protocols::mean_field::jagged_array< T, A >::Size
template<typename T, typename A = std::allocator< T >>
typedef super::size_type protocols::mean_field::jagged_array< T, A >::size_type
template<typename T, typename A = std::allocator< T >>
typedef super::SSize protocols::mean_field::jagged_array< T, A >::SSize
template<typename T, typename A = std::allocator< T >>
typedef super::ssize_type protocols::mean_field::jagged_array< T, A >::ssize_type
template<typename T, typename A = std::allocator< T >>
typedef utility::vector1< utility::vector1 < T, A > > protocols::mean_field::jagged_array< T, A >::super
private
template<typename T, typename A = std::allocator< T >>
typedef T( * protocols::mean_field::jagged_array< T, A >::three_param_func)(T const &, T const &, T const &)
private
template<typename T, typename A = std::allocator< T >>
typedef T( * protocols::mean_field::jagged_array< T, A >::two_param_func)(T const &, T const &)
private
template<typename T, typename A = std::allocator< T >>
typedef super::Value protocols::mean_field::jagged_array< T, A >::Value
template<typename T, typename A = std::allocator< T >>
typedef super::value_type protocols::mean_field::jagged_array< T, A >::value_type

Constructor & Destructor Documentation

template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::jagged_array ( allocator_type const &  alloc = allocator_type())
inlineexplicit

Default constructor.

template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::jagged_array ( jagged_array< T > const &  v)
inline

Copy constructor.

template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::jagged_array ( utility::vector1< utility::vector1< T, A > > const &  v)
inline

Assignable copy constructor.

template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::jagged_array ( size_type const  num)
inlineexplicit

Size constructor constructs an empty jagged_array of size num.

Parameters
[in]num- determines size of jagged_array
template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::jagged_array ( size_type const  num,
utility::vector1< T > const &  vals 
)
inlineexplicit

Size and vals constructor constructs a jagged_array of size num filled with copies of vals.

Parameters
[in]num- determines size of jagged_array
[in]vals- used as initial value of vector1's in jagged_array
template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::jagged_array ( utility::vector1< size_type > const &  dims)
inline

Uniform value constructor.

constructs a vector1 of size dim that holds vector1s that each contain dim2 copies of value

Parameters
[in]dim- first dimension of jagged_array (determines size of jagged_array itself)
[in]dim2- second dimension of jagged_array (determines size of each vector1 within jagged_array)
Remarks
currently not operational due to PyRosetta build issues with this constructor Constructor that reserves size based on vector of size types
Parameters
[in]dims- dimensions used to determine size of empty vectors within jagged_array
template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::jagged_array ( utility::vector1< size_type > const &  dims,
utility::vector1< T > const &  vals 
)
inline

Constructor that reserves size based on vector of size types, fills vectors with vals.

Constructs a vector of size dims.size(). Each vector within this vector has the size of the element

with its index within the vector dims and is filled with the element with its index within the vector vals

template<typename T, typename A = std::allocator< T >>
template<typename InputIterator >
protocols::mean_field::jagged_array< T, A >::jagged_array ( InputIterator const  beg,
InputIterator const  ending,
allocator_type const &  alloc = allocator_type() 
)
inline

Iterator range constructor.

template<typename T, typename A = std::allocator< T >>
protocols::mean_field::jagged_array< T, A >::~jagged_array ( )
inlineoverride

Destructor.

Member Function Documentation

template<typename T, typename A = std::allocator< T >>
template<typename T_2 >
void protocols::mean_field::jagged_array< T, A >::apply_func_to_all ( typename func_T2< T_2 >::two_param_func  func,
T_2  operand 
)
inline

applies param *func to all values in the jagged_array (1-param func)

applies param *func to all values in the jagged_array (2-param func)

Remarks
currently not operational due to cppcheck errors applies param *func to all values in the jagged_array (2-param func) using different template variable as other operand

Referenced by protocols::mean_field::operator*=(), protocols::mean_field::operator+=(), protocols::mean_field::operator-=(), and protocols::mean_field::operator/=().

template<typename T, typename A = std::allocator< T >>
template<typename T_2 >
void protocols::mean_field::jagged_array< T, A >::apply_func_to_each_col ( typename func_T2< T_2 >::two_param_func  func,
utility::vector1< T_2 >  operands 
)
inline

applies param *func to all values in the jagged_array (2-param func) using column_dependent operand

Remarks
currently not operational due to cppcheck errors applies param *func to all values in the jagged_array (2-param func) using different template variable as other, column_dependent operand

Referenced by protocols::mean_field::operator*=(), protocols::mean_field::operator+=(), protocols::mean_field::operator-=(), and protocols::mean_field::operator/=().

template<typename T, typename A = std::allocator< T >>
template<typename T_2 >
void protocols::mean_field::jagged_array< T, A >::apply_func_to_each_elem ( typename func_T2< T_2 >::two_param_func  func,
jagged_array< T_2 >  operands 
)
inline

applies param *func to all values in the jagged_array (2-param func) using 2D-index dependent operand (i.e. matrix arithmetic)

Remarks
currently not operational due to cppcheck errors applies param *func to all values in the jagged_array (2-param func) using different template variable as other, 2D-index dependent operand

Referenced by protocols::mean_field::operator*=(), protocols::mean_field::operator+=(), protocols::mean_field::operator-=(), and protocols::mean_field::operator/=().

template<typename T, typename A = std::allocator< T >>
template<typename T_2 >
void protocols::mean_field::jagged_array< T, A >::apply_func_to_each_elem ( typename func_T2< T_2 >::three_param_func  func,
jagged_array< T >  operands,
T_2  third_oper 
)
inline

applies param *func to all values in the jagged_array (3-param func) using 2D-index dependent operand and a third, general operand

Remarks
currently not operational due to cppcheck errors applies param *func to all values in the jagged_array (2-param func) using 2D-index dependent operand and a different template variable operand
template<typename T, typename A = std::allocator< T >>
void protocols::mean_field::jagged_array< T, A >::assign ( utility::vector1< size_type > const &  dims)
inline
template<typename T, typename A = std::allocator< T >>
void protocols::mean_field::jagged_array< T, A >::assign ( utility::vector1< size_type > const &  dims,
utility::vector1< T > const &  vals 
)
inline

clears jagged_array and reserves size based on vector of size types, fills vectors with vals

template<typename T, typename A = std::allocator< T >>
bool protocols::mean_field::jagged_array< T, A >::equal_size ( jagged_array< T > const &  other) const
inline

checks if a second jagged_array is of equal size for all columns

Parameters
[in]other- second jagged_array with which to compare
Remarks
useful for matrix arithmetic

Referenced by protocols::mean_field::jagged_array< AAProb >::apply_func_to_each_elem().

template<typename T, typename A = std::allocator< T >>
template<typename T_2 >
bool protocols::mean_field::jagged_array< T, A >::equal_size ( jagged_array< T_2 > const &  other) const
inline

checks if a second jagged_array (of different type) is of equal size for all columns

Parameters
[in]other- second jagged_array with which to compare
Remarks
useful for matrix arithmetic
template<typename T, typename A = std::allocator< T >>
T protocols::mean_field::jagged_array< T, A >::get_total ( ) const
inline

returns total of all elements in jagged array

class T must provide operator += and -=

Error if size is 0

Referenced by protocols::mean_field::AAMatrix::cosine_distance().

template<typename T, typename A = std::allocator< T >>
utility::vector1< T > protocols::mean_field::jagged_array< T, A >::get_totals_columns ( ) const
inline

returns vector1 of totals of columns of jagged_array

class T must provide operator +=

Error if size is 0

Remarks
very useful in mean-field algorithm

Referenced by protocols::mean_field::AAMatrix::cosine_distance().

template<typename T, typename A = std::allocator< T >>
bool protocols::mean_field::jagged_array< T, A >::has_value ( T const &  t) const
inline

Checks if element is present and returns bool depending whether present.

template<typename T, typename A = std::allocator< T >>
int protocols::mean_field::jagged_array< T, A >::index ( T const &  t) const
inline

Find the index of an element. If not found then return 0;.

Referenced by protocols::mean_field::jagged_array< AAProb >::index().

template<typename T, typename A = std::allocator< T >>
Size protocols::mean_field::jagged_array< T, A >::max_size_col ( ) const
inline
template<typename T, typename A = std::allocator< T >>
jagged_array& protocols::mean_field::jagged_array< T, A >::operator= ( jagged_array< T > const &  v)
inline

Copy assignment.

template<typename T, typename A = std::allocator< T >>
template<ssize_type L_, typename T_ , typename A_ >
jagged_array& protocols::mean_field::jagged_array< T, A >::operator= ( utility::vector1< utility::vector1< T, A > > const &  v)
inline

Assignable copy assignment.

template<typename T, typename A = std::allocator< T >>
void protocols::mean_field::jagged_array< T, A >::show ( std::ostream &  output = std::cout) const
inline

shows a string representation of the jagged_array

each column represents one of the utility::vector1's within the vector that comprises the jagged_array

therefore, the "jagged" edge of the array is the bottom edge of the matrix

Remarks
does nothing if jagged_array is empty

Referenced by protocols::mean_field::RotMatrix::show(), protocols::mean_field::MeanField::show(), and protocols::mean_field::AAMatrix::show().

template<typename T, typename A = std::allocator< T >>
Size protocols::mean_field::jagged_array< T, A >::size_col ( Size  col) const
inline

returns size of specified column

Parameters
[in]col- column for which to determine size

Error if col > size

Referenced by protocols::mean_field::jagged_array< AAProb >::max_size_col().


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