24 #ifndef PPL_DB_Matrix_inlines_hh
25 #define PPL_DB_Matrix_inlines_hh 1
30 #include "assertions.hh"
47 return std::vector<DB_Row<T> >().max_size();
106 template <
typename T>
112 template <
typename T>
118 template <
typename T>
124 template <
typename T>
130 template <
typename T>
136 template <
typename T>
144 template <
typename T>
149 template <
typename T>
152 PPL_ASSERT(k < rows.size());
156 template <
typename T>
159 PPL_ASSERT(k < rows.size());
163 template <
typename T>
169 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
171 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
172 template <
typename T>
178 template <
typename T>
182 row_size(y.row_size),
186 template <
typename T>
204 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
206 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
207 template <
typename Specialization,
typename Temp,
typename To,
typename T>
225 const T& x_i_j = x_i[j];
226 const T& y_i_j = y_i[j];
250 sub_assign_r(tmp1, *tmp1p, *tmp2p, dir);
251 PPL_ASSERT(
sgn(tmp1) >= 0);
260 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
262 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
263 template <
typename Temp,
typename To,
typename T>
273 l_m_distance_assign<Rectilinear_Distance_Specialization<Temp> >(r, x, y,
281 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
283 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
284 template <
typename Temp,
typename To,
typename T>
294 l_m_distance_assign<Euclidean_Distance_Specialization<Temp> >(r, x, y,
301 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
303 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
304 template <
typename Temp,
typename To,
typename T>
314 l_m_distance_assign<L_Infinity_Distance_Specialization<Temp> >(r, x, y,
321 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
323 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
324 template <
typename T>
332 #endif // !defined(PPL_DB_Matrix_inlines_hh)
bool operator!=(const const_iterator &y) const
Returns true if and only if *this and y are different.
Enable_If< Is_Native_Or_Checked< To >::value &&Is_Special< From >::value, Result >::type assign_r(To &to, const From &, Rounding_Dir dir)
A read-only iterator over the rows of the matrix.
void swap(CO_Tree &x, CO_Tree &y)
size_t dimension_type
An unsigned integral type for representing space dimensions.
Iter i
The const iterator on the rows' vector rows.
std::vector< DB_Row< T > >::const_iterator Iter
Rounding_Dir
Rounding directions for arithmetic computations.
const_iterator()
Default constructor.
const_iterator end() const
Returns the past-the-end const_iterator.
std::vector< DB_Row< T > > rows
The rows of the matrix.
reference operator*() const
Dereference operator.
const_iterator & operator=(const const_iterator &y)
Assignment operator.
DB_Matrix()
Builds an empty matrix.
DB_Matrix & operator=(const DB_Matrix &y)
Assignment operator.
const_iterator begin() const
Returns the const_iterator pointing to the first row, if *this is not empty; otherwise, returns the past-the-end const_iterator.
Rounding_Dir inverse(Rounding_Dir dir)
dimension_type compute_capacity(dimension_type requested_size, dimension_type maximum_size)
Speculative allocation function.
The base class for the single rows of matrices.
A wrapper for numeric types implementing a given policy.
static dimension_type max_num_rows()
Returns the maximum number of rows a DB_Matrix can handle.
void finalize()
Finalizes the library.
dimension_type row_size
Size of the initialized part of each row.
std::iterator_traits< Iter >::pointer pointer
DB_Row< T > & operator[](dimension_type k)
Returns a reference to the k-th row of the matrix.
const_iterator & operator++()
Prefix increment operator.
Enable_If< Is_Native< T >::value, memory_size_type >::type external_memory_in_bytes(const T &)
For native types, returns the size in bytes of the memory managed by the type of the (unused) paramet...
bool euclidean_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const DB_Matrix< T > &x, const DB_Matrix< T > &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
bool operator==(const const_iterator &y) const
Returns true if and only if *this and y are identical.
Enable_If< Is_Native_Or_Checked< T >::value, bool >::type is_plus_infinity(const T &x)
bool operator==(const DB_Matrix< T > &x, const DB_Matrix< T > &y)
Returns true if and only if x and y are identical.
dimension_type num_rows() const
Returns the number of rows in the matrix.
dimension_type row_capacity
Capacity allocated for each row, i.e., number of long objects that each row can contain.
void m_swap(DB_Matrix &y)
Swaps *this with y.
bool l_infinity_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const DB_Matrix< T > &x, const DB_Matrix< T > &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
Plus_Infinity PLUS_INFINITY
The entire library is confined to this namespace.
bool l_m_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const DB_Matrix< T > &x, const DB_Matrix< T > &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
I_Result combine(Result l, Result u)
bool rectilinear_distance_assign(Checked_Number< To, Extended_Number_Policy > &r, const DB_Matrix< T > &x, const DB_Matrix< T > &y, const Rounding_Dir dir, Temp &tmp0, Temp &tmp1, Temp &tmp2)
static dimension_type max_num_columns()
Returns the maximum number of columns a DB_Matrix can handle.
pointer operator->() const
Indirect member selector.
memory_size_type total_memory_in_bytes() const
Returns the total size in bytes of the memory occupied by *this.
int sgn(Boundary_Type type, const T &x, const Info &info)
bool operator!=(const DB_Matrix< T > &x, const DB_Matrix< T > &y)
static dimension_type max_size()
Returns the size() of the largest possible DB_Row.
size_t memory_size_type
An unsigned integral type for representing memory size in bytes.
void swap(DB_Matrix< T > &x, DB_Matrix< T > &y)
The base class for the square matrices.
std::iterator_traits< Iter >::reference reference
Result maybe_assign(const To *&top, To &tmp, const From &from, Rounding_Dir dir)
Assigns to top a pointer to a location that holds the conversion, according to dir, of from to type To. When necessary, and only when necessary, the variable tmp is used to hold the result of conversion.