IMS2  Pre-Alpha
An Orbiter add-on to allow on-runtime construction of spacecraft from predefined modules
IMS_Algs Namespace Reference

Functions

template<class T >
vector< T > Vector_Difference (vector< T > v1, vector< T > v2)
 Creates a vector containing the difference between two other vectors. More...
 
template<typename M , typename V >
void MapToVec (const M &_map, V &_vector)
 Appends all values in a map to a vector, ignoring keys. More...
 

Detailed Description

This namespace is meant to contain any specialised algorithms that might be needed. implement simple wrapper-tasks for STL-algorithms as functions, create classes for more complex stuff

Function Documentation

template<typename M , typename V >
void IMS_Algs::MapToVec ( const M &  _map,
V &  _vector 
)

Appends all values in a map to a vector, ignoring keys.

Parameters
_mapThe map from which to copy the values
_vectorThe vector to which the values should be appended
template<class T >
vector<T> IMS_Algs::Vector_Difference ( vector< T >  v1,
vector< T >  v2 
)

Creates a vector containing the difference between two other vectors.

Parameters
v1reference vector
v2the vector to be subtracted from v1
Returns
a vector containing all elements that are in v1 AND NOT in v2
Note
Inputs are passed by value rather than by reference as to not affect orignial data while sorting