Initializing help system before first use

SizedArray

Similar to class Array but this class also knows the length of the array. More...

Inheritance diagram for xpress::SizedArray< T >:
xpress::Array< T >

Public Types

typedef std::size_t  size_type
  Length type.
 
 Public Types inherited from xpress::Array< T >
typedef T  value_type
  The type of data in this array.
 

Public Member Functions

  SizedArray ()
  Create a null array.
 
  SizedArray (SizedArray< typename std::remove_const< T >::type > const &s)
  Copy constructor.
 
template<size_type N>
  SizedArray (std::array< T, N > &d)
  Create a new array descriptor from a std::array.
 
template<size_type N>
  SizedArray (std::array< typename std::remove_const< T >::type, N > const &d)
  Create a new array descriptor from a std::array.
 
  SizedArray (std::nullptr_t)
  Create an array from a null pointer.
 
  SizedArray (std::vector< T > &d)
  Create a new array descriptor from a std::vector.
 
  SizedArray (std::vector< typename std::remove_const< T >::type > const &d)
  Create a new array descriptor from a std::vector.
 
  SizedArray (T *d, size_type l)
  Create a new array descriptor from a C-style array and a length.
 
auto  begin () const -> typename Array< T >::value_type *
  Get an iterator to the first element in the wrapped array.
 
auto  end () const -> typename Array< T >::value_type *
  Get an iterator to one past the last element in the wrapped array.
 
auto  size () const -> size_type
  Get the size of the wrapped array.
 
auto  toVector () const -> std::vector< typename std::remove_const< T >::type >
  Convert this array to a vector.
 
 Public Member Functions inherited from xpress::Array< T >
  Array ()
  Create a null array.
 
  Array (Array< typename std::remove_const< T >::type > const &a)
  Copy constructor.
 
template<std::size_t N>
  Array (std::array< T, N > &d)
  Create a new array descriptor from a std::array.
 
template<std::size_t N>
  Array (std::array< typename std::remove_const< T >::type, N > const &d)
  Create a new array descriptor from a std::array.
 
  Array (std::nullptr_t)
  Create an array from a null pointer.
 
  Array (std::vector< T > &d)
  Create a new array descriptor from a std::vector.
 
  Array (std::vector< typename std::remove_const< T >::type > const &d)
  Create a new array descriptor from a std::vector.
 
  Array (T *d)
  Create a new array descriptor from a C style array.
 
  operator bool () const
  Conversion to boolean.
 
  operator value_type * () const
  Dereference operator.
 
bool  operator!= (std::nullptr_t) const
  Nullity check.
 
bool  operator== (std::nullptr_t) const
  Nullity check.
 
template<typename I >
value_type operator[] (I i) const
  Index into wrapped data.
 

Public Attributes

size_type  length
  Number of elements in the wrapped array.
 
 Public Attributes inherited from xpress::Array< T >
value_type data
  The underlying C style array.
 

Detailed Description

template<typename T>
class xpress::SizedArray< T >

Similar to class Array but this class also knows the length of the array.

Note that for std::array and std::vector the constructor extracts a pointer to the underlying raw data storage. So this storage must stay alive for the lifetime of the Array instance, otherwise undefined behavior will occur.

You should not have to deal with this class explicitly. It only exists to simplify argument passing to Xpress functions. It provides flexibility without creating a large amount of overloads.

Since
44.00

Member Typedef Documentation

size_type

template<typename T >
std::size_t xpress::SizedArray< T >::size_type

Length type.

Since
44.00

Constructor & Destructor Documentation

SizedArray() [1/8]

template<typename T >
xpress::SizedArray< T >::SizedArray ( std::vector< T > & d )
inline

Create a new array descriptor from a std::vector.

Parameters
d The vector.
Since
44.00

SizedArray() [2/8]

template<typename T >
xpress::SizedArray< T >::SizedArray ( std::vector< typename std::remove_const< T >::type > const & d )
inline

Create a new array descriptor from a std::vector.

Parameters
d The vector.
Since
44.00

SizedArray() [3/8]

template<typename T >
template< size_type N>
xpress::SizedArray< T >::SizedArray ( std::array< T, N > & d )
inline

Create a new array descriptor from a std::array.

Parameters
d The array.
Since
44.00

SizedArray() [4/8]

template<typename T >
template< size_type N>
xpress::SizedArray< T >::SizedArray ( std::array< typename std::remove_const< T >::type, N > const & d )
inline

Create a new array descriptor from a std::array.

Parameters
d The array.
Since
44.00

SizedArray() [5/8]

template<typename T >
xpress::SizedArray< T >::SizedArray ( SizedArray< typename std::remove_const< T >::type > const & s )
inline

Copy constructor.

Parameters
s The array to copy.
Since
44.00

SizedArray() [6/8]

template<typename T >
xpress::SizedArray< T >::SizedArray ( T * d,
size_type l )
inline

Create a new array descriptor from a C-style array and a length.

Parameters
d The array.
l Length of the array.
Since
44.00

SizedArray() [7/8]

template<typename T >
xpress::SizedArray< T >::SizedArray ( std::nullptr_t )
inline

Create an array from a null pointer.

Since
44.00

SizedArray() [8/8]

template<typename T >
xpress::SizedArray< T >::SizedArray ( )
inline

Create a null array.

Since
44.00

Member Function Documentation

begin()

template<typename T >
auto xpress::SizedArray< T >::begin ( ) const -> typename Array<T>::value_type *
inline

Get an iterator to the first element in the wrapped array.

Returns
An iterator to the first element in the wrapped array.
Since
44.00

end()

template<typename T >
auto xpress::SizedArray< T >::end ( ) const -> typename Array<T>::value_type *
inline

Get an iterator to one past the last element in the wrapped array.

Returns
An iterator to one past the last element in the wrapped array.
Since
44.00

size()

template<typename T >
auto xpress::SizedArray< T >::size ( ) const -> size_type
inline

Get the size of the wrapped array.

Returns
The size of the wrapped array.
Since
44.00

toVector()

template<typename T >
auto xpress::SizedArray< T >::toVector ( ) const -> std::vector<typename std::remove_const<T>::type>
inline

Convert this array to a vector.

Iterates over all elements in this array, stores them in a vector (in iteration order) and returns that array.

Returns
The vector with the elements from this array.
Since
44.00

Member Data Documentation

length

template<typename T >
size_type xpress::SizedArray< T >::length

Number of elements in the wrapped array.

Since
44.00

The documentation for this class was generated from the following file:
  • xpress.hpp

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.