IMP logo
IMP Reference Guide  develop.eb1b99edaa,2026/06/22
The Integrative Modeling Platform
VectorD.h File Reference

Simple D vector class. More...

#include <IMP/kernel_config.h>
#include <IMP/internal/VectorBaseD.h>
#include <IMP/types.h>
#include <IMP/check_macros.h>
#include <IMP/exception.h>
#include <IMP/utility.h>
#include <IMP/InputAdaptor.h>
#include <IMP/random.h>
#include <IMP/vectord_macros.h>
#include <boost/random/variate_generator.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/range.hpp>
#include <limits>
#include <cmath>
+ Include dependency graph for VectorD.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  IMP::VectorD< D >
 A Cartesian vector in D-dimensions. More...
 

Namespaces

 IMP
 Base functionality and abstract base classes for representation, scoring and sampling.
 

Typedefs

typedef VectorD< 1 > IMP::Vector1D
 
typedef Vector< VectorD< 1 > > IMP::Vector1Ds
 
typedef VectorD< 2 > IMP::Vector2D
 
typedef Vector< VectorD< 2 > > IMP::Vector2Ds
 
typedef VectorD< 3 > IMP::Vector3D
 
typedef Vector< VectorD< 3 > > IMP::Vector3Ds
 
typedef VectorD< 4 > IMP::Vector4D
 
typedef Vector< VectorD< 4 > > IMP::Vector4Ds
 
typedef VectorD< 5 > IMP::Vector5D
 
typedef Vector< VectorD< 5 > > IMP::Vector5Ds
 
typedef VectorD< 6 > IMP::Vector6D
 
typedef Vector< VectorD< 6 > > IMP::Vector6Ds
 
typedef VectorD<-1 > IMP::VectorKD
 
typedef Vector< VectorD<-1 > > IMP::VectorKDs
 

Functions

template<int D>
int IMP::compare (const VectorD< D > &a, const VectorD< D > &b)
 lexicographic comparison of two vectors More...
 
template<unsigned int I, int D>
const double & std::get (const IMP::VectorD< D > &v)
 
template<unsigned int I, int D>
double & std::get (IMP::VectorD< D > &v)
 
template<int D>
VectorD< D > IMP::get_basis_vector_d (unsigned int coordinate)
 Return the basis vector for the given coordinate. More...
 
template<int D>
VectorD< D > IMP::get_basis_vector_kd (int Di, unsigned int coordinate)
 Return the basis vector for the given coordinate. More...
 
template<>
VectorD<-1 > IMP::get_basis_vector_kd (int D, unsigned int coordinate)
 Return a dynamically sized basis vector. More...
 
template<int D>
double IMP::get_distance (const VectorD< D > &v1, const VectorD< D > &v2)
 Compute the distance between two vectors. More...
 
template<int D>
VectorD< D > IMP::get_elementwise_product (const VectorD< D > &a, const VectorD< D > &b)
 Return the vector that is the elementwise product of the two. More...
 
template<int D>
VectorD< D > IMP::get_elementwise_product (const Ints &a, const VectorD< D > &b)
 Return the vector that is the elementwise product of the two. More...
 
template<int D>
VectorD< D > IMP::get_ones_vector_d (double v=1)
 Return a vector of ones (or another constant) More...
 
template<int D>
VectorD< D > IMP::get_ones_vector_kd (unsigned int Di, double v=1)
 Return a vector of ones (or another constant) More...
 
template<>
VectorD<-1 > IMP::get_ones_vector_kd (unsigned int D, double v)
 Return a vector of ones (or another constant) More...
 
template<int D>
double IMP::get_squared_distance (const VectorD< D > &v1, const VectorD< D > &v2)
 Compute the squared distance between two vectors. More...
 
template<class C >
const VectorD< C::DIMENSION > & IMP::get_vector_geometry (const C &g)
 
template<int D>
VectorD< D > IMP::get_zero_vector_d ()
 Return a vector of zeros. More...
 
template<int D>
VectorD< D > IMP::get_zero_vector_kd (int Di)
 Return a dynamically sized vector of zeros. More...
 
template<>
VectorD<-1 > IMP::get_zero_vector_kd (int D)
 Return a dynamically sized vector of zeros. More...
 
template<int D>
VectorD< D > IMP::operator* (double s, VectorD< D > o)
 
template<class C , class E >
void IMP::set_vector_geometry (C &g, const E &v)
 

Norms

We define a number of standard, \(L^p\), norms on VectorD.

  • \(L^1\) is the Manhattan distance, the sum of the components
  • \(L^2\) is the standard Euclidean length
  • \(L^{\inf}\) is the maximum of the components
template<int D>
double IMP::get_l2_norm (const VectorD< D > &v)
 
template<int D>
double IMP::get_l1_norm (const VectorD< D > &v)
 
template<int D>
double IMP::get_linf_norm (const VectorD< D > &v)
 

Detailed Description

Simple D vector class.

Copyright 2007-2026 IMP Inventors. All rights reserved.

Definition in file VectorD.h.