bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitsim::trajectory::GeomPoint< spacedim, T > Class Template Reference

A class that describes a point with spacedim spatial dimension space. More...

#include <geom_point.h>

Inheritance diagram for bitsim::trajectory::GeomPoint< spacedim, T >:

Public Types

using value_type = T
 value_type. The type of the coordinates

Public Member Functions

 GeomPoint (T val=T())
 ctor all dim data are assigned the given value
template<typename Container>
 GeomPoint (const Container &data)
 Create by passing a vector of data.
 GeomPoint (const std::initializer_list< T > &list)
 Construct given an initializer_list.
 GeomPoint (const GeomPoint &t)
 copy ctor
GeomPoint & operator= (const GeomPoint &t)
 copy assignement operator
GeomPoint & operator= (const std::initializer_list< T > &list)
 operator = Assign from the initializer list
virtual ~GeomPoint ()
 dtor
GeomPoint & operator+= (const GeomPoint &)
 Add another vector, i.e. move this point by the given offset.
GeomPoint & operator-= (const GeomPoint &)
GeomPoint & operator*= (T factor)
 Scale the point by factor.
GeomPoint & operator/= (T factor)
 Scale the vector by factor.
void scale (T factor)
 scale with a given factor
void scale (const std::vector< T > &factors)
 scale this object by the given factors p factors should have size at least spacedim
void zero ()
 Zero the entries of the tensor.
void add_scaled (const GeomPoint &p, T factor)
 Add the coordinates of the given point to this scaled by factor.
T & operator[] (uint_t i)
 Access the i-th coordinate of the point.
T operator[] (uint_t i) const
 Access the i-th coordinate of the point read-only.
T entry (uint_t i) const
 access the i-th coordinate of the point read-only
auto coordinates () const
 Get a copy of the data of this object.
T max () const
 Get the max element in the point.
T min () const
 Get the min element in the point.
T distance (const GeomPoint &) const
 Get the distance from the given point.
T L2_norm () const
 Return the distance from the origin.
T dot (const GeomPoint &other) const
 Returns the dot product of this point and the given point.
T square_sum () const
 Returns the square sum of the compontents.
std::ostream & print_point_info (std::ostream &out) const
 print the point
const std::string to_string () const
 Returns string representation of the point.

Static Public Attributes

static const int dimension = spacedim
 dimension. Spatial dimension of the point

Detailed Description

template<int spacedim, typename T = real_t>
class bitsim::trajectory::GeomPoint< spacedim, T >

A class that describes a point with spacedim spatial dimension space.

Member Typedef Documentation

◆ value_type

template<int spacedim, typename T = real_t>
using bitsim::geometry::GeomPoint< spacedim, T >::value_type = T

value_type. The type of the coordinates

Constructor & Destructor Documentation

◆ GeomPoint() [1/4]

template<int spacedim, typename T>
bitsim::geometry::GeomPoint< spacedim, T >::GeomPoint ( T val = T())
inlineexplicit

ctor all dim data are assigned the given value

◆ GeomPoint() [2/4]

template<int spacedim, typename T>
template<typename Container>
bitsim::geometry::GeomPoint< spacedim, T >::GeomPoint ( const Container & data)
inlineexplicit

Create by passing a vector of data.

◆ GeomPoint() [3/4]

template<int spacedim, typename T>
bitsim::geometry::GeomPoint< spacedim, T >::GeomPoint ( const std::initializer_list< T > & list)

Construct given an initializer_list.

◆ GeomPoint() [4/4]

template<int spacedim, typename T>
bitsim::geometry::GeomPoint< spacedim, T >::GeomPoint ( const GeomPoint< spacedim, T > & t)
inline

copy ctor

◆ ~GeomPoint()

template<int spacedim, typename T = real_t>
virtual bitsim::geometry::GeomPoint< spacedim, T >::~GeomPoint ( )
inlinevirtual

dtor

Member Function Documentation

◆ add_scaled()

template<int spacedim, typename T>
void bitsim::geometry::GeomPoint< spacedim, T >::add_scaled ( const GeomPoint< spacedim, T > & p,
T factor )
inline

Add the coordinates of the given point to this scaled by factor.

◆ coordinates()

template<int spacedim, typename T = real_t>
auto bitsim::geometry::GeomPoint< spacedim, T >::coordinates ( ) const
inline

Get a copy of the data of this object.

◆ distance()

template<int spacedim, typename T>
T bitsim::geometry::GeomPoint< spacedim, T >::distance ( const GeomPoint< spacedim, T > & p) const

Get the distance from the given point.

◆ dot()

template<int spacedim, typename T>
T bitsim::geometry::GeomPoint< spacedim, T >::dot ( const GeomPoint< spacedim, T > & other) const

Returns the dot product of this point and the given point.

◆ entry()

template<int spacedim, typename T = real_t>
T bitsim::geometry::GeomPoint< spacedim, T >::entry ( uint_t i) const
inline

access the i-th coordinate of the point read-only

◆ L2_norm()

template<int spacedim, typename T = real_t>
T bitsim::geometry::GeomPoint< spacedim, T >::L2_norm ( ) const
inline

Return the distance from the origin.

◆ max()

template<int spacedim, typename T>
T bitsim::geometry::GeomPoint< spacedim, T >::max ( ) const

Get the max element in the point.

◆ min()

template<int spacedim, typename T>
T bitsim::geometry::GeomPoint< spacedim, T >::min ( ) const

Get the min element in the point.

◆ operator*=()

template<int spacedim, typename T>
GeomPoint< spacedim, T > & bitsim::geometry::GeomPoint< spacedim, T >::operator*= ( T factor)
inline

Scale the point by factor.

◆ operator+=()

template<int spacedim, typename T>
GeomPoint< spacedim, T > & bitsim::geometry::GeomPoint< spacedim, T >::operator+= ( const GeomPoint< spacedim, T > & t)
inline

Add another vector, i.e. move this point by the given offset.

◆ operator-=()

template<int spacedim, typename T>
GeomPoint< spacedim, T > & bitsim::geometry::GeomPoint< spacedim, T >::operator-= ( const GeomPoint< spacedim, T > & t)
inline

Subtract another tensor.

◆ operator/=()

template<int spacedim, typename T>
GeomPoint< spacedim, T > & bitsim::geometry::GeomPoint< spacedim, T >::operator/= ( T factor)
inline

Scale the vector by factor.

◆ operator=() [1/2]

template<int spacedim, typename T>
GeomPoint< spacedim, T > & bitsim::geometry::GeomPoint< spacedim, T >::operator= ( const GeomPoint< spacedim, T > & t)
inline

copy assignement operator

◆ operator=() [2/2]

template<int spacedim, typename T>
GeomPoint< spacedim, T > & bitsim::geometry::GeomPoint< spacedim, T >::operator= ( const std::initializer_list< T > & list)
inline

operator = Assign from the initializer list

◆ operator[]() [1/2]

template<int spacedim, typename T>
T & bitsim::geometry::GeomPoint< spacedim, T >::operator[] ( uint_t i)
inline

Access the i-th coordinate of the point.

◆ operator[]() [2/2]

template<int spacedim, typename T>
T bitsim::geometry::GeomPoint< spacedim, T >::operator[] ( uint_t i) const
inline

Access the i-th coordinate of the point read-only.

◆ print_point_info()

template<int spacedim, typename T>
std::ostream & bitsim::geometry::GeomPoint< spacedim, T >::print_point_info ( std::ostream & out) const
inline

print the point

◆ scale() [1/2]

template<int spacedim, typename T>
void bitsim::geometry::GeomPoint< spacedim, T >::scale ( const std::vector< T > & factors)

scale this object by the given factors p factors should have size at least spacedim

◆ scale() [2/2]

template<int spacedim, typename T = real_t>
void bitsim::geometry::GeomPoint< spacedim, T >::scale ( T factor)

scale with a given factor

◆ square_sum()

template<int spacedim, typename T>
T bitsim::geometry::GeomPoint< spacedim, T >::square_sum ( ) const

Returns the square sum of the compontents.

◆ to_string()

template<int spacedim, typename T>
const std::string bitsim::geometry::GeomPoint< spacedim, T >::to_string ( ) const

Returns string representation of the point.

◆ zero()

template<int spacedim, typename T>
void bitsim::geometry::GeomPoint< spacedim, T >::zero ( )
inline

Zero the entries of the tensor.

Member Data Documentation

◆ dimension

template<int spacedim, typename T = real_t>
const int bitsim::geometry::GeomPoint< spacedim, T >::dimension = spacedim
static

dimension. Spatial dimension of the point


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