sablib
Loading...
Searching...
No Matches
expand.h File Reference

Expands and Trim the boundaries of the data. More...

#include <stdexcept>
#include <Eigen/Eigen>

Go to the source code of this file.

Functions

template<typename Derived>
const Derived::PlainObject sablib::ExpandBoundaries (const Eigen::MatrixBase< Derived > &y, const unsigned int n)
 Expands the boundaries of a vector by padding with the first and last elements.
template<typename Derived>
const Derived::PlainObject sablib::TrimBoundaries (const Eigen::MatrixBase< Derived > &y, const unsigned int n)
 Trims the specified number of elements from both ends of a vector.

Detailed Description

Expands and Trim the boundaries of the data.

Author
Izadori

Definition in file expand.h.

Function Documentation

◆ ExpandBoundaries()

template<typename Derived>
const Derived::PlainObject sablib::ExpandBoundaries ( const Eigen::MatrixBase< Derived > & y,
const unsigned int n )

Expands the boundaries of a vector by padding with the first and last elements.

Parameters
yThe input vector to be expanded.
nThe number of elements to pad at each end.
Returns
The expanded vector with padded boundaries.

Definition at line 23 of file expand.h.

◆ TrimBoundaries()

template<typename Derived>
const Derived::PlainObject sablib::TrimBoundaries ( const Eigen::MatrixBase< Derived > & y,
const unsigned int n )

Trims the specified number of elements from both ends of a vector.

Parameters
yThe input vector to be trimmed.
nThe number of elements to remove from each end.
Returns
The trimmed vector.
Exceptions
std::invalid_argumentThrown if n is larger than half the length of y.

Definition at line 54 of file expand.h.