7#include <boost/lexical_cast.hpp>
11static_assert(
MaxDimension >= 4,
"ParameterVector does not support more than 4 arrays");
13#define VINIT(d) dim(d), v(MaxDimension), x(v[0]), y(v[1]), z(v[2]), w(v[3])
19 for (
int i = 0; i <
dim; ++i)
40 static_assert(
MaxDimension >= Dim,
"Dim too large for ParameterVector");
42 for (
int i = 0; i < Dim; ++i)
105 for (
iterator it = from; it != to; ++it) {
117 v[i] = std::numeric_limits<S>::lowest();
126 v[i] = std::numeric_limits<S>::max();
134 for (
int i=0; i<dim; ++i)
135 result[i] = -result[i];
140ParameterVector<S> ParameterVector<S>::operator*(S
const &rhs)
const {
142 ParameterVector result(*
this);
143 for (
int i=0; i<dim; ++i)
151 ParameterVector result(*
this);
152 for (
int i=0; i<dim; ++i)
158ParameterVector<S> ParameterVector<S>::operator-(ParameterVector
const &rhs)
const {
160 ParameterVector result(*
this);
161 for (
int i=0; i<dim; ++i)
167S ParameterVector<S>::operator *(ParameterVector
const & rhs)
const {
170 for (
int i=0; i<dim; ++i)
171 result += v[i] * rhs[i];
178void ParameterVector<S>::setMinimum(
const S x,
const S y,
const S z,
const S w) {
186void ParameterVector<S>::setMinimum(
const S *v) {
187 for (
int i=0; i<dim; ++i)
192ParameterVector<S> ParameterVector<S>::minimum()
const {
194 return ParameterVector(dim, &m_min[0]);
198void ParameterVector<S>::setMaximum(
const S x,
const S y,
const S z,
const S w) {
206void ParameterVector<S>::setMaximum(
const S *v) {
207 for (
int i=0; i<dim; ++i)
212ParameterVector<S> ParameterVector<S>::maximum()
const {
214 return ParameterVector(dim, &m_max[0]);
221 return boost::lexical_cast<std::string>(*
this);
229 for (
int i = 0; i < v1.
dim; ++i)
245 for (
int i = 0; i < v1.
dim && i < v2.
dim; ++i) {
258 for (
int i = 0; i < v1.
dim && i < v2.
dim; ++i) {
272 for (
int i = 0; i < v.
dim; ++i) {
Definition: paramvector.h:18
std::vector< S >::iterator iterator
Definition: paramvector.h:95
ParameterVector()
Definition: paramvector_impl.h:76
int dim
Definition: paramvector.h:38
static ParameterVector max(int dim=MaxDimension)
Definition: paramvector_impl.h:122
ParameterVector & operator=(const ParameterVector &rhs)
Definition: paramvector_impl.h:89
static const int MaxDimension
Definition: paramvector.h:21
std::vector< S > v
Definition: paramvector.h:39
static ParameterVector min(int dim=MaxDimension)
Definition: paramvector_impl.h:113
std::string str() const
Definition: paramvector_impl.h:219
Definition: allobjects.cpp:30
std::string operator+(const std::string &s, const shm_name_t &n)
Definition: shmname.cpp:58
bool operator!=(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
Definition: paramvector_impl.h:237
const int MaxDimension
Definition: dimensions.h:11
std::ostream & operator<<(std::ostream &out, const Meta &meta)
Definition: objectmeta.cpp:45
bool operator<(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
Definition: paramvector_impl.h:243
bool operator>(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
Definition: paramvector_impl.h:256
VistleVector< Scalar, d > ScalarVector
Definition: vector.h:20
bool operator==(const ParameterVector< S > &v1, const ParameterVector< S > &v2)
Definition: paramvector_impl.h:225
#define VINIT(d)
Definition: paramvector_impl.h:13