Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

vec3.h File Reference

#include <vector>
#include <cmath>
#include <iostream>

Include dependency graph for vec3.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  EMAN

Classes

class  EMAN::Vec4< Type >
 The Vec4 object is a templated object, intended to instantiated with basic types such as int, float, double etc. More...
class  EMAN::Vec3< Type >
 The Vec3 object is a templated object, intended to instantiated with basic types such as int, float, double etc. More...
class  EMAN::Vec2< Type >
 The Vec2 is precisely the same as Vec3 except it works exclusively in 2D Note there are convenient typedef so one needn't bother about using template terminology typedef Vec2<float> Vec2f; typedef Vec2<int> Vec2i; typedef Vec2double> Vec2d; // Not recommended for use unless precision is addressed in this class. More...

Defines

#define eman__vec3_h__   1
 
Id
vec3.h,v 1.30 2011/07/15 22:00:21 john Exp


Typedefs

typedef Vec4< float > Vec4f
typedef Vec4< int > Vec4i
typedef Vec4< double > Vec4d
typedef Vec3< float > Vec3f
typedef Vec3< int > Vec3i
typedef Vec3< double > Vec3d
typedef Vec2< float > Vec2f
typedef Vec2< int > Vec2i
typedef Vec2< double > Vec2d

Functions

template<typename Type, typename Type2>
Vec3< Type > operator+ (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec3< Type > operator+ (const Vec3< Type > &v, const Type2 &n)
template<typename Type, typename Type2>
Vec3< Type > operator- (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec3< Type > operator- (const Vec3< Type > &v, const Type2 &n)
template<typename Type>
Vec3< Type > operator- (const Vec3< Type > &v)
template<typename Type, typename Type2>
Type operator * (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec3< Type2 > operator * (const Type &d, const Vec3< Type2 > &v)
template<typename Type, typename Type2>
Vec3< Type > operator * (const Vec3< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
Vec3< Type2 > operator/ (const Type &d, const Vec3< Type2 > &v)
template<typename Type, typename Type2>
Vec3< Type > operator/ (const Vec3< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
bool operator== (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
bool operator!= (const Vec3< Type > &v1, const Vec3< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type > operator+ (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type > operator+ (const Vec2< Type > &v, const Type2 &n)
template<typename Type, typename Type2>
Vec2< Type > operator- (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type > operator- (const Vec2< Type > &v, const Type2 &n)
template<typename Type>
Vec2< Type > operator- (const Vec2< Type > &v)
template<typename Type, typename Type2>
Type operator * (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
Vec2< Type2 > operator * (const Type &d, const Vec2< Type2 > &v)
template<typename Type, typename Type2>
Vec2< Type > operator * (const Vec2< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
Vec2< Type2 > operator/ (const Type &d, const Vec2< Type2 > &v)
template<typename Type, typename Type2>
Vec2< Type > operator/ (const Vec2< Type > &v, const Type2 &d)
template<typename Type, typename Type2>
bool operator== (const Vec2< Type > &v1, const Vec2< Type2 > &v2)
template<typename Type, typename Type2>
bool operator!= (const Vec2< Type > &v1, const Vec2< Type2 > &v2)


Define Documentation

#define eman__vec3_h__   1
 

Id
vec3.h,v 1.30 2011/07/15 22:00:21 john Exp

Definition at line 37 of file vec3.h.


Typedef Documentation

typedef Vec2<double> EMAN::Vec2d
 

Definition at line 1077 of file vec3.h.

typedef Vec2<float> EMAN::Vec2f
 

Definition at line 1075 of file vec3.h.

Referenced by EMAN::RTFExhaustiveAligner::align(), EMAN::Transform::get_pre_trans_2d(), EMAN::Transform::get_trans_2d(), EMAN::EMData::insert_rect_slice(), EMAN::EMData::insert_rect_slice_ctf(), EMAN::EMData::insert_rect_slice_ctf_applied(), EMAN::operator *(), EMAN::padfft_slice(), EMAN::Util::point_is_in_convex_polygon_2d(), EMAN::Util::point_is_in_triangle_2d(), EMAN::BackProjectionReconstructor::preprocess_slice(), EMAN::MaxValProjector::project3d(), EMAN::StandardProjector::project3d(), EMAN::Transform::set_trans(), EMAN::Transform::transform(), EMAN::TransformProcessor::transform(), and EMAN::Transform::translate().

typedef Vec2<int> EMAN::Vec2i
 

Definition at line 1076 of file vec3.h.

typedef Vec3<double> EMAN::Vec3d
 

Definition at line 699 of file vec3.h.

Referenced by EMAN::EMUtil::process_region_io().

typedef Vec3<float> EMAN::Vec3f
 

Definition at line 697 of file vec3.h.

Referenced by ali3d_d(), EMAN::TranslationalAligner::align(), EMAN::PointArray::align_2d(), EMAN::PointArray::align_trans_2d(), EMAN::PawelProjector::backproject3d(), EMAN::Util::calc_bilinear_least_square(), EMAN::EMData::cut_slice(), EMAN::WienerFourierReconstructor::do_compare_slice_work(), EMAN::FourierReconstructor::do_compare_slice_work(), EMAN::WienerFourierReconstructor::do_insert_slice_work(), EMAN::FourierReconstructor::do_insert_slice_work(), EMAN::Util::equation_of_plane(), EMAN::EMData::extract_plane(), EMAN::EMData::extract_plane_rect(), EMAN::EMData::extract_plane_rect_fast(), EMAN::TetrahedralSym::get_asym_unit_points(), EMAN::PlatonicSym::get_asym_unit_points(), EMAN::HSym::get_asym_unit_points(), EMAN::DSym::get_asym_unit_points(), EMAN::CSym::get_asym_unit_points(), EMAN::DSym::get_asym_unit_triangles(), EMAN::CSym::get_asym_unit_triangles(), EMAN::BoxingTools::get_color(), EMAN::Transform::get_hflip_transform(), EMAN::Transform::get_matrix3_row(), EMAN::Transform::get_params(), EMAN::Transform::get_params_inverse(), EMAN::Transform::get_pre_trans(), EMAN::EMData::get_rotated_clip(), EMAN::Symmetry3D::get_touching_au_transforms(), EMAN::Transform::get_trans(), EMAN::PointArray::get_vector_at(), EMAN::Transform::get_vflip_transform(), EMAN::EMData::has_attr(), EMAN::Symmetry3D::in_which_asym_unit(), EMAN::EMData::insert_rect_slice(), EMAN::EMData::insert_rect_slice_ctf(), EMAN::EMData::insert_rect_slice_ctf_applied(), EMAN::TestTomoImage::insert_rectangle(), EMAN::EMData::max_3D_pixel_error(), EMAN::operator *(), EMAN::OptimumOrientationGenerator::optimize_distances(), EMAN::Symmetry3D::point_in_which_asym_unit(), EMAN::RotateInFSProcessor::process_inplace(), EMAN::TestImageEllipse::process_inplace(), EMAN::TestImageHollowEllipse::process_inplace(), EMAN::AutoMaskAsymUnit::process_inplace(), EMAN::MaxValProjector::project3d(), EMAN::StandardProjector::project3d(), EMAN::PawelProjector::project3d(), EMAN::GaussFFTProjector::project3d(), EMAN::Quaternion::Quaternion(), refalin3d_perturbquat(), EMAN::PointArray::replace_by_summation(), EMAN::PointArray::right_transform(), EMAN::PDBReader::right_transform(), EMAN::EMData::rot_scale_trans(), EMAN::EMData::rot_scale_trans_background(), EMAN::Quaternion::rotate(), EMAN::Transform::rotate_origin_newBasis(), EMAN::EMData::rotate_translate(), EMAN::PointArray::set_from(), EMAN::Transform::set_rotation(), EMAN::Transform::set_trans(), set_translation(), EMAN::PointArray::set_vector_at(), EMAN::TestUtil::test_Vec3f(), EMAN::Quaternion::to_angle(), EMAN::Quaternion::to_axis(), EMAN::Transform::transform(), EMAN::TransformProcessor::transform(), EMAN::PointArray::transform(), EMAN::Transform::translate(), EMAN::EMData::translate(), EMAN::EMData::uncut_slice(), EMAN::Quaternion::unreal(), and verify().

typedef Vec3<int> EMAN::Vec3i
 

Definition at line 698 of file vec3.h.

Referenced by ali3d_d(), AlignOptions::AlignOptions(), EMAN::PawelProjector::backproject3d(), EMAN::ChaoProjector::backproject3d(), EMAN::ChaoProjector::bckpj3(), bckpj3(), bckpj3_Cart(), EMAN::ChaoProjector::cb2sph(), cb2sph(), CleanStack(), CleanStack_Cart(), fcalc(), fgcalc(), EMAN::WatershedProcessor::find_region(), find_region(), EMAN::ChaoProjector::fwdpj3(), fwdpj3(), fwdpj3_Cart(), EMAN::EMUtil::get_region_dims(), getcb2sph(), EMAN::ChaoProjector::getnnz(), getnnz(), LBD_Cart(), main(), EMAN::EMData::mask_contig_region(), EMAN::PawelProjector::prepcubes(), EMAN::WatershedProcessor::process_inplace(), EMAN::EMUtil::process_region_io(), EMAN::ChaoProjector::project3d(), EMAN::MaxValProjector::project3d(), EMAN::StandardProjector::project3d(), EMAN::PawelProjector::project3d(), recons3d_CGLS_mpi_Cart(), recons3d_HyBR_mpi_Cart(), recons3d_sirt_mpi(), recons3d_sirt_mpi_Cart(), EMAN::ChaoProjector::sph2cb(), sph2cb(), EMAN::TestUtil::test_Vec3i(), EMAN::EMData::translate(), unified(), and EMAN::WatershedProcessor::watershed().

typedef Vec4<double> EMAN::Vec4d
 

Definition at line 258 of file vec3.h.

typedef Vec4<float> EMAN::Vec4f
 

Definition at line 256 of file vec3.h.

typedef Vec4<int> EMAN::Vec4i
 

Definition at line 257 of file vec3.h.


Function Documentation

template<typename Type, typename Type2>
Vec2<Type> operator * const Vec2< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 1035 of file vec3.h.

References v.

01035                                                                           {
01036         // Preserve the vector type
01037                 Vec2<Type> v1(v);
01038                 v1 *= d;
01039                 return v1;
01040         }

template<typename Type, typename Type2>
Vec2<Type2> operator * const Type &  d,
const Vec2< Type2 > &  v
[inline]
 

Definition at line 1026 of file vec3.h.

References v.

01027         {
01028                 // Preserve the vector type
01029                 Vec2<Type2> v1(v);
01030                 v1 *= d;
01031                 return v1;
01032         }

template<typename Type, typename Type2>
Type operator * const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 1020 of file vec3.h.

References EMAN::Vec2< Type >::dot().

01021         {
01022                 return v1.dot(v2);
01023         }

template<typename Type, typename Type2>
Vec3<Type> operator * const Vec3< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 657 of file vec3.h.

References v.

00657                                                                           {
00658                 // Preserve the vector type
00659                 Vec3<Type> v1(v);
00660                 v1 *= d;
00661                 return v1;
00662         }

template<typename Type, typename Type2>
Vec3<Type2> operator * const Type &  d,
const Vec3< Type2 > &  v
[inline]
 

Definition at line 648 of file vec3.h.

References v.

00649         {
00650                 // Preserve the vector type
00651                 Vec3<Type2> v1(v);
00652                 v1 *= d;
00653                 return v1;
00654         }

template<typename Type, typename Type2>
Type operator * const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 642 of file vec3.h.

References EMAN::Vec3< Type >::dot().

00643         {
00644                 return v1.dot(v2);
00645         }

template<typename Type, typename Type2>
bool operator!= const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 1068 of file vec3.h.

01068                                                                              {
01069                 if (v1[0] != v2[0] || v1[1] != v2[1] ) {
01070                         return true;
01071                 }
01072                 return false;
01073         }

template<typename Type, typename Type2>
bool operator!= const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 690 of file vec3.h.

00690                                                                              {
00691                 if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) {
00692                         return true;
00693                 }
00694                 return false;
00695         }

template<typename Type, typename Type2>
Vec2<Type> operator+ const Vec2< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 991 of file vec3.h.

References v.

00992         {
00993                 Vec2<Type> v1(v);
00994                 v1 += n;
00995                 return v1;
00996         }

template<typename Type, typename Type2>
Vec2<Type> operator+ const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 985 of file vec3.h.

00986         {
00987                 return Vec2<Type>(static_cast<Type>(v1[0] + v2[0]), static_cast<Type>(v1[1] + v2[1]));;
00988         }

template<typename Type, typename Type2>
Vec3<Type> operator+ const Vec3< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 597 of file vec3.h.

References v.

00598         {
00599                 Vec3<Type> v1(v);
00600                 v1 += n;
00601                 return v1;
00602         }

template<typename Type, typename Type2>
Vec3<Type> operator+ const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 590 of file vec3.h.

00591         {
00592 
00593                 return Vec3<Type>(static_cast<Type>(v1[0] + v2[0]), static_cast<Type>(v1[1] + v2[1]),static_cast<Type>(v1[2] + v2[2]));;
00594         }

template<typename Type>
Vec2<Type> operator- const Vec2< Type > &  v  )  [inline]
 

Definition at line 1013 of file vec3.h.

References v.

01014         {
01015                 return Vec2<Type>(-v[0],-v[1]);
01016         }

template<typename Type, typename Type2>
Vec2<Type> operator- const Vec2< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 1005 of file vec3.h.

References v.

01006         {
01007                 Vec2<Type> v1(v);
01008                 v1 -= n;
01009                 return v1;
01010         }

template<typename Type, typename Type2>
Vec2<Type> operator- const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 999 of file vec3.h.

01000         {
01001                 return Vec2<Type>(static_cast<Type>(v1[0] - v2[0]),     static_cast<Type>(v1[1] - v2[1]));
01002         }

template<typename Type>
Vec3<Type> operator- const Vec3< Type > &  v  )  [inline]
 

Definition at line 628 of file vec3.h.

References v.

00629         {
00630                 return Vec3<Type>(-v[0],-v[1],-v[2]);
00631         }

template<typename Type, typename Type2>
Vec3<Type> operator- const Vec3< Type > &  v,
const Type2 &  n
[inline]
 

Definition at line 621 of file vec3.h.

References v.

00622         {
00623                 Vec3<Type> v1(v);
00624                 v1 -= n;
00625                 return v1;
00626         }

template<typename Type, typename Type2>
Vec3<Type> operator- const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 613 of file vec3.h.

00614         {
00615                 return Vec3<Type>(static_cast<Type>(v1[0] - v2[0]),
00616                                                   static_cast<Type>(v1[1] - v2[1]),
00617                                                   static_cast<Type>(v1[2] - v2[2]));
00618         }

template<typename Type, typename Type2>
Vec2<Type> operator/ const Vec2< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 1052 of file vec3.h.

References v.

01052                                                                           {
01053                 // Preserve the vector type
01054                 Vec2<Type> v1(v);
01055                 v1 /= d;
01056                 return v1;
01057         }

template<typename Type, typename Type2>
Vec2<Type2> operator/ const Type &  d,
const Vec2< Type2 > &  v
[inline]
 

Definition at line 1043 of file vec3.h.

References v.

01044         {
01045         // Preserve the vector type
01046                 Vec2<Type2> v1(v);
01047                 v1 /= d;
01048                 return v1;
01049         }

template<typename Type, typename Type2>
Vec3<Type> operator/ const Vec3< Type > &  v,
const Type2 &  d
[inline]
 

Definition at line 674 of file vec3.h.

References v.

00674                                                                           {
00675                 // Preserve the vector type
00676                 Vec3<Type> v1(v);
00677                 v1 /= d;
00678                 return v1;
00679         }

template<typename Type, typename Type2>
Vec3<Type2> operator/ const Type &  d,
const Vec3< Type2 > &  v
[inline]
 

Definition at line 665 of file vec3.h.

References v.

00666         {
00667                 // Preserve the vector type
00668                 Vec3<Type2> v1(v);
00669                 v1 /= d;
00670                 return v1;
00671         }

template<typename Type, typename Type2>
bool operator== const Vec2< Type > &  v1,
const Vec2< Type2 > &  v2
[inline]
 

Definition at line 1060 of file vec3.h.

01060                                                                              {
01061                 if (v1[0] == v2[0] && v1[1] == v2[1] ) {
01062                         return true;
01063                 }
01064                 return false;
01065         }

template<typename Type, typename Type2>
bool operator== const Vec3< Type > &  v1,
const Vec3< Type2 > &  v2
[inline]
 

Definition at line 682 of file vec3.h.

00682                                                                              {
00683                 if (v1[0] == v2[0] && v1[1] == v2[1] && v1[2] == v2[2]) {
00684                         return true;
00685                 }
00686                 return false;
00687         }


Generated on Tue Jun 11 13:47:35 2013 for EMAN2 by  doxygen 1.3.9.1