10 #ifndef BRAINRAT_DATA_MEASUREVECTOR_H
11 #define BRAINRAT_DATA_MEASUREVECTOR_H
17 #include <aims/def/assert.h>
18 #include <cartobase/object/object.h>
19 #include <cartobase/object/property.h>
20 #include <cartobase/smart/rcptr.h>
96 for (int32_t i = 0; i < this->size(); i++)
98 (&*_data)[i] = values[i];
103 template <
typename T>
107 _size = other.
size();
108 _data =
new T[other.
size()];
112 for(it1 = other.
begin(), it2 = begin(); it1 < e; it1++, it2++ ) {
135 return (&*_data) + size();
142 return (&*_data) + size();
163 ASSERT(size() == other.
size());
164 for (int32_t i = 0; i < size(); i++)
165 (*
this)[i] = other[i];
173 for (int32_t i = 0; i < size(); i++)
182 ASSERT(size() == other.
size());
183 for (int32_t i = 0; i < size(); i++)
184 (*
this)[i] += other[i];
192 ASSERT(size() == other.
size());
193 for (int32_t i = 0; i < size(); i++)
194 (*
this)[i] -= other[i];
202 for (int32_t i = 0; i < size(); i++)
212 for (int32_t i = 0; i < size(); i++)
223 for (int32_t i = 0; i < size(); i++) {
224 result += (aa[i] - (*this)[i]) * (aa[i] - (*
this)[i]);
227 return( sqrt( result ) );
280 for (int32_t i = 0; i < aa.
size(); i++) {
281 out << carto::toString(aa[i]);
282 if (i < (aa.
size() - 1))
292 template<
typename T >
294 void printVector( std::ostream& os,
const std::vector<T> & thing )
296 typename std::vector<T>::const_iterator i, e = thing.end();
298 for(i = thing.begin(); i < e; ++i)
311 printVector<double>(os, thing);
317 printVector<int>(os, thing);
328 DECLARE_GENERIC_OBJECT_TYPE(
carto::Array<
carto::Array<
int> >::interfaced_iterator )
329 DECLARE_GENERIC_OBJECT_TYPE(
carto::Array<
carto::Array<
carto::Array<
int> > > )
330 DECLARE_GENERIC_OBJECT_TYPE(
carto::Array<
carto::Array<
carto::Array<
int> > >::interfaced_iterator )
T & operator[](unsigned x)
const T * const_iterator
basic constant iterator
double distance(const BaseMeasureVector< T > &aa) const
BaseMeasureVector< T > & operator-=(const BaseMeasureVector< T > &other)
BaseMeasureVector< T > & operator*=(const T &val)
BaseMeasureVector< T > & operator+=(const BaseMeasureVector< T > &other)
BaseMeasureVector< T > & operator/=(const T &val)
T * iterator
basic iterator
BaseMeasureVector(const size_type size, const T *=NULL)
size_t size_type
size of the basic type
BaseMeasureVector< T > & operator=(const BaseMeasureVector< T > &other)
const T & const_reference
basic constant reference
ptrdiff_t difference_type
difference type
T & reference
basic reference
const size_type size() const
void printVector(std::ostream &os, const std::vector< T > &thing)
ImageProcessors<AimsRGB, double> p(data, mask, "rgbm", options, ImageProcessorMode::Init); ImageProce...
std::ostream & operator<<(std::ostream &os, const bio::BVclass &thing)
bio::BaseMeasureVector< double > MeasureVector
BaseMeasureVector< T > operator/(const BaseMeasureVector< T > &aa, const T &bb)
BaseMeasureVector< T > operator-(const BaseMeasureVector< T > &aa, const BaseMeasureVector< T > &bb)
BaseMeasureVector< T > operator+(const BaseMeasureVector< T > &aa, const BaseMeasureVector< T > &bb)
BaseMeasureVector< T > operator*(const BaseMeasureVector< T > &aa, const T &bb)
std::ostream & operator<<(std::ostream &os, const carto::Array< bio::BVclass > &thing)